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

fix(artillery): update payload path when using environments #1964

Conversation

bernardobridge
Copy link
Contributor

@bernardobridge bernardobridge commented Jul 4, 2023

What

Fixes #1961

How

This was happening because checkConfig gets called twice when you pass in a scenario + config. In that situation, if you have environments, the first time checkConfig gets called, it correctly creates the payload in the root config and replaces those paths.

However, it doesn't do the same to config.environments.payload. So the second time checkConfig is called, the _.merge overrides the payload path with the config.environment.payload unresolved path, causing the issue.

The PR addresses that by ensuring that it no longer gets called twice.

Testing

This was tested with the test scripts provided in the issue (very helpful), against Artillery Local.

Two things are missing:

  • Verify this against non-local runs. This may still need to be accounted for, as I'm not sure if it uses the same logic, looking at create-bom.js;
  • I am still in the process of figuring out a potential automated test for this.

@bernardobridge bernardobridge changed the title Bernardobridge/art 1085 issue 1961 incorrect payload path when using environments fix(artillery): update payload path when using environments Jul 4, 2023
@bernardobridge bernardobridge marked this pull request as ready for review July 5, 2023 10:50
@hassy hassy merged commit b9f3dc9 into main Jul 8, 2023
4 checks passed
@hassy hassy deleted the bernardobridge/art-1085-issue-1961-incorrect-payload-path-when-using-environments branch July 8, 2023 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect payload path when using environments
2 participants