sincecutoff.com
← all changes

k6 run --scenario selects configured workloads

Introduced 2026-09-21 · score 0.98

HOW TO USE IT

When debugging a script with multiple configured scenarios, run `k6 run --scenario <name> <script.js>` to run only the named workload. Separate multiple scenario names with commas.

k6 run --scenario homepage script.js
k6 run --scenario homepage,contacts script.js

WHY THIS HELPS

When editing or debugging a script with multiple scenarios, run only the workload under development.

BEFORE THIS CHANGE

Without `--scenario`, k6 runs all configured scenarios. The release note describes environment-variable selection code or splitting scripts as prior workarounds.

REQUIREMENTS AND LIMITATIONS

  • Version: v2.3.0
  • --scenario <name>[,<name>...]: Select one or more configured scenarios by name; separate names with commas. Without it, all configured scenarios run. Names must match the configured scenarios.
  • <script.js> (required): Script containing the configured scenarios.
  • --vus: Load shortcut; cannot be combined with `--scenario`.
  • --duration: Load shortcut; cannot be combined with `--scenario`.
  • Prerequisite: Use k6 v2.3.0 or later, where `--scenario` was introduced.
  • Prerequisite: The script must configure the scenario name or names in its `scenarios` object.
  • Scenario names must match configured scenarios.
  • Load shortcuts such as `--vus` and `--duration` cannot be combined with selection; configure workload in each scenario instead.
  • Selected scenarios retain their executor, load, timing, function, environment, tags, and browser options.
  • Without `--scenario`, k6 runs all configured scenarios.
  • k6 warns and skips thresholds tagged for configured scenarios that are excluded, while keeping global thresholds and other filters.

FIRST-PARTY EVIDENCE

Check the installed version and the source before using it. Entry JSON

Report a problem with this card