Test plans are Markdown documents in plans/ for both humans and AI agents. Midnight Saci runs them.
The Markdown must follow the Saci plan format. Read
Write a test plan and the
test plan format of Saci first. This page
adds the rules for Wanaku plans.
A test plan has three layers:
plans/<name>.md) — the test scenario with phases and assertions.plans/common/*.md) — reusable procedures shared across plans (Keycloak setup, namespace creation, cleanup).For OpenShift-based plans, the namespace/project name must default to a unique value per run so multiple plans can execute in the same cluster without colliding. If a shared namespace is required, it should be set explicitly by the operator of the test run.
Organize tests into numbered phases that run sequentially. Each phase groups related assertions. This makes it easy to skip phases, resume after failure, or run a subset.
Phase 0: Manual prerequisites
Phase 1: Environment setup
Phase 2-N: Test scenarios
Phase N+1: Cleanup
Each step needs: a command, an expected outcome, and a PASS/FAIL assertion. Avoid steps that only run a command without checking the result.
# Bad — runs but doesn't verify
oc apply -f my-resource.yaml
# Good — verifies the outcome
oc apply -f my-resource.yaml
oc wait myresource/name --for=condition=Ready --timeout=120s -n "${NAMESPACE}"
Use oc wait, oc rollout status, or a polling loop instead of fixed sleep calls. Clusters vary in speed — a 10s sleep that works locally may fail in CI and waste time on fast clusters.
# Bad
sleep 15
oc get deployment foo
# Good — deterministic wait
oc wait --for=condition=Available deployment/foo --timeout=120s -n "${NAMESPACE}"
# Good — polling for deletion
while oc get deployment foo -n "${NAMESPACE}" > /dev/null 2>&1; do
sleep 3
done
Never hard-code image tags. Define environment variables with sensible defaults so the same plan can test different releases.
export MY_IMAGE="${MY_IMAGE:-quay.io/org/component:latest}"
Then use ${MY_IMAGE} in CR specs and image assertions.
If a procedure appears in more than one plan (or is likely to), move it to plans/common/. The common doc should:
Reference common docs from the main plan with a link and a brief note on what variables must be set before and after:
Follow [common/keycloak-setup.md](common/keycloak-setup.md). After completion,
`KEYCLOAK_URL` and `WANAKU_OIDC_SECRET` must be set.
The main plan should only contain logic unique to that test scenario. If a step duplicates a common doc, replace it with a reference. This prevents drift between documents.
Test plans must use the Wanaku CLI for all interactions with Wanaku Server, Wanaku Barn and Keycloak. The
Saci worker image has wanaku on the PATH. Outside the image, use a wanaku binary that is
installed on the system, or the CLI jar file built from wanaku-barn
(java -jar apps/wanaku-cli/target/quarkus-app/quarkus-run.jar). For Keycloak administration (users, credentials,
realm), use the standalone wanaku-keycloak-admin binary. The image also has it on the PATH.
Do not use curl, wget, httpie, or other HTTP clients to call Wanaku or Keycloak APIs unless the test is specifically oriented to verify HTTP-level behavior (e.g., checking raw HTTP status codes on health endpoints, testing Streamable HTTP headers, or verifying endpoint reachability before the CLI can connect), or the API has no CLI command (for example the enable/disable, audit and metrics routes of Wanaku Server).
# Bad — uses curl to list tools
curl -s "${WANAKU_SERVER_URL}/api/v1/tools" | jq '.data[].name'
# Good — uses the CLI
wanaku tools list --host "${WANAKU_SERVER_URL}" --no-auth --plain
# Acceptable — specifically testing HTTP endpoint reachability
curl -s -o /dev/null -w "%{http_code}" "${WANAKU_SERVER_URL}/health"
Use POSIX-compatible constructs. Avoid bash-only features like ${!VAR} (indirect expansion) since the executor may use zsh or sh. If bash is required, wrap the block in bash -c '...'.
Verify that invalid inputs are rejected gracefully — missing required fields, references to non-existent resources, malformed data. These often catch real bugs.
Wanaku is now two processes. Each test plan must state which of them it needs:
| Component | Source | Role | Local URL | Health check |
|---|---|---|---|---|
| Wanaku Server | wanaku-ai/wanaku (Rust) | MCP endpoint, namespaces, forwards, discovered tools/resources/prompts, admin UI | management http://localhost:8080, MCP http://localhost:8081/<namespace>/mcp |
GET /health |
| Wanaku Barn | wanaku-ai/wanaku-barn (Java) | Service catalogs, service templates, data stores, kamelets, semantic routers, audit, backup | http://localhost:8180 |
GET /q/health/ready |
Use these common procedures:
Point each CLI command at the component that owns the API:
tools, resources, prompts, namespaces, forwards: --host "${WANAKU_SERVER_URL}"service, data-store, backup: --host "${WANAKU_BARN_URL}"mcp: --uri "${WANAKU_MCP_BASE_URL}/<namespace>/mcp"Keep these differences from the Java router in mind:
--no-auth to the CLI in local plans. Authentication is
provided by oauth2-proxy in front of the server (the operator deploys it when spec.auth.enabled is true).-Dquarkus.launch.rebuild=true) is obsolete.
Do not add it to new plans.8081, at /<namespace>/mcp. There is no SSE endpoint, no
public namespace and no ns-0..ns-9 slots. Namespace names are DNS labels (lowercase letters, digits and
hyphens, 1 to 63 characters).tools/call, resources/read and prompts/get unless an action
policy or an evaluator allows the action. Plans that invoke tools must start the server with the test governance
configuration (see common/start-server.md, step 2b). Allow only the
namespaces that the plan uses./api/v1/capabilities, /api/v1/management/discovery).
Register MCP servers as forwards.registry.json under WANAKU_PERSIST_PATH. Use a new directory per run so
that runs do not share state.GET /api/v1/metrics and the
audit trail (GET /api/v1/audit/events). Barn still supports OpenTelemetry.Generate a value when the plan creates the account, and read it from the environment when the plan uses an existing system. See Credentials.
Use --ignore-not-found=true on all delete commands and 2>/dev/null || true on wait commands. A cleanup phase that fails on missing resources makes re-runs painful.
WANAKU_SERVER_URL or WANAKU_BARN_URL)sleep — use oc wait, oc rollout status, or pollingcurl/wget/httpie against Wanaku or Keycloak unless specifically testing HTTP behavior