In my test, I need to run 3 different HTTP calls in parallel. Each call will have different stages with different throughput rates. Stages and rates will be different depending on what type of test I am running (stress, spike, soak etc). Generally, I need to achieve:
Call1 = 90% iterations
Call2 = 15% iterations
Call3 = 5% iterations
My current solution is to have a different JS Script for each Call. Each script has its own config file with different scenarios in it.
{
"scenarios": {
"soakTest": {
"executor": "ramping-arrival-rate",
...
},
"spikeTest": {
"executor": "ramping-arrival-rate",
...
},"stressTest": {
"executor": "ramping-arrival-rate",
...
}
}
}
I am planning to run it in parallel treads as below
k6 run --config call-1-config.json call-1-test.js &
k6 run --config call-2-config.json call-2-test.js &
k6 run --config call-3-config.json call-3-test.js &
However, each “k6 run …” command runs all 3 scenarios in parallel.
soakTest ✗ [=>-----------------------------------
spikeTest ✗ [==>----------------------------------
stressTest ✗ [==>----------------------------------
Is it a way to run a single scenario from a config file? Maybe I can use env variables or when I run it in CLI?
Or is there an alternative way to config it, so it will not be too many scripts and config files?