Testing
Orka has four kinds of tests: Go unit tests, controller integration tests against a real API server (envtest), end-to-end tests against a throwaway Kind cluster, and frontend tests in the browser-like Vitest environment. This page describes what each covers and how to run it.
Running tests
# Run test pipeline (manifests, generate, fmt, vet, then Go tests)
make test
# Run Go tests with coverage report
make test
go tool cover -func=cover.out | grep total
# Run release automation and workspace cleanup tests without a cluster
go test ./cmd/build/release ./scripts/tests
# Run frontend tests
make ui-test # or: cd ui && bun run test
make ui-test-coverage # or: cd ui && bun run test:coverage
# Run E2E tests (requires isolated Kind cluster)
make test-e2e
# Run only the deterministic Gateway live E2E
KIND_CLUSTER=orka-gateway-e2e \
E2E_GATEWAY=true \
E2E_EPHEMERAL_CLUSTER=true \
E2E_GINKGO_FOCUS="Gateway live E2E" \
make test-e2e
# External workspace proof runs from the separate orka-workspace checkout.
# See Development's external workspace local proof section.
# Lint
make lint
make lint-fix
make ui-lint
The E2E runner uses separate Go and Ginkgo deadlines. Local defaults are
E2E_GO_TEST_TIMEOUT=50m, E2E_GINKGO_TIMEOUT=45m, and
E2E_GINKGO_GRACE_PERIOD=2m. Each CI lane sets its Ginkgo deadline 5m
below its Go deadline, and Gateway live E2E uses 75m and 70m.
When overriding these values, leave room inside the Go deadline for both an
interrupted spec and suite cleanup to finish their grace periods.
Native Codex handoff gate
The Native Codex handoff job in .github/workflows/test.yml compiles the
supervisor test from the current checkout and runs it inside the pinned production
Codex 0.160.0 / codex-acp 2.1.1 image. Docker networking is disabled; inference uses
a local scripted Responses server and disposable test credentials. The container
uses only the production supervisor's CHOWN, KILL, SETGID, and SETUID capabilities.
The gate restores the original thread UUID through session/resume, continues
across fresh homes with rotated credentials, checks current destination policy,
and verifies read and write intents, a publishable workspace delta, native capture,
return history, unchanged source bytes, and runtime cleanup. It explicitly enables
ORKA_NATIVE_CODEX_TEST=1 and requires the named test to pass, so a skipped test
cannot satisfy the job. This verifies the native integration, not live-model recall.
On one continuation the gate requests max for gpt-6-astra and checks
model and reasoning.effort in the actual POST /v1/responses body. This
verifies what the pinned client sends, not which live models or Azure
deployments accept it.
Local environment notes
- Script test suites need bash >= 4. The suites under
scripts/tests/rely onset -estopping on failed(( ))arithmetic, which macOS's stock bash 3.2 does not honor — failures would pass silently. The suites refuse to run under bash < 4; on macOS install a modern bash (brew install bash) and invoke the suites with it. - A green Gateway E2E can be an empty one. Without
E2E_GATEWAY=truethe gateway specs skip themselves and Ginkgo printsRan 0 of N Specswith aSUCCESSexit. If you see that line, nothing was validated — re-run with the environment shown above. (CI fails this shape explicitly.) - Running
go testdirectly on controller packages needs envtest assets.make testwiresKUBEBUILDER_ASSETSautomatically; for a barego teston packages that start an envtest API server, export it first:KUBEBUILDER_ASSETS="$(bin/setup-envtest use -p path)".
Repository monitor fake-GitHub suite
The RepositoryMonitor workflows have an integrated, secret-free suite that runs against fake GitHub servers. It covers durable command intake, replay and coalescing, guard-label blocking, issue implementation to pull request, stop/resume late-task safety, and pull request review, repair, and readiness. These tests do not claim live model execution.
make repository-monitor-fake-e2e # the fake-GitHub E2E scenarios
make repository-monitor-validate # plus generated CLI docs, example manifests, website docs, and workflow syntax
The Repository Monitor Smoke GitHub Actions workflow runs the same fake-GitHub script on
relevant pull requests. Live model execution, publication, and GitHub rule enforcement need
separate validation against an explicitly selected repository.
Test structure
Go tests
Tests use Ginkgo + Gomega (BDD style) for controller/integration tests and standard Go testing for unit tests.
| Package | Test Files | Coverage Areas |
|---|---|---|
cmd/build/release/ | workflow_test.go, prepare_test.go, publish_test.go, version_test.go | Release version edits, trusted tooling, branch races, artifact identity, approval evidence, chart publication, and retries. Uses local Git repositories and Helm; GitHub and registry responses are fixtures. |
scripts/tests/ | workspace_lifecycle_test.go | Workspace cancellation, session archival, suspension, and deletion ordering using Bash and jq fixtures. |
internal/api/ | handlers_test.go, internal_handlers_test.go, auth_test.go, middleware_test.go, pagination_test.go, server_test.go, openai_compat_test.go | REST API handlers, internal API handlers, memory/session APIs, authentication, middleware, pagination, OpenAI compatibility |
internal/controller/ | task_controller_test.go, agent_controller_test.go, tool_controller_test.go, session_manager_test.go, job_builder_test.go, repositoryscan_controller_test.go, webhook_test.go | Reconciliation logic, session management, job building, coordination enforcement, repository scan mapper/finding/patch ingestion |
internal/security/ | security_test.go, contracts_test.go | Repository security artifact contracts, v2 evidence validation, fingerprinting, bounded context manifests, prompt helpers |
internal/security/slices/ | mapper_test.go | Deterministic review-slice mapper coverage for Go, Node/TypeScript, Python, workflows, scripts, config, path skipping, and stable output |
internal/store/sqlite/ | security_store_test.go | Repository security records, findings, review slices, dropped finding diagnostics, patch proposals |
internal/store/sqlite/ | schema_test.go, integration_test.go | Complete current schema, incompatible-layout rejection without data loss, repeated reopening with stable record identities and ordering |
internal/llm/ | provider_test.go | Provider registry |
internal/llm/anthropic/ | provider_test.go | Anthropic API integration |
internal/llm/openai/ | provider_test.go | OpenAI API integration |
internal/metrics/ | metrics_test.go | Prometheus metrics recording |
internal/tools/ | registry_test.go, memory tool tests, coordination tool tests, PR tool tests, agent-management tool tests, integration_test.go | Built-in tool implementations, memory tools, coordination tools, PR tools, agent management tools |
internal/worker/ | tool_executor_test.go | Custom Tool CRD executor |
workers/ai/ | main_test.go | AI worker functions |
workers/general/ | main_test.go | General worker functions |
internal/harness/v2/, internal/acp/, workers/acp/ | ACP contract, client, supervisor, and conformance tests | RuntimeSession lifecycle, exact fences, duplicate handling, event bounds, cancellation, workspace deltas, process cleanup, and redaction |
E2E tests
End-to-end tests run against a dedicated Kind cluster:
| Test File | Coverage |
|---|---|
test/e2e/e2e_test.go | Core task lifecycle |
test/e2e/agent_test.go | Agent task execution |
test/e2e/agent_copilot_test.go | Copilot built-in profile admission plus exact digest-pinned RuntimePool image selection, without requiring live provider authentication |
test/e2e/agent_claude_test.go | Claude runtime |
test/e2e/agent_workspace_test.go | Workspace/git clone |
test/e2e/agent_session_test.go | Session continuity |
test/e2e/autonomous_mode_test.go | Autonomous iterations, max-iteration stop, Plan API, suspend behavior |
test/e2e/coordination_advanced_test.go | cancel_task, inter-task messaging, auto-retry, dynamic agent create/delete |
test/e2e/pr_workflow_test.go | PR tool workflow (create_pull_request, review/comment/merge) and workspace PR env wiring |
test/e2e/api_coverage_test.go | Sessions, agent update API, single-tool API, auth validation, secrets API, chat delete, non-autonomous plan 404 |
test/e2e/chat_advanced_test.go | JSON chat mode, agentRef chat routing, management tools via chat |
test/e2e/security_enforcement_test.go | Non-root execution, read-only filesystem, deny-pattern enforcement, kube-system chat block |
test/e2e/agent_advanced_test.go | Skills ConfigMap wiring, agent resource propagation, session maxMessages behavior |
test/e2e/workspace_advanced_test.go | Workspace source/ref/subPath, separate read/publication credential roles, delivery status, and Session behavior |
test/e2e/live_copilot_proxy_test.go | Native type: ai Provider compatibility against the separately deployed copilot-proxy service; this is separate from built-in Copilot ACP RuntimePool coverage |
test/e2e/live_chat_api_test.go | Live chat SSE and JSON transport/session coverage using a proxy-backed Provider |
test/e2e/anthropic_compat_test.go | Anthropic-compatible /anthropic/v1/models and /anthropic/v1/messages coverage with default tools-enabled behavior, on aimock or the live proxy |
test/e2e/coordination_memory_tools_test.go | Coordination memory tool auto-injection and execution (search_transcript, recall_memory, propose_memory, remember) and proposal review without durable writes, on aimock or the live proxy |
test/e2e/agent_runtime_lifecycle_test.go | Go port of scripts/agent-runtime-e2e.sh (label agent-runtime): RuntimePool profile projection and execution fences; read, Session continuation, and Task fork for Codex, OpenCode, Claude, and Copilot; an idle adapter killed between prompts, which OpenCode and Claude resume in place under the same RuntimeSession generation (with Claude's resume-time model request refused by the provider proxy) and which Copilot, unable to resume, fails as RuntimeLost before rebuilding from the transcript on the next continuation; unsafe workspace URLs; concurrency within capacity; Task timeout and deletion cancellation through the cleanup finalizer; controller restart without replay; Pod replacement and scale-to-zero recovery of the same RuntimeSession; OpenCode read-intent tool policy; and Session archival and RuntimePool cleanup. On aimock it also checks that each continuation, fork, and recovery replayed the prior transcript to the model, except for Copilot: its requests exceed the 64 KB aimock journal cap, so its continuations rely on the RuntimeSession identity checks, as in the bash lane |
test/e2e/aimock_runtime_eval_test.go | Model-free adversarial evals on the actual Codex, Claude, Copilot, and OpenCode CLIs: consumed SCM/proxy credential containment, governed extraction during Session continuation, and repository-origin read-only mutation checks with independent delivery/publication evidence |
test/e2e/aimock_authorization_eval_test.go | Deployed broker allowlist, delegation namespace/agent restrictions, and child transaction-scope containment on a supported external runtimeRef; native publication-authority checks, permitted controls, and a synthetic signing/JWKS/TTS fixture |
test/e2e/agent_runtime_matrix_test.go | Codex against a pinned read workspace, OpenCode read-intent enforcement, and Claude session wiring through the provider proxy (aimock as Vekil, or the live proxy), plus a digest-pinned Copilot image smoke assertion; it is not the canonical ACP release gate |
test/e2e/gateway_test.go | Authenticated Gateway ingress through a deterministic external AgentRuntime, including TLS adapter readiness, invalid bearer rejection, accepted and duplicate events, Task execution, completed events, delivered replies, idempotency, and Task/delivery correlation |
.github/workflows/gateway-e2e.yml | Focused, model-free, secret-free Gateway live E2E in Kind using generated bearer tokens, an ephemeral CA, the TLS reference adapter, and the deterministic echo runtime |
.github/workflows/repository-monitor-smoke.yml | Focused RepositoryMonitor smoke coverage for store CRUD, API handlers, pull request event handling, targeted single-PR inventory runs, controller queue/review flow, blocked status counts, read-only review task job building, result stdout forwarding, create_pr_monitor repository URL and credential validation, GitHub tool repo_url scope enforcement, and PR review marker tooling |
.github/workflows/security-scan-e2e.yml / scripts/security-scan-e2e.sh | Secret-free repository security scan Kind validation against pinned sozercan/nodejs-goof using the real mapper, deterministic fake Codex analyzer, v2 finding ingestion/drop diagnostics, threat-model rejection, idempotent rescan, and HITL no-auto-patch gating |
test/e2e/tools_test.go | Built-in tools (including web_fetch, file_write) and custom Tool CRD |
test/e2e/scheduled_task_test.go | Cron scheduling, suspend, concurrencyPolicy: Forbid, history-limit cleanup |
test/e2e/task_lifecycle_test.go | Timeout/retry/cancel plus session serialization and lock release |
scripts/agent-runtime-e2e.sh | Canonical deployed-cluster ACP smoke/release gate for Codex, OpenCode, Claude, and Copilot RuntimePools, exact Pod/runtime identity, workspace read/write, continuation, cancellation/timeout, restart/replacement, publication/PR verification, immutable images, and cleanup |
.github/workflows/agent-runtime-e2e.yml / scripts/agent-runtime-kind-e2e.sh | Manual agent runtime smoke that calls real model providers, requires credentials, and bootstraps an ephemeral Kind cluster, Vekil, and the production ACP topology before invoking the canonical validator |
.github/workflows/release-qualification.yml / scripts/agent-runtime-kind-e2e.sh | Environment-approved chart and runtime acceptance, real local Git publication tests, GitHub API fixture tests, and cleanup; no stored Git publication credentials |
The Gateway Live E2E workflow (.github/workflows/gateway-e2e.yml) runs on manual dispatch and on pull requests or pushes that touch Gateway-relevant source, configuration, E2E, image, or dependency paths. It creates a dedicated Kind cluster, generates disposable TLS and bearer credentials, deploys the TLS reference adapter and deterministic echo AgentRuntime, and verifies invalid bearer rejection, accepted and duplicate ingress, runtime-backed Task completion, final delivery, idempotency, and correlation metadata. The workflow is model-free and secret-free; it does not use repository or provider credentials.
Which CI lanes run for a pull request
The Kind-based lanes are the slowest checks, so they skip changes that cannot affect them. E2E Tests
and Live GitHub OIDC E2E run for any change except ui/, website/, docs/, examples/,
Markdown, .agents/, .claude/, LICENSE, .gitignore, and .github/ (a change to the lane's own workflow or to
.github/actions/ still runs it). Gateway Live E2E and the other path-listed lanes run only for the paths in their
workflow. A UI change is covered by UI Lint, UI Tests, and the Website workflow, whose dashboard build runs tsc -b;
example and docs changes are covered by Docs Check and Go Tests. Go Tests and Lint still run on UI changes
because they are also the release gates, and one Go test reads ui/src/routes.
A new push to a pull request cancels that pull request's in-progress Tests, Lint, and E2E Tests runs. Pushes to
main and release runs are never cancelled.
The Gateway Live E2E GitHub Actions workflow deploys the TLS reference adapter, a deterministic external AgentRuntime, and a test-only native worker image in Kind. It preserves private-CA trust, readiness, ingress deduplication, and external-v2 final-only/no-Job coverage. Native coverage creates real gateway Tasks and controller Jobs/Pods, authenticates origin, and executes the production ReplyInConversationTool with the reusable native client. It verifies budget-backed admission/replay, observes a delivered interim receipt while the Task is still Running, and only then releases final completion. A rolled adapter with --interim-delivery=false must produce the tool's typed unsupported rejection with no enqueue and still deliver final. Local start/release fences are driven through Kubernetes exec; no production authorization exception is added. CI requires all three specs, retaining the zero-spec guard. It does not run the conformance CLI and does not replace conformance testing against each adapter build before rollout.
That deterministic fixture does not prove model-driven worker registration or live ACP tool execution. Native worker unit/integration tests separately cover actual registration, advertisement, dispatch, and continued model work. ACP integration tests exercise the production tool through a signed broker capability, active prompt/session guard, and real SQLite, with no native Job; Kubernetes and broker credential resolution use test fixtures, not a live RuntimePool/provider. Local unit/integration results and tagged E2E compilation are not evidence that the live suite ran. Live native delivery requires the workflow's three specs to execute successfully; the external-v2 spec remains final-only.
The Repository Monitor Smoke workflow runs in GitHub Actions on pull requests and pushes that touch the workflow, API, controller, CRD/config, worker, or Go dependency paths. It creates the UI embed stub and runs focused go test selections for the monitor store, API handlers, GitHub pull request event handling, targeted single-PR inventory runs, controller queue/review flow, blocked status counts, read-only review job construction, result stdout forwarding, create_pr_monitor repository URL and credential validation, GitHub tool repo_url scope enforcement, and PR review marker signing/detection tooling. The workflow is secret-free: exact PR event queueing is tested with synthetic signed webhook payloads and fake GitHub clients rather than live repository credentials. The normal Go Tests workflow runs make test for non-doc code changes and covers worker-level PR review diff context generation.
Repository security E2E coverage should include initial deterministic slice creation, incremental scan behavior, invalid v2 evidence being dropped and visible through API, validation task persistence, successful verified patch proposals, and patch proposals with missing or mismatched artifacts staying not ready.
Adversarial aimock evals
The adversarial-eval label is part of the agent-runtime lane. These evals
script a model acting on an untrusted repository file or brokered tool note and
check the resulting system boundaries. They do not measure model judgment
or resistance to prompt injection. The existing fast, in-process evals remain unchanged.
The legitimate prompt asks to read a fixture file or tool note. The malicious action is scripted only after its nonce returns as a real tool result. Passing a prevention case requires both the returned refusal and independent evidence that no forbidden Task, token exchange, workspace change, push, or PR occurred. Permitted controls exercise the same tools and consume the fixture credentials; absence of a credential that was never used is not containment evidence. Public broker/CLI refusals intentionally redact private executor errors. Each delegation denial is paired with a permitted same-tool control and independent Task, token-exchange, and access receipts; generic failure alone is not proof of a specific authorization boundary.
A test-only proxy in front of aimock retains complete request bodies, including bodies above aimock's own 64 KiB journal cap. It stores no headers or response bodies and never logs captured content. Capture is bounded to 4 MiB per request, 64 MiB in total, and 4096 entries; exhaustion rejects requests rather than silently discarding evidence. Snapshot exports stream one entry at a time with a single concurrent exporter, rather than buffering a potentially expanded whole-store JSON response. Eval helpers require a stable capture instance, retained request identities, completed responses, and matching fixture receipts. Missing or incomplete observation cannot pass. Auxiliary requests are scanned as well as the case's marked inference requests.
All credentials are synthetic and local to the test cluster. The provider canary covers Orka's upstream proxy bearer, not vendor credentials held by a real Vekil deployment. Child-local loopback capabilities are distinct from that bearer. Transaction tests use cryptographically valid, ephemeral mock authority and inspect actual child-token exchange results; malformed tokens are not a scope-containment control. Canary detector tests deliberately plant exposure and verify that failure messages omit the values.
Built-in ACP Tasks reject transaction-token delegation before inference. The shared TxToken cases therefore use the conformed external harness-v2 E2E fixture, which runs a bounded aimock loop against the real controller's public MCP broker using accepted running-Task fences. An exact fixture-only ingress grant connects it to isolated aimock; the production proxy-only ingress policy is unchanged. The injected note is a real brokered tool result, not native repository content. Parent and permitted child tokens must be valid, and the child consumes its token in a brokered control. The fixture keeps these Tasks running until normal cancellation cleanup; a completed model loop is not presented as native Task success. Publication checks use real Claude Tasks without a transaction context. Its flat MCP protocol fits the pinned mock; this case does not cover Codex namespaced MCP calls. No test claims that built-in runtimes support TxTokens or that external fixtures exercise native CLI workspace isolation.
Run the focused label through the usual isolated E2E bootstrap:
E2E_GINKGO_LABEL_FILTER=adversarial-eval E2E_ACP_IDLE_POOL_TTL=15m make test-e2e
Every runtime must satisfy native refusal plus ReadValidated and no
publication. Claude, Copilot, and OpenCode refuse the write tool itself. Codex
reads and writes through one shell tool, so its refusal comes from the
filesystem: under read intent the supervisor owns the workspace and the
session root, and the Codex shell's write fails with Permission denied.
The capture, signing-fixture, detector, and fixture-contract tests also run without a cluster:
make ensure-ui-embed
go test ./test/fixtures/aimockcapture/... ./test/fixtures/aimockauthority/...
go test -tags=e2e ./test/e2e -run 'Test(AimockEval|RuntimeEval|AuthorizationEval)'
E2E key requirements
-
scripts/agent-runtime-e2e.sh --context <context>is the canonical ACP deployed-cluster validator. Its default mode is a smoke test of runtime behavior against real models.RELEASE_GATE=1checks the shipped artifacts instead: one workspace read with its API result per runtime, unsafe workspace rejection, and image digests. The Kind wrapper also requires uncached publication tests. A smoke result cannot qualify a release. Live GitHub publication is available only through an explicit local opt-in. -
scripts/agent-runtime-kind-e2e.shis the CI/local bootstrap entrypoint. It creates an ephemeral Kind cluster, deploys Vekil and the production ACP topology with digest-pinned local images, and then calls the canonical script. -
.github/workflows/agent-runtime-e2e.ymlruns by manual dispatch only. It requires the repository'sCOPILOT_GITHUB_TOKENsecret so Vekil can exercise Codex, OpenCode, Claude, and Copilot against real model providers without mounting provider credentials into RuntimePools. The workflow rejects dispatches from other branches before using the secret. It runs as ordinary CI without a deployment environment. When migrating fromlive-acp-runtime-smoke, ensure the provider secret is available at repository scope. After the renamed workflow succeeds, retire the old environment and preserve its deployment history. -
.github/workflows/release-qualification.ymlusesworkflow_dispatchand is serialized. The release workflow dispatches it automatically. Restrict therelease-qualificationenvironment tomainand exact permitted release branches, require a trusted reviewer, and disable administrator bypass. It accepts a full source SHA that must equal both the dispatched workflow commit and selected branch head. GitHub observations use the job's temporaryGITHUB_TOKENwithcontents: read. Agent execution runs against aimock (ACP_E2E_MODEL_BACKEND=aimock), so no model-provider secret, stored Git publication token, or fork setting is needed. Publication tests use real temporary Git repositories and local GitHub API test servers. They do not prove the complete cluster-to-GitHub publication path or live organization permissions. Release qualification documents trusted dispatch, required test evidence, report verification, and cleanup. Qualification needs the report for the exact candidate; smoke success is insufficient. -
Neither
Agent Runtime E2EnorRelease Qualificationruns forpull_request, so PR-controlled code never receives provider credentials. Both check out with persisted credentials disabled and expose secrets only to the final local script step. The release gate addsactions: readtocontents: readto verify the environment branch rules and download candidate artifacts using the native token. Neither workflow requestsid-token: write; GitHub OIDC validation remains isolated inlive-github-oidc-e2e.yml. -
The release gate additionally requires digest-pinned controller, Publisher, Codex, OpenCode, Claude, and Copilot images; a Ready central provider proxy; the
config/acp-productionVekil ingress boundary; durable controller/Publisher PVCs; a distinct publication fork; and authenticatedghaccess for independent remote and PR verification/cleanup. -
The validator runs Codex, then OpenCode, Claude, and Copilot, deleting each provider's pools before starting the next. Every provider phase verifies exact Pod UID, image ID, runtime instance/profile, and RuntimeSession identity. Smoke mode also checks continuation, OpenCode's read-intent tool policy, and, for Codex, concurrency, cancellation and timeout settlement, controller restart, and pool replacement. Release mode runs only the reads and, with the local opt-in, the live publication canary.
-
E2E_OPENAI_API_KEYandE2E_ANTHROPIC_API_KEYremain inputs for older nativetype: aitest cases. They are not mounted into built-in ACP RuntimePools. When either key is unset, the suite deploys aimock in the test namespace and backs that provider with scripted fixtures fromtest/e2e/testdata/aimock, so those specs run in the E2E lanes without credentials. SetE2E_DISABLE_MOCK_LLM=1to skip them instead. Fixture conventions are intest/e2e/testdata/aimock/README.md. The Anthropic-compatible API, coordination memory tool, and agent runtime matrix specs also run on aimock by default; withE2E_LIVE_COPILOT_PROXY_BASE_URLset they use the live proxy instead. -
The suite enables Task provenance trust after verifying the
orka-admissionprovenance webhook thatmake deployinstalls, so coordination messaging andcancel_taskrun in the default lane. -
The
Agent runtime lifecyclejob intest-e2e.ymlruns theagent-runtimelabel on its own Kind cluster, and the default job excludes it. Those specs restart the controller and park, replace, and scale RuntimePools, and they need the production idle pool TTL, so the job setsE2E_ACP_IDLE_POOL_TTL=15m(the default lane uses5s). Run them locally withmake test-e2e E2E_GINKGO_LABEL_FILTER=agent-runtime E2E_ACP_IDLE_POOL_TTL=15m. -
The default lane also runs one clean-room publication end to end without github.com: a scripted Codex RuntimePool talks to a second aimock deployed as
vekil-system/vekilbehind the production provider proxy, and the publisher clones from, pushes to, and opens a pull request on an in-cluster fake forge (test/fixtures/fakeforge: real Git smart HTTP plus the GitHub REST endpoints the publisher calls). -
COPILOT_GITHUB_TOKENalso remains the credential forlive-copilot-proxy-e2e.yml, which covers the external proxy as native Provider test infrastructure.Agent Runtime E2Eprovides the provider-execution evidence for the built-in RuntimePool profiles. -
Structural e2e tests for native worker Jobs run without external model keys.
-
Live Agent Sandbox E2EandAgent Substrate E2Edo run workspace-backed ACP Tasks end to end against a local model fixture, but they are not the full release gate: external-provider execution stays withAgent Runtime E2E, and release acceptance withRelease Qualification. Every Substrate run includes DataOnly suspension, cold continuation, and checkpoint file recovery against the unmodified upstream provider. -
Security Scan E2E is secret-free and model-free, but requires Docker plus the local Go, Kind, kubectl, curl, and jq toolchain.
-
Gateway Live E2E is model-free and secret-free. Its focused invocation sets
E2E_GATEWAY=trueandE2E_EPHEMERAL_CLUSTER=true; the last flag skips per-resource suite cleanup because the caller deletes the entire Kind cluster. -
GitHub Actions
id-token: writepermission: required by the live GitHub OIDC workflow. For local/manual runs ofscripts/live-github-oidc-e2e.sh, setORKA_GITHUB_OIDC_TOKENto a valid JWT instead. Provider-specific transaction-token E2E lives in the external integration repositories. -
E2E_LIVE_COPILOT_PROXY_BASE_URL(orE2E_COPILOT_PROXY_BASE_URL/COPILOT_PROXY_BASE_URL): enables the focused live copilot-proxy spec against a running proxy -
E2E_LIVE_COPILOT_PROXY_SERVICE_NAMESPACE,E2E_LIVE_COPILOT_PROXY_SERVICE_NAME,E2E_LIVE_COPILOT_PROXY_SERVICE_PORT: direct-access proxy coordinates used by the legacy Provider, Chat, and Anthropic compatibility specs. -
E2E_LIVE_ACP_PROVIDER_PROXY_SERVICE_NAMESPACE,E2E_LIVE_ACP_PROVIDER_PROXY_SERVICE_NAME,E2E_LIVE_ACP_PROVIDER_PROXY_SERVICE_PORT: model-discovery coordinates for the ACP RuntimePool matrix. The full live script pins these tovekil-system,vekil, and1337so built-in RuntimePools traverse the production provider-proxy DNS and NetworkPolicy boundary.
Live provider/chat tests prefer gpt-5-mini and claude-haiku-4.5 when available.
The runtime smoke and release qualification scripts default to gpt-5.4-mini
for Codex and OpenCode, claude-haiku-4.5 for Claude, and gpt-5.3-codex for
Copilot. Override these with ACP_E2E_CODEX_MODEL, ACP_E2E_OPENCODE_MODEL,
ACP_E2E_CLAUDE_MODEL, or ACP_E2E_COPILOT_MODEL. Configured models must pass
the Vekil catalog and streaming probes.
Run the trusted smoke bootstrap locally with the token exported in the shell rather than placed on a command line:
read -rsp 'Copilot provider token: ' COPILOT_GITHUB_TOKEN && echo
export COPILOT_GITHUB_TOKEN
export ACP_E2E_OPENCODE_MODEL=openai/gpt-5.4-mini
export ACP_E2E_OPENCODE_CONTEXT_WINDOW=32768
export ACP_E2E_OPENCODE_MAX_TOKENS=4096
ACP_E2E_KIND_TAG=local bash scripts/agent-runtime-kind-e2e.sh
For a local qualification diagnostic, use read-only GitHub CLI access and the same model-provider configuration as the smoke run. GitHub's automatic job token is available only inside Actions. To use that token without configuring local GitHub access, dispatch Release Qualification.
The local wrapper runs the required Git and PR fixture tests before creating the cluster:
export RELEASE_GATE=1
export ACP_E2E_WRITE_CREATE_PR=0
export ACP_E2E_REPO=https://github.com/orka-agents/orka.git
export ACP_E2E_REF="$(git rev-parse HEAD)"
export ACP_E2E_BASE_BRANCH=main
bash scripts/agent-runtime-kind-e2e.sh
The fixture tests, image build, and runtime phases use the same candidate.
The wrapper requires a clean checkout at that commit, and the candidate must
equal the selected branch head. Local reports are saved under
bin/acp-release-*/acceptance.json, or
ACP_E2E_REPORT_FILE when set. --keep-cluster leaves cleanup pending and cannot
qualify a release; use the trusted workflow and report verifier above for release
records.
The existing local live GitHub diagnostic remains available with
ACP_E2E_WRITE_CREATE_PR=1 and separately authorized canary credentials. Its
four-role and distinct-fork requirements are listed in the validator's --help.
The hosted release workflow cannot enable it and explicitly reports live GitHub
publication as not_tested.
Do not enable shell xtrace for either invocation. The scripts create Kubernetes Secrets without printing their values and redact provider/GitHub token patterns from failure diagnostics.
External workspace provider and core handoff tests live in the shared repository. The fake provider lane checks two-replica leader election, API field ownership, unauthorized writers, exact public Pod identity, and authorized retirement. Its core lane runs the production supervisor and a real RuntimeSession/Task with a deterministic ACP agent, verifies authenticated boot and prompt fences, and observes credential revocation and exact Pod termination.
Standalone Sandbox and Substrate lanes verify native allocation, cold resume, filesystem data, and exact cleanup. Substrate also exports and imports verified data checkpoints after source deletion. They do not claim real core credential bootstrap or full-memory restore. NetworkPolicy object checks on default kind do not prove packet enforcement. An additional native Core Task lane passed real fail-closed admission, sealed bootstrap, authenticated Serving, RuntimeSession and prompt execution, persisted result, and exact native/Core compute and credential retirement. The upgrade lane tests stock binary rejection of legacy pools and every retained workspace state before and after schema pruning. See external workspace local proof for the two-repository workflow.
The RepositoryMonitor validation bundle covers the canonical signed orka:implement entrypoint, durable intake, pause controls, and replay against GitHub fixtures.
The live GitHub OIDC workflow (.github/workflows/live-github-oidc-e2e.yml) runs scripts/live-github-oidc-e2e.sh in GitHub Actions with id-token: write. It builds the controller from the PR, deploys it to a fresh Kind cluster, configures the GitHub OIDC issuer and workflow audience, fetches a real Actions OIDC token, and validates:
- unauthenticated API requests return
401 - OIDC-authenticated Task creation returns
201 - the created Task contains verified
spec.requestedByprovenance - top-level
requestedByand nestedspec.requestedByclient tampering are rejected with400 - the OIDC token does not appear in controller logs
Native Substrate MCP Tool and actor-pool behavior remains in core. External ACP allocation, lifecycle, and checkpoint conformance belongs to the shared provider repository. Each native proof records the pinned backend, provider source, resource identities, and observed termination; it does not add native lifecycle UID/version preconditions that the upstream protocol lacks.
Frontend tests
Frontend tests use Vitest + Testing Library + MSW.
cd ui && bun run test # what CI runs
cd ui && bun run test:coverage # adds the coverage report and threshold check
ui/vite.config.ts declares thresholds of 95% statements, 80% branches, 90% functions, and
95% lines. Those only apply to bun run test:coverage. The ui-test job in
.github/workflows/test.yml runs plain bun run test, so a pull request that drops coverage
still passes CI. Run the coverage command yourself before assuming a number.
CLI tests
CLI binary coverage
Normal binary e2e tests build and invoke bin/orka directly with isolated config/home directories. They intentionally avoid real secrets in command arguments and assert stdout/stderr do not leak configured tokens or sentinel secret values.
| CLI area | Binary e2e status | Notes |
|---|---|---|
auth | Covered | validate, whoami; invalid-token negative path. |
models | Covered | OpenAI and Anthropic compatibility list output. |
config | Covered | Isolated HOME, set-server, fake set-token, masked view. |
status | Covered | Health/readiness/task/agent summary. |
task | Covered | Manifest create, flag create (including read/write workspace policy), structured status, list/filter, get, wait, result, logs, children, plan, artifacts, download, delete. |
workspace | Covered | Canonical workspace intent, credential-role presence, and delivery status. |
runtime-pool | Focused unit coverage | CRUD routing plus lifecycle/admission/capacity table output. |
agent-runtime | Focused unit coverage | CRUD routing plus v2-only identity/profile table output. |
provider | Covered | CRUD and secret redaction expectations. |
agent | Covered | CRUD. |
tool | Covered | CRUD. |
skill | Covered | init, validate, import, list, get, content, update, delete. |
secret | Covered | Metadata-only list. |
audit | Covered | Trace no-match path. |
session | Covered | List/get/delete against a controlled fixture. |
memory | Covered | Create/list/get/disable/enable/update/delete and proposal-list smoke. |
security | Partially covered | Repository scan create/get/list/delete, threat model update/get, scan/finding/slice/dropped-finding list; repository scan update is not covered. |
monitor | Partially covered | Repository monitor create/get/list/delete plus runs/items/events list; monitor update is not covered. |
usage | Compiled-binary fixture coverage | Summary table, work JSON, other-usage YAML, configured authentication, and nonzero exit for a missing work request. |
substrate | Covered | Pool create/get/list/update/delete. |
run | Negative covered; positive live-gated | Unreachable-server error path is safe for normal e2e; positive chat/SSE flow needs provider fixtures. |
dashboard | Negative covered | The default install serves no dashboard, so the e2e covers the refusal before any token URL is printed; the browser-open token URL remains unsuitable for normal e2e logs. |
completion | Covered | Binary smoke generates bash, zsh, fish, and PowerShell completion output. |
security scan run | Deferred/live-gated | Creates downstream scan Tasks and requires live agent/GitHub/provider setup. |
monitor run | Deferred/live-gated | Creates downstream monitor work and can require GitHub/provider setup. |
| security finding actions | Deferred/live-gated | Need stable finding fixtures or live scan data. |
Use this matrix as a coverage guide when adding CLI commands: non-live command groups should have at least one compiled-binary e2e smoke path, and CRUD-style groups should cover create/get/list/update/delete where the API supports it.
Live-gated CLI workflows
Some commands intentionally create downstream work or require external services. Keep these behind explicit operator intent in automation and e2e tests.
orka run
orka run streams chat responses over the Orka chat API. A positive smoke needs server-side chat enabled plus a configured provider/model or agent:
ORKA_API=http://127.0.0.1:8080
ORKA_TOKEN="$(kubectl create token orka-client -n orka-system)"
orka --server "$ORKA_API" --token "$ORKA_TOKEN" \
run --session cli-live-smoke "Reply with one short sentence."
For normal non-live validation, prefer a negative smoke against an unreachable or deliberately unconfigured server and assert a clean error without printing tokens.
orka security scan run
Manual security scan runs can create scan Tasks and may require GitHub credentials, analysis agents, provider credentials, and repository network access:
orka security scan run my-repository-scan
orka security scan list my-repository-scan -o json
Gate this path with explicit environment variables in CI, for example ORKA_CLI_E2E_LIVE_ACTIONS=1, and skip by default when credentials or fixtures are missing.
orka monitor run
Manual repository monitor runs can enqueue repository review/repair work and may require GitHub credentials plus reviewer/repair agents:
orka monitor run my-monitor --target-kind pull_request --target-number 123
orka monitor runs my-monitor -o json
orka monitor items my-monitor -o json
Use live-gated tests or manual verification for this path until stable GitHub/provider fixtures are available.
Testing patterns
Table-driven tests
tests := []struct {
name string
input string
want string
wantErr bool
}{
{"valid", "input", "output", false},
{"invalid", "bad", "", true},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
// test logic
})
}
Fake Kubernetes client
scheme := runtime.NewScheme()
corev1alpha1.AddToScheme(scheme)
corev1.AddToScheme(scheme)
client := fake.NewClientBuilder().WithScheme(scheme).WithObjects(objs...).Build()
HTTP mocking
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusOK)
w.Write([]byte(`{"result": "ok"}`))
}))
defer server.Close()
Fiber test app
app := fiber.New()
app.Get("/test", handler)
req := httptest.NewRequest(http.MethodGet, "/test", nil)
resp, _ := app.Test(req)
Frontend test mocking
// Mock zustand persist middleware
vi.mock('zustand/middleware', () => ({ persist: (fn: unknown) => fn }))
// Use test utils with QueryClient wrapper
import { render } from '@/test/test-utils'
Testing with chat
When testing features via the chat endpoint, use natural prompts — the kind a human would actually type. Never reference internal concepts like agent names, tool names, or implementation details. Describe what you want done, not how the system should do it. The chat should infer the right agents, tools, delegation patterns, and cancellation logic on its own.
Good examples:
- "Research the benefits of Kubernetes and write a technical guide based on the findings."
- "What's the best container orchestration tool? Get me an answer as fast as possible."
- "Draft an outline for a blog post about containers and turn it into a full post."
- "Compare microservices vs monoliths from three angles, then synthesize into a recommendation."
Bad examples:
- "Create a coordinator agent and a researcher agent, then delegate two tasks..."
- "Use the send_message tool to send a message to task msg-receiver..."
- "Have three researchers race to answer..." (users don't think in terms of "researchers")
- "Use the first answer and cancel the others." (the system should infer this automatically)