diff --git a/go/core/internal/service/tool/mcp_test.go b/go/core/internal/service/tool/mcp_test.go index aa7a15e23..1a997b516 100644 --- a/go/core/internal/service/tool/mcp_test.go +++ b/go/core/internal/service/tool/mcp_test.go @@ -14,7 +14,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" ) -func TestVisibilityAllowsApp(t *testing.T) { +func TestE2EVisibilityAllowsApp(t *testing.T) { tests := []struct { name string meta map[string]any @@ -36,7 +36,7 @@ func TestVisibilityAllowsApp(t *testing.T) { } } -func TestValidateMCPAppResource(t *testing.T) { +func TestE2EValidateMCPAppResource(t *testing.T) { tests := []struct { name string result *mcp.ReadResourceResult @@ -77,7 +77,7 @@ func TestValidateMCPAppResource(t *testing.T) { } } -func TestRuntimeMCPClientResolveServerMatrix(t *testing.T) { +func TestE2ERuntimeMCPClientResolveServerMatrix(t *testing.T) { remote := &v1alpha3.RemoteMCPServer{ ObjectMeta: metav1.ObjectMeta{Name: "remote", Namespace: "default"}, Spec: v1alpha3.RemoteMCPServerSpec{ diff --git a/go/core/test/e2e/interaction_test.go b/go/core/test/e2e/interaction_test.go index 4329682c0..3f91f9c52 100644 --- a/go/core/test/e2e/interaction_test.go +++ b/go/core/test/e2e/interaction_test.go @@ -51,7 +51,7 @@ var interactionMocks embed.FS // TestAgentInstanceInteraction verifies the complete public interaction path: // gateway routing, Substrate Actor transport, Go ADK execution, and the model call. -func TestAgentInstanceInteraction(t *testing.T) { +func TestE2ECreateInteraction(t *testing.T) { fixture := newInteractionFixture(t, interactionTarget(t), startInteractionMock(t)) _, _, task := fixture.send(t, "What is 2+2?") if task.Status.State != a2atype.TaskStateCompleted { @@ -66,7 +66,7 @@ func TestAgentInstanceInteraction(t *testing.T) { } } -func TestAgentInstanceAskUserSurvivesSuspension(t *testing.T) { +func TestE2EAgentInstanceAskUserSurvivesSuspension(t *testing.T) { fixture := newInteractionFixture(t, interactionTarget(t), startMockLLM(t, "mocks/invoke_golang_hitl_ask_user.json")) fixture.ctx = metadata.AppendToOutgoingContext(fixture.ctx, strings.ToLower(a2atype.SvcParamExtensions), adka2a.HITLExtensionURI) _, _, waiting := fixture.send(t, "Which database should we use for storage?") @@ -92,7 +92,7 @@ func TestAgentInstanceAskUserSurvivesSuspension(t *testing.T) { } } -func TestAgentInstanceCheckpoint(t *testing.T) { +func TestE2EAgentInstanceCheckpoint(t *testing.T) { fixture := newInteractionFixture(t, interactionTarget(t), startInteractionMock(t)) _, _, task := fixture.send(t, "What is 2+2?") created, err := fixture.checkpoints.CreateCheckpoint(fixture.ctx, &apiv1alpha1.CreateCheckpointRequest{ @@ -184,7 +184,7 @@ func TestAgentInstanceCheckpoint(t *testing.T) { } } -func TestMCPInteraction(t *testing.T) { +func TestE2EMCPInteraction(t *testing.T) { target := interactionTarget(t) mcpURL, mcpServer := startMCPMock(t) template := createMCPInteractionTemplate(t, startMockLLM(t, "mocks/invoke_mcp_agent.json"), mcpURL) @@ -201,7 +201,7 @@ func TestMCPInteraction(t *testing.T) { t.Fatal("mock MCP server did not receive an add_numbers tool call") } -func TestSharedAgentInteraction(t *testing.T) { +func TestE2ESharedAgentInteraction(t *testing.T) { fixture := newSharedInteractionFixture(t, interactionTarget(t)) _, _, task := fixture.send(t, "Ask the specialist") if task.Status.State != a2atype.TaskStateCompleted || !strings.Contains(taskText(task), "Answer from the shared specialist.") { @@ -230,7 +230,7 @@ func TestSharedAgentInteraction(t *testing.T) { } } -func TestAgentInstanceTaskPersistenceAndIdempotency(t *testing.T) { +func TestE2EAgentInstanceTaskPersistenceAndIdempotency(t *testing.T) { fixture := newInteractionFixture(t, interactionTarget(t), startInteractionMock(t)) message, request, task := fixture.send(t, "What is 2+2?") @@ -290,7 +290,7 @@ func TestAgentInstanceTaskPersistenceAndIdempotency(t *testing.T) { } } -func TestAgentInstanceActiveTask(t *testing.T) { +func TestE2EAgentInstanceActiveTask(t *testing.T) { target := interactionTarget(t) modelURL, started := startBlockingInteractionMock(t) fixture := newInteractionFixture(t, target, modelURL) @@ -408,7 +408,14 @@ func interactionTarget(t *testing.T) string { target = os.Getenv("KAGENT_GRPC_URL") } if target == "" { - t.Skip("KAGENT_E2E_GRPC_TARGET is not set") + t.Fatalf("KAGENT_E2E_GRPC_TARGET or KAGENT_GRPC_URL must be set to run e2e tests.\n" + + "To run e2e tests locally:\n" + + " 1. Create a Kind cluster: make create-kind-cluster\n" + + " 2. Install Substrate and Kagent (see CI workflow in .github/workflows/ci.yaml)\n" + + " 3. Set the gRPC target:\n" + + " export KAGENT_E2E_GRPC_TARGET=:8084\n" + + " 4. Run tests: go test -v ./core/test/e2e/...\n" + + "See go/core/test/e2e/README.md for full instructions.") } return target } diff --git a/go/core/test/e2e/lifecycle_test.go b/go/core/test/e2e/lifecycle_test.go index 20e7f31a6..7d599b6d2 100644 --- a/go/core/test/e2e/lifecycle_test.go +++ b/go/core/test/e2e/lifecycle_test.go @@ -19,13 +19,20 @@ import ( // against a clean cluster. The cluster installation owns the fixed kagent/smoke // Harness and AgentTemplate fixtures; this test owns only the AgentInstance it // creates through the public API. -func TestAgentInstanceLifecycle(t *testing.T) { +func TestE2EAgentInstanceLifecycle(t *testing.T) { target := os.Getenv("KAGENT_E2E_GRPC_TARGET") if target == "" { target = os.Getenv("KAGENT_GRPC_URL") } if target == "" { - t.Skip("KAGENT_E2E_GRPC_TARGET is not set") + t.Fatalf("KAGENT_E2E_GRPC_TARGET or KAGENT_GRPC_URL must be set to run e2e tests.\n" + + "To run e2e tests locally:\n" + + " 1. Create a Kind cluster: make create-kind-cluster\n" + + " 2. Install Substrate and Kagent (see CI workflow in .github/workflows/ci.yaml)\n" + + " 3. Set the gRPC target:\n" + + " export KAGENT_E2E_GRPC_TARGET=:8084\n" + + " 4. Run tests: go test -v ./core/test/e2e/...\n" + + "See go/core/test/e2e/README.md for full instructions.") } conn, err := grpc.NewClient(target, grpc.WithTransportCredentials(insecure.NewCredentials()))