Describe the bug
K6BuilderExtensions.WithScript(scriptPath, virtualUsers = 10, duration = "30s") builds the container args as
run --address 0.0.0.0:6565 --vus <n> --duration <d> <script>
--vus and --duration are the k6 CLI shorthand for a single constant-VU scenario, and k6 gives CLI flags precedence over the script's options. A script that defines its own options.scenarios (ramping-arrival-rate, several named scenarios, per-scenario executors) therefore does not run the scenarios it declares: k6 logs options.scenarios and --vus/--duration are mutually exclusive-style overrides and runs the CLI shorthand instead.
There is no overload that passes only the script (and --address, which the resource needs so the REST API on 6565 is reachable from outside the container). The only way today is to skip WithScript and hand-build WithArgs("run", script, "--address", "0.0.0.0:6565"), re-implementing the constant the package keeps private.
Version
CommunityToolkit.Aspire.Hosting.k6 13.5.0 (same on main).
Expected
Either
WithScript(string scriptPath) (or virtualUsers/duration nullable, omitted from the args when null), so a scenario-driven script keeps its own options, or
- a documented way to pass the script without the shorthand flags.
Steps to reproduce
builder.AddK6("k6").WithScript("/scripts/main.js") where main.js exports options = { scenarios: { a: { executor: "ramping-arrival-rate", ... }, b: { ... } } }.
- Start the resource. Observe k6 runs 10 VUs for 30 s instead of the declared scenarios.
Describe the bug
K6BuilderExtensions.WithScript(scriptPath, virtualUsers = 10, duration = "30s")builds the container args as--vusand--durationare the k6 CLI shorthand for a single constant-VU scenario, and k6 gives CLI flags precedence over the script'soptions. A script that defines its ownoptions.scenarios(ramping-arrival-rate, several named scenarios, per-scenario executors) therefore does not run the scenarios it declares: k6 logsoptions.scenarios and --vus/--duration are mutually exclusive-style overrides and runs the CLI shorthand instead.There is no overload that passes only the script (and
--address, which the resource needs so the REST API on 6565 is reachable from outside the container). The only way today is to skipWithScriptand hand-buildWithArgs("run", script, "--address", "0.0.0.0:6565"), re-implementing the constant the package keeps private.Version
CommunityToolkit.Aspire.Hosting.k6 13.5.0 (same on
main).Expected
Either
WithScript(string scriptPath)(orvirtualUsers/durationnullable, omitted from the args when null), so a scenario-driven script keeps its own options, orSteps to reproduce
builder.AddK6("k6").WithScript("/scripts/main.js")wheremain.jsexportsoptions = { scenarios: { a: { executor: "ramping-arrival-rate", ... }, b: { ... } } }.