Varibles in taurus yaml

515 views Asked by At

We're preparing a yaml taurus file to run a load test with taurus. This load test will include several scenarios, with a common ramp-up and hold-for time.

We've the following code:

- concurrency: 5
  ramp-up: 60m
  hold-for: 60m
  scenario: scenario1
- concurrency: 8
  ramp-up: 60m
  hold-for: 60m
  scenario: scenario2
- concurrency: 9
  ramp-up: 60m
  hold-for: 60m
  scenario: scenario3
-
  .....

Is there a way to define the time for the ramp-up and hold-for in a variable in the yaml file (not in external file)? To don't have to repeat it for each scenario.

1

There are 1 answers

0
Dmitri T On

You can go for JMeter Properties like:

modules:
  jmeter:
    properties:
      ramp-up: 3600
      hold-for: 3600

Once done you can amend your scenarios to use __P() function like:

- concurrency: 5
  ramp-up: ${__P(ramp-up,)}
  hold-for: ${__P(hold-for,)}
  scenario: scenario1
- concurrency: 8
  ramp-up: ${__P(ramp-up,)}
  hold-for: ${__P(hold-for,)}
  scenario: scenario2
- concurrency: 9
  ramp-up: ${__P(ramp-up,)}
  hold-for: ${__P(hold-for,)}
  scenario: scenario3

More information: