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

feat(artillery): add ability to specify scenario to run by name #2184

Conversation

bernardobridge
Copy link
Contributor

@bernardobridge bernardobridge commented Oct 3, 2023

Why

Originally requested here #1929, this is a useful feature for people who are saving multiple scenarios in the same file. Especially useful once you start having complex scenarios with weights, but still want the ability to run them individually on demand, a requirement I've had myself in the past.

Note: CLI flag name (--name) could be changed to something else, like --byName. Please suggest something else if you think it makes more sense.
Note: Flag name is now --scenario-name after some internal discussions. Please make other suggestions if other ideas pop up.

@bernardobridge bernardobridge requested a review from a team October 3, 2023 17:07
@bernardobridge
Copy link
Contributor Author

bernardobridge commented Oct 6, 2023

@hassy made the changes we discussed (expose to Lambda, and error instead of logging).

I went with erroring from within here a5604ae (i.e. worker level), rather than earlier in the script. The reason is that this way it's not dependant on run command implementation, which means it should work with Fargate (which doesn't have access to the test object from within the command, so has to do these validations at worker level anyway). This is also where the logic of weight picking is, so it felt natural to have that there for now. We can revisit that later IMO, but let me know if you think it shouldn't be here.

Screenshots of errors:

Scenario Not Found

Screenshot 2023-10-06 at 12 44 43

Multiple Scenarios Found

Screenshot 2023-10-06 at 12 48 32

@bernardobridge bernardobridge requested a review from hassy October 6, 2023 11:49
@bernardobridge
Copy link
Contributor Author

I've made this work with Lambda now, and tested it 👍. Both happy path and errors work now.

Fargate support will require updating platform-fargate, which I'll do next.

@bernardobridge bernardobridge merged commit da56158 into main Oct 18, 2023
6 checks passed
@bernardobridge bernardobridge deleted the bernardobridge/art-1377-implement-run-scenario-by-name-in-artillery-cli branch October 18, 2023 14:12
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.

2 participants