Fix bare VUs scenario override precedence#5986
Draft
cursor[bot] wants to merge 2 commits into
Draft
Conversation
Co-authored-by: Inanc Gumus <github@inanc.io>
Co-authored-by: Inanc Gumus <github@inanc.io>
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
Fixes the bare
vusshortcut precedence introduced by PR #5794 so it only clears lower-priority scenarios when the barevusvalue comes from a higher-priority configuration tier.Also keeps explicit empty stages from activating a lower-tier bare
vus, while still allowing a higher-tier--vusto override lower empty stages and run as shared iterations.Why?
After the recent bare
--vuschange, any finalOptionsvalue withVUs.ValidandScenarios != nilcould replace scenarios during derivation, regardless of wherevuscame from. A config-file default like{ "vus": 3 }combined with a script that definesscenarioswould silently run a default shared-iterations scenario instead of the script's scenarios, causing major load profile corruption.Root cause:
DeriveScenariosFromShortcuts()only sees the consolidated options, so it could not distinguish higher-tier CLI/env/script overrides from lower-tier defaults that should not override explicit scenarios.Checklist
make check) and all pass.Validation performed:
go test ./internal/cmd ./lib/...go test ./internal/cmd/... ./lib/...Checklist: Documentation (only for k6 maintainers and if relevant)
Please do not merge this PR until the following items are filled out.
Related PR(s)/Issue(s)
Follow-up to #5794 / #5793