-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Description
Brief summary
The CLI quietly accepts invalid values for --summary-trend-stats (e.g. p(101), p(-1), malformed names) because the option parsing ignores the validation error returned by metrics.GetResolversForTrendColumns(). Users get no feedback that their summary trend configuration is wrong, so they assume the stats are applied even though they’re not valid.
k6 version
k6 v0.0.0-20251118102407-ba2f60c1eed3+dirty (commit/ba2f60c1ee-dirty, go1.24.9, linux/amd64)
OS
Ubuntu 22.04.5 LTS (WSL2)
Docker version and image (if applicable)
No response
Steps to reproduce the problem
- Create a minimal script script.js:
export default function () {} - Run k6 with an invalid trend stat:
k6 run script.js --summary-trend-statsmed,avg,p(101) (same happens with p(-1), p(, or bogus names like coun.)
Expected behaviour
k6 should fail fast during CLI parsing (or at least before execution starts) with a clear error such as invalid percentile trend stat value 'p(101)', provide a number between 0 and 100, preventing the run from starting until the stats list is corrected.
Actual behaviour
k6 accepts the invalid --summary-trend-stats value, the test runs normally, and the user receives no indication that the stat list is malformed. As a result, the requested summary column is silently ignored and users can’t trust that their custom summary configuration was applied.