with one click
ark-chainsaw-testing
// Run and write Ark Chainsaw tests with mock-llm. Use for running tests, debugging failures, or creating new e2e tests.
// Run and write Ark Chainsaw tests with mock-llm. Use for running tests, debugging failures, or creating new e2e tests.
Produce a themed Slack post announcing Ark releases. Pulls from BOTH the Ark core repo (mckinsey/agents-at-scale-ark) and the Marketplace repo (mckinsey/agents-at-scale-marketplace), validates docs links, groups features by theme with relevant emoji, and ends with a "Coming next" section sourced from the current sprint on the ARK project board. Invoke when the user asks for a "release announcement", "slack post", "what's new since vX", "changelog for
Guidance for developing the Ark Kubernetes operator. Use when modifying Go types, CRDs, controllers, or webhooks. Helps with CRD generation and Helm chart sync issues.
Structured workflow for drafting NEW GitHub issues with codebase research, duplicate detection, task breakdowns, and testing approach. Always asks clarifying questions and shows the draft for approval before creating. For searching, listing, viewing, or updating existing issues, use the "issues" skill instead.
Consolidate open Dependabot PRs into a single integration branch. Use when the user asks to "consolidate dependabot", "merge dependabot PRs", "batch dependency updates", or mentions dependabot PR management.
Set up and install the Ark platform in a Kubernetes cluster. Supports default mode (existing cluster) and isolated e2e testing mode (dedicated Kind cluster). Use when the user wants to install, deploy, test, or configure Ark.
CVE research and security patch workflow for Ark. Provides CVE API integration, mitigation strategies, and security-focused PR templates. Works with research, analysis, and setup skills for comprehensive vulnerability fixing.
| name | ark-chainsaw-testing |
| description | Run and write Ark Chainsaw tests with mock-llm. Use for running tests, debugging failures, or creating new e2e tests. |
Run and write Chainsaw e2e tests for Ark resources.
# Run all standard tests
(cd tests && chainsaw test --selector 'standard')
# Run specific test
chainsaw test ./tests/query-parameter-ref --fail-fast
# Debug mode - keep resources on failure
chainsaw test ./tests/query-parameter-ref --skip-delete --pause-on-failure
Reference tests/CLAUDE.md for comprehensive patterns.
For a complete working example that shows the correct patterns for writing tests, see examples.md.
tests/my-test/
āāā chainsaw-test.yaml # Test definition
āāā mock-llm-values.yaml # Mock LLM config (if needed)
āāā README.md # Required documentation
āāā manifests/
āāā a03-model.yaml # Model before Agent
āāā a04-agent.yaml # Agent before Query
āāā a05-query.yaml # Query last
kubectl wait for CRD conditionsNever use kubectl wait --for=condition=Established to check CRD readiness. This command crashes with a type error when .status.conditions is nil (a known kubectl bug: kubernetes/kubernetes#66439):
error: .status.conditions accessor error: <nil> is of the type <nil>, expected []interface{}
Use a chainsaw assert with JMESPath instead ā it polls gracefully and waits for the field to appear:
# Bad - crashes if .status.conditions is nil
- script:
content: |
kubectl apply -f my-crd.yaml
kubectl wait --for=condition=Established crd/my-crd.example.com --timeout=60s
# Good - polls until condition appears, no nil crash
- script:
content: |
kubectl apply -f my-crd.yaml
- assert:
resource:
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: my-crd.example.com
status:
(conditions[?type == 'Established']):
- status: "True"
This pattern converts a brittle timeout into an explicit condition check. The same applies to any resource whose .status.conditions may start as nil.
assert instead of wait for Query completionNever use assert to wait for a Query to complete. assert polls the API server repeatedly; wait uses a Kubernetes watch (event-driven), which is faster and cheaper:
# Bad - polls every few seconds, hammers the API server
- assert:
resource:
apiVersion: ark.mckinsey.com/v1alpha1
kind: Query
metadata:
name: test-query
status:
phase: done
# Good - uses a watch, fires once the condition is set
- wait:
apiVersion: ark.mckinsey.com/v1alpha1
kind: Query
name: test-query
timeout: 4m
for:
condition:
name: Completed
value: 'True'
Use assert only after wait has confirmed the query is done ā i.e., for post-completion validation of response fields. Keep these as separate steps so timing is explicit:
- name: wait-for-query-completion
try:
- wait:
apiVersion: ark.mckinsey.com/v1alpha1
kind: Query
name: test-query
timeout: 4m
for:
condition:
name: Completed
value: 'True'
- name: validate-response
try:
- assert:
resource:
apiVersion: ark.mckinsey.com/v1alpha1
kind: Query
metadata:
name: test-query
status:
(response != null): true
phase: done
Avoid using shell scripts with kubectl get + jq to validate resource state when chainsaw assertions can express the check declaratively. Shell scripts fail immediately on unexpected nil values; assertions retry until the condition is met or the timeout expires.
# Bad - fails immediately if field is absent
- script:
content: |
val=$(kubectl get myresource foo -o jsonpath='{.status.phase}')
[ "$val" = "Ready" ] || exit 1
# Good - retries until condition is true
- assert:
resource:
apiVersion: example.com/v1
kind: MyResource
metadata:
name: foo
status:
phase: Ready
For real LLM tests (not mock-llm):
export E2E_TEST_AZURE_OPENAI_KEY="your-key"
export E2E_TEST_AZURE_OPENAI_BASE_URL="your-endpoint"