From 0f8b62b85fe787956b55f6f1e9f1bc4951cd0b25 Mon Sep 17 00:00:00 2001 From: ekam-walia <164983405+ekam-walia@users.noreply.github.com> Date: Tue, 1 Sep 2026 17:15:33 +0530 Subject: [PATCH] fix(test): e2e suite silently skips every test Signed-off-by: ekam-walia <164983405+ekam-walia@users.noreply.github.com> --- go/core/internal/service/tool/mcp_test.go | 6 +++--- go/core/test/e2e/interaction_test.go | 23 +++++++++++++++-------- go/core/test/e2e/lifecycle_test.go | 11 +++++++++-- 3 files changed, 27 insertions(+), 13 deletions(-) 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 4c739bb18..d0d6aff9c 100644 --- a/go/core/test/e2e/interaction_test.go +++ b/go/core/test/e2e/interaction_test.go @@ -44,7 +44,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 { @@ -59,7 +59,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?") @@ -85,7 +85,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{ @@ -177,7 +177,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) @@ -194,7 +194,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.") { @@ -223,7 +223,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?") @@ -283,7 +283,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) @@ -394,7 +394,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()))