Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ jobs:
run: |
make setup-envtest
export KUBEBUILDER_ASSETS="$(make -s envtest-path)"
go test -race -skip 'TestE2E.*' -v ./...
go test -race -v ./... -skip 'TestE2E.*'

helm-unit-tests:
env:
Expand Down
23 changes: 15 additions & 8 deletions go/core/test/e2e/interaction_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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?")
Expand All @@ -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{
Expand Down Expand Up @@ -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)
Expand All @@ -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.") {
Expand Down Expand Up @@ -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?")

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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=<controller-address>:8084\n" +
" 4. Run tests: go test -v ./core/test/e2e/...\n" +
"See go/core/test/e2e/README.md for full instructions.")
}
return target
}
Expand Down
11 changes: 9 additions & 2 deletions go/core/test/e2e/lifecycle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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=<controller-address>: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()))
Expand Down