Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions go/internal/e2e/event_fidelity_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,7 @@ func TestEventFidelityE2E(t *testing.T) {

if answer == nil {
t.Fatal("Expected SendAndWait to return an assistant message")
}
if ad, ok := answer.Data.(*copilot.AssistantMessageData); !ok || !strings.Contains(ad.Content, "18") {
} else if ad, ok := answer.Data.(*copilot.AssistantMessageData); !ok || !strings.Contains(ad.Content, "18") {
t.Errorf("Expected answer to contain '18', got %v", answer.Data)
}
})
Expand Down
6 changes: 2 additions & 4 deletions go/internal/e2e/rpc_server_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -604,8 +604,7 @@ func TestRPCServerE2E(t *testing.T) {
projectSkillPath := findSkillDiscoveryPath(skillPaths.Paths, ctx.WorkDir)
if projectSkillPath == nil {
t.Fatalf("Expected skill discovery paths to include %q", ctx.WorkDir)
}
if strings.TrimSpace(projectSkillPath.Path) == "" {
} else if strings.TrimSpace(projectSkillPath.Path) == "" {
t.Fatal("Expected non-empty skill discovery path")
}

Expand All @@ -632,8 +631,7 @@ func TestRPCServerE2E(t *testing.T) {
projectAgentPath := findAgentDiscoveryPath(agentPaths.Paths, ctx.WorkDir)
if projectAgentPath == nil {
t.Fatalf("Expected agent discovery paths to include %q", ctx.WorkDir)
}
if strings.TrimSpace(projectAgentPath.Path) == "" {
} else if strings.TrimSpace(projectAgentPath.Path) == "" {
t.Fatal("Expected non-empty agent discovery path")
}

Expand Down
17 changes: 9 additions & 8 deletions go/internal/e2e/rpc_server_misc_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,14 +159,15 @@ func TestRpcServerMisc(t *testing.T) {
}
if users == nil {
t.Fatal("Expected non-nil users result")
}
for _, user := range *users {
userInfo, ok := user.AuthInfo.(*rpc.UserAuthInfo)
if !ok {
t.Fatalf("Expected user auth info in all users, got %#v", user.AuthInfo)
}
if userInfo.Login == "go-account-user" && (user.Token == nil || *user.Token != "go-account-token") {
t.Fatalf("Expected logged-in user's token to round trip, got %+v", user)
} else {
for _, user := range *users {
userInfo, ok := user.AuthInfo.(*rpc.UserAuthInfo)
if !ok {
t.Fatalf("Expected user auth info in all users, got %#v", user.AuthInfo)
}
if userInfo.Login == "go-account-user" && (user.Token == nil || *user.Token != "go-account-token") {
t.Fatalf("Expected logged-in user's token to round trip, got %+v", user)
}
}
}

Expand Down
6 changes: 2 additions & 4 deletions go/internal/e2e/rpc_server_plugins_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ func TestRpcServerPlugins(t *testing.T) {
listed := findPortedInstalledPlugin(afterInstall.Plugins, portedPluginName, portedMarketplaceName)
if listed == nil {
t.Fatalf("Expected installed plugin %q in marketplace %q", portedPluginName, portedMarketplaceName)
}
if !listed.Enabled {
} else if !listed.Enabled {
t.Fatal("Expected listed marketplace plugin to be enabled")
}

Expand Down Expand Up @@ -229,8 +228,7 @@ func TestRpcServerPlugins(t *testing.T) {
mine := findPortedMarketplace(list.Marketplaces, portedMarketplaceName)
if mine == nil {
t.Fatalf("Expected marketplace %q in list %+v", portedMarketplaceName, list.Marketplaces)
}
if mine.IsDefault != nil && *mine.IsDefault {
} else if mine.IsDefault != nil && *mine.IsDefault {
t.Fatal("Expected local marketplace not to be marked default")
}
if !containsPortedDefaultMarketplace(list.Marketplaces) {
Expand Down
6 changes: 2 additions & 4 deletions go/internal/e2e/rpc_ui_ephemeral_query_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,9 @@ func TestRpcUiEphemeralQuery(t *testing.T) {
}
if result == nil {
t.Fatal("Expected non-nil ephemeral query result")
}
if strings.TrimSpace(result.Answer) == "" {
} else if strings.TrimSpace(result.Answer) == "" {
t.Fatal("Expected non-empty ephemeral query answer")
}
if !strings.Contains(strings.ToLower(result.Answer), "blue") {
} else if !strings.Contains(strings.ToLower(result.Answer), "blue") {
t.Fatalf("Expected answer to contain blue, got %q", result.Answer)
}
})
Expand Down
36 changes: 18 additions & 18 deletions go/internal/e2e/system_message_sections_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ func TestSystemMessageSectionsE2E(t *testing.T) {
}
if response == nil {
t.Fatal("Expected a response from the assistant")
}

ad, ok := response.Data.(*copilot.AssistantMessageData)
if !ok {
t.Fatalf("Expected AssistantMessageData, got %T", response.Data)
}
content := strings.ToLower(ad.Content)
if !strings.Contains(content, "botanica") && !strings.Contains(content, "garden") && !strings.Contains(content, "plant") {
t.Errorf("Expected response to reflect the replaced identity section, but got: %s", ad.Content)
} else {
ad, ok := response.Data.(*copilot.AssistantMessageData)
if !ok {
t.Fatalf("Expected AssistantMessageData, got %T", response.Data)
}
content := strings.ToLower(ad.Content)
if !strings.Contains(content, "botanica") && !strings.Contains(content, "garden") && !strings.Contains(content, "plant") {
t.Errorf("Expected response to reflect the replaced identity section, but got: %s", ad.Content)
}
}
})

Expand Down Expand Up @@ -82,15 +82,15 @@ func TestSystemMessageSectionsE2E(t *testing.T) {
}
if response == nil {
t.Fatal("Expected a response from the assistant")
}

ad, ok := response.Data.(*copilot.AssistantMessageData)
if !ok {
t.Fatalf("Expected AssistantMessageData, got %T", response.Data)
}
content := strings.ToLower(ad.Content)
if !strings.Contains(content, "botanica") && !strings.Contains(content, "garden") && !strings.Contains(content, "plant") {
t.Errorf("Expected response to reflect the replaced preamble section, but got: %s", ad.Content)
} else {
ad, ok := response.Data.(*copilot.AssistantMessageData)
if !ok {
t.Fatalf("Expected AssistantMessageData, got %T", response.Data)
}
content := strings.ToLower(ad.Content)
if !strings.Contains(content, "botanica") && !strings.Contains(content, "garden") && !strings.Contains(content, "plant") {
t.Errorf("Expected response to reflect the replaced preamble section, but got: %s", ad.Content)
}
}
})
}
31 changes: 16 additions & 15 deletions go/internal/e2e/tools_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,22 +140,23 @@ func TestToolsE2E(t *testing.T) {

if answer == nil {
t.Fatalf("Expected non-nil assistant message")
}
ad, ok := answer.Data.(*copilot.AssistantMessageData)
if !ok {
t.Fatalf("Expected AssistantMessageData")
}
} else {
ad, ok := answer.Data.(*copilot.AssistantMessageData)
if !ok {
t.Fatalf("Expected AssistantMessageData")
}

content := ad.Content
if content == "" {
t.Fatalf("Expected non-empty response")
}
lower := strings.ToLower(content)
if !strings.Contains(lower, "analyzing") {
t.Errorf("Expected response to contain 'analyzing', got %q", content)
}
if !strings.Contains(lower, "item_alpha") && !strings.Contains(lower, "item_beta") {
t.Errorf("Expected response to contain 'item_alpha' or 'item_beta', got %q", content)
content := ad.Content
if content == "" {
t.Fatalf("Expected non-empty response")
}
lower := strings.ToLower(content)
if !strings.Contains(lower, "analyzing") {
t.Errorf("Expected response to contain 'analyzing', got %q", content)
}
if !strings.Contains(lower, "item_alpha") && !strings.Contains(lower, "item_beta") {
t.Errorf("Expected response to contain 'item_alpha' or 'item_beta', got %q", content)
}
}
mu.Lock()
gotPhase := currentPhase
Expand Down
Loading