Skip to main content

Init Performance Testing

In brief: /testchimp init-perf copies portable k6 assets into the mapped tests root, ignores k6 in Playwright, seeds perf policies, and optionally nests import-perf-tests when an existing suite lives outside k6/.

:::tip Authoritative product docs Why this exists and how k6/ is laid out: Performance Testing · organization. Catalog overview: Performance testing workflows. This page is the agent playbook. :::

One-Off catalog workflow (workflow-id: init-perf). Soft-gate PERFORMANCE_TESTING (Growth / free trial). Nested automatically under create-perf-tests or import-perf-tests when k6/ is missing (same plan, one approval).

When to use

  • This repo has no k6/ tree under the mapped tests root yet.
  • You are about to author or import performance tests and Playwright must ignore k6 files.
  • Default run-perf-tests / create-perf-tests / upkeep-perf policies are not on disk.

Do not use it to raise VUs, rewrite journeys, or run a load test. That is run-perf-tests after you have approved capacity. Re-run only when the scaffold itself is missing pieces (not on every PR).

Prompt

/testchimp init-perf

No optional scope—this is workspace bootstrap, like /testchimp init for functional QA.

Prerequisites

  • Mapped tests folder with .testchimp-tests.
  • Org capability PERFORMANCE_TESTING (or active free trial).
  • k6 binary on the machine that will later execute (init tells you to install k6 if missing).
  • connect-to-test-env is not required to scaffold; it is required before any real run.

Policy

Seeds (when missing):

  • plans/knowledge/policies/run-perf-tests.policy.md
  • plans/knowledge/policies/create-perf-tests.policy.md
  • plans/knowledge/policies/upkeep-perf.policy.md

Replace capacity placeholders (prod VU target, local downsample, dependency mock inventory) before non-smoke execution. Init-perf does not invent those numbers.

What it does

Plan → approve → Execute:

  1. Resolves the SmartTests root (.testchimp-tests).
  2. Copies portable k6/ assets if missing (journeys/, composites/, profiles/, datasets/, lib/, scripts/). Does not overwrite existing journeys, manifests, or policy decisions. If k6/ already exists, adds missing scaffold files (lib/volume-size.js, lib/dataset.js, scripts/run.sh, scripts/suite-worklist.py, scripts/run-volume-staircase.sh, profiles/volume.js honoring K6_VOLUME_STEPS). Clients execute k6/scripts/run.sh.
  3. Patches Playwright testIgnore with '**/k6/**'.
  4. Runs k6/scripts/prepare.sh so @testchimp/k6 latest lands in gitignored k6/lib/ (never vendor the reporter; never pin a semver).
  5. Confirms k6 version.
  6. Appends a Performance testing note to ai-test-instructions.md (permitted env, seed/teardown, mock inventory). /testchimp test writes related-perf-tests.json when k6/journeys exists; it does not execute load/volume.
  7. Offers nested import-perf-tests if Locust/JMeter/Gatling/Artillery/k6 already lives outside k6/.
  8. Shell-checks scripts and k6 inspect on the example journey. Does not run load/volume.

See also

FAQ

When should I run init-perf?

Once per repo before authoring or importing k6 tests, or nested under create-perf-tests / import-perf-tests when k6/ is missing.

Does init-perf run a load test?

No. It inspects the example journey under smoke. Load and volume wait until absolute settings are approved in policy.

What if I already have Locust or JMeter?

Init-perf can nest import-perf-tests in the same plan and approval when a suite exists outside k6/.