Skip to content

Writing Plans

mpinardi edited this page Aug 13, 2019 · 5 revisions

Cucumber Perf uses configuration files called Plans which are parsed using a language called Salad.

These files should have the extension *.plan just as Cucumber features use the extension *.feature.

Plans

Each Plan starts with a title line and optional description:

Plan: Base Line tests
      These are our common base line scenarios.
      Each baseline scenario should be run after major revision.

Plans provide a way to describe multiple performance tests called Simulations.

Simulations

Simulations are the performance/load tests you wish to run and they provide Cucumber Perf with an execution plan. All simulations start with a title which is used to track its progress and may contain an optional description.

Simulation: Base line 1
            My options description ...

There are two types of Simulations supported in Salad and each Plan can contain multiple Simulations.

  1. Plain simulations are simple count based scenarios. These end when the requested total number of threads have been executed.
Simulation: Base line 1
  1. Timed simulations are scenarios that continue to run until the configured period has expired.
Simulation Period: simulation 2 period
                   Optional Description ...

Simulation periods require time parameter to be assigned to it.

Time Time: 00:15:00

Description: Time Is the period of time for which this test will run. Time is in the format of HH:mm:ss.

There are two more options that can affect this simulation execution.

  1. RampUp RampUp: 00:01:00

Description: Ramp Up is the period of time for the cucumber perf to build up to the total number of running threads(runners). Ramp up is in the format of HH:mm:ss.

  1. Ramp Down RampDown: 00:01:00

Description: Ramp Down is the period of time for cucumber perf to reduce from the total number of running threads(runners) to the end of test execution (0 running threads). Ramp down is in the format of HH:mm:ss.

Example:

Simulation Period: simulation 2 period
       .....
#required
Time: 00:00:30
#optional
RampUp: 00:00:10
RampDown: 00:00:10

Both types of simulations can have the following options.

  1. Random Wait RandomWait: 00:00:02

Description: a optional random wait mean for before thread runs tests. Threads will wait between +-50% of this mean

All simulations contain specification for which cucumber features to run. These specifications are called Groups.

Groups

A group starts with the the name of a feature or tag(s) to run Group MyFeature.Feature

Description: Groups must have a feature name or tags. The feature name does not need to be fully qualified. Multiple tags can be run in a group separated by a comma or space.

Group my.feature
   Runners: 1
   Count: 10
Group @one,@two,@three
   Runners: 1
   Count: 10

Each group is made up of the following required and optional parameters.

  1. Runners:
Runners: 2

Description: Required The max number of threads to run concurrently for the group.

  1. Count:
Count: 10

Description: Required The total number of threads to run for the group. This is ignored in a Scenario Period as they run until the time limit.

  1. Slices:
        |value out|
	|changed value 1|
	|changed value 2|

Description: Optional Slices are Cucumber perf's version of data tables. But unlike Cucumber data tables they replace regular "parameters" and and can be used more then once. The first line is the Cucumber parameter to replace (this is the value as it appears in the Cucumber Scenario). All lines after are the replacement values to use. Just like Cucumber data tables you can have as many columns and rows as you want. Note: Slices can not be used to replace Scenario Outline examples.

Full example:

File: "test.plan"

Plan: test
Simulation: simulation 1
Group test.feature
	#slices
	#these values will replace property "value out"
	|value out|
	|changed value 1|
	|changed value 2|
	#number of threads
	Runners: 2
	#total number of threads to run.
	Count: 2
#a optional random wait mean for before thread runs tests.
#thread will wait between +-50% of this mean
RandomWait: 00:00:02

#Will run all groups for the period below
Simulation Period: simulation 2 period
Group test.feature
	|value out|
	|changed value |
		Threads: 5
		#count is ignored in a simulation period
		Count: 1
#run time
Time: 00:00:30
RampUp: 00:00:10
RampDown: 00:00:10
Clone this wiki locally