Comments (8)
This is solved in Artillery v2.0.12. You can use exact match or regex now.
from artillery.
Hi @HugoImaios 👋
We had actually been discussing this same thing earlier in the week. For context, the reason I implemented it as a regex is because most test runners out there tend to have a grep
/filter
functionality that allows for partial matches. So for example, you could implement some sort of pattern in the name, and then just filter by that pattern.
That being said, I do think that makes more sense when you can run multiple scenarios (which artillery currently doesn't do). We'll discuss this again internally and see what we'll do here!
In the meantime, you should be unblocked for your use case right? Just escaping the special characters should work, i.e.:
artillery run config.yaml --scenario-name="Get 2 animal pictures \(but with parenthesis\)"
from artillery.
More informations :
If the two scenarios have the same name except the parenthesis, for example:
scenarios:
- name: Get 1 animal pictures
flow:
- loop:
- get:
url: "/dino"
count: 100
- name: Get 1 animal pictures (but with parenthesis)
flow:
- loop:
- get:
url: "/dino"
count: 100
and we run yarn artillery run config.yaml --scenario-name="Get 1 animal pictures"
, we get another error :
Multiple scenarios for Get 1 animal pictures found in script. Make sure you give unique names to your scenarios in your script.
which leads to think the parenthesis (and what they contain) are stripped off the scenario name
from artillery.
I also tried with quoted name in yaml, with no more success :
- name: "Get 3 animal pictures (but with parenthesis, and quotes)"
flow:
- loop:
- get:
url: "/dino"
- get:
url: "/pony"
- get:
url: "/armadillo"
count: 100
artillery run config.yaml --scenario-name="Get 3 animal pictures (but with parenthesis, and quotes)"
gives :
worker error, id: 1 Error: Scenario Get 3 animal pictures (but with parenthesis, and quotes) not found in script. Make sure your chosen scenario matches the one in your script exactly.
from artillery.
Hi @HugoImaios
We'll make this more clear in the documentation, but --scenario-name
is using a regex to search. You'll have to escape special characters like (
and )
.
from artillery.
I looked for it, is it this line ?
artillery/packages/core/lib/runner.js
Line 340 in 4206f30
from artillery.
I though about it and I don't really see the point of the regex here :
If we could give a real regex pattern as options.scenarioName
, lets say with the aim of run only the scenarios that match this regex (with my examples above, it could be --scenario-name="Get 1|3 animal pictures"
to get these two scenarios and only these)
But that is not possible, because we would run in the Multiple scenarios for ${options.scenarioName} found in script. Make sure you give unique names to your scenarios in your script
error.
So : I think we should either allow multiple scenarios to match and be launched (and make the use of regex explicit in the documentation as you said), or remove the use of RegExp, allowing only the exact string to match the scenario name (which is the more intuitive solution imo) :
- const hasScenario = new RegExp(options.scenarioName).test(scenario.name);
+ const hasScenario = scenario.name === options.scenarioName;
(naive fix, I guess one could get rid of the whole scenarios.filter
and use a findIndex
instead, but you get it 😉 )
from artillery.
Looks good to me, I'll receive updates from here !
No worries for my use case, I already just removed the parenthesis from the scenario name in the config lol
from artillery.
Related Issues (20)
- Artillery / Fargate: Worker does not receive go signal and waits endlessly HOT 5
- Test hangs when many virtual users fail with ETIMEDOUT
- Artillery API test for 1VU showing incorrect value for 'median' under 'http.response_time' HOT 1
- Custom engine/plugin in private artifactory (run-lambda) HOT 2
- Artillery Cloud - Free Unresponsive on Mac Chrome HOT 4
- [Feature Request] Export of the --output file to S3 when using Artillery with Fargate
- Datadog Metrics are not sent when using Artillery with Fargate HOT 6
- Lambda testing at scale 8 million virtual users HOT 1
- Value is not being captured from JSON. HOT 1
- Getting TestDataSyncFailure some times when running on AWS Lambda HOT 2
- Callback was already called HOT 4
- Playwright Fargate HTTP_PROXY support HOT 1
- Bug: Payloads with `loadAll` and field names include unexpected objects HOT 3
- showAllPageMetrics doesn't work when Target is changed in runtime HOT 2
- requirejs vulnerable to prototype pollution HOT 2
- 'capture' keyword doesn't seem working with 'before' keyword
- 'capture' keyword doesn't seem working with 'before' keyword HOT 5
- Using $ref in YAML files to avoid duplication HOT 1
- loadAll param being ignored when not defined or set to false HOT 3
- Cookie Failed to Parse HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from artillery.