Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warn on shorthand options overriding scenarios #4176

Merged
merged 1 commit into from
Jan 17, 2025
Merged

Warn on shorthand options overriding scenarios #4176

merged 1 commit into from
Jan 17, 2025

Conversation

mstoykov
Copy link
Contributor

What?

Warn on shorthand options(vus, duration, stages, iterations) overriding scenarios from previously defined scenarios. Mostly applicable when using cli flags to override them from within the script.

This is currently implemented only for scenarios as that is the case that is most confusing. Implementing this for duration overriding stages (for example) is possible, but it seems to not be nearly hit enough.

Unfortunately due to too many of things of #883 and the way shorthand options are handled in particular, the code can't be in any Apply function with enough information to have a nice message.

Why?

This is probably one of the things that confuses the most users as explained in the original #2529 issue.

Checklist

  • I have performed a self-review of my code.
  • I have added tests for my changes.
  • I have run linter locally (make lint) and all checks pass.
  • I have run tests locally (make tests) and all tests pass.
  • I have commented on my code, particularly in hard-to-understand areas.

Related PR(s)/Issue(s)

Fixes #2529

This is currently implemented only for scenarios as that is the case
that is most confusing. Implementing this for duration overriding stages
(for example) is possible, but it seems to not be nearly hit enough.

Unfortunately due to too many of things of #883 and the way shorthand
options are handled in particular, the code can't be in any Apply
function with enough information to have a nice message.

Fixes #2529
@mstoykov mstoykov added the ux label Jan 14, 2025
@mstoykov mstoykov added this to the v0.57.0 milestone Jan 14, 2025
@mstoykov mstoykov requested a review from a team as a code owner January 14, 2025 15:09
@mstoykov mstoykov requested review from olegbespalov and joanlopez and removed request for a team January 14, 2025 15:09
if a.Scenarios != nil &&
(b.Duration.Valid || b.Iterations.Valid || b.Stages != nil || b.Scenarios != nil) {
logger.Warnf(
"%q level configuration overrode scenarios configuration entirely",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe explicitly mention implications, what do you think?

Suggested change
"%q level configuration overrode scenarios configuration entirely",
"%q level configuration overrode scenarios configuration entirely. It's highly likely, that the test load result will be different from what you expect.",

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This usually isn't the problem - the problem is people expect:

  1. to run their scenarios but with a different duration, iterations or VUs, but with all other options the same
  2. having some other option stay the same - for example exec, env, and also options for browser

But making the message a bunch of sentences IMO isn't a great idea. The one we have with docker and stuff about not finding files - it still gets users to post it and ask questions. I only expect this is happening less because of google actually now fidning the results from previous asks.

@mstoykov mstoykov merged commit 540b433 into master Jan 17, 2025
28 checks passed
@mstoykov mstoykov deleted the fix2529 branch January 17, 2025 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Warn the user that using -i/-u/-d will overwrite everything about their scenarios
3 participants