question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow multiple scripts to be given to "artillery run"

See original GitHub issue

Use case: when testing a complex application (an ecommerce website backend in my case), it would be nice to keep scenario definitions in separate files for readability.

It’s already possible to extract parts of a flow (e.g. checking out) into their own “subflows” using YAML anchors/references to reduce repetition. The ability to separate scenarios into different files would be another step towards making large test definitions easier to read and maintain.

Mechanism:

The run command can accept a list of files:

artillery run main.yaml scenario1.yaml scenario2.yaml scenario3.yaml...

Where scenario1.yaml etc have the following structure:

config:
  # optional payload definition - gets added to the global payload definitions
  payload:
    path: "./somefile.csv"
    fields: ["field1", "field2"]
  # optional variable definition - as above
  variables:
    somevar: ["value1", "value2"]
  # optional processor definition - as above
  processor: "./functionsForTheScenarios.js"
# Scenarios defined here get added to the global list
scenarios:
  - name: "Select a product and add it to cart"
     flow:
       # flow definition goes here

All paths are to be resolved relative to the path to the scenario file. Any fields other than defined above will be ignored (e.g. config.environments - those should be set in main.yaml).

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:13
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

21reactions
Offtreecommented, Feb 5, 2019

Have you considered allowing glob patterns instead of having to list out scenarios? Seems like part of the goal with this enhancement would be to allow for easier integration with a full team and not really have to think about what tests your testing pipeline is running. This would align with common practices with other testing frameworks.

Ex.

artillery run scenario.*.yaml
artillery run ./tests/**/*.scenario.yaml
4reactions
vichybabycommented, Jul 2, 2020

Is anyone having a working example?

For me, only the first scenario got executed successfully. artillery run scenario1.yaml scenario2.yaml…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Test Scripts - Artillery.io
An Artillery test script is a YAML file composed of two main sections: config and scenarios . The scenarios section contains definitions of...
Read more >
Artillery-ways to execute Script -Automation testing ,Webkul Blog
Artillery allows users to run custom test scripts written in either yaml or json, users can also perform a quick test without loading...
Read more >
Serverless load testing at scale with Artillery - Level Up Coding
yml for the functional tests (inc fuzzing). The yml files are invoked through NPM scripts, each of which runs the tests generating an...
Read more >
Check Your Site's Performance With Artillery and Playwright
exports ), which will let us define which function the engine needs to execute in the Artillery test script. You'll see how it...
Read more >
Artillery.io: How to generate test report for each Scenario?
To my knowledge, there isn't a good way to do this with the existing the artillery logic. using this test script:
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found