I need a flexible configuration for the vus parameter. We plan to integrate the load test into the CI / CD pipeline and pass the vus parameter to the build parameters.
When you use scenarios, you can’t use --vus to alter the VUs of a specific scenario. Instead, you can use k6 environment variables to inject a value in the middle of the scenario config, like this:
I’m using minIterationDuration to override base k6 behaviour. In my test I need to send specific requests count which is equal to vus number and not the maximum possible.
The big bonus is that you won’t have to wait for a minute for your code to execute, if it can take less time than that for all VUs to finish their iteration.