How can we configure & pass executors value via env variables at run time

Hi Team,

Below is test script

export const options = {
  scenarios: {
    'constant-arrival-rate': {
      executor: 'constant-arrival-rate',
    rate: 350,
    timeUnit: '1s',
    duration: '30s',
    preAllocatedVUs: 1000,
    },     
  },
};

I want to configure & pass rate, duration field value via env variables so that I don’t have to change them during each test run

How can I achieve this ?

I checked Environment variables
but it didn’t covered how to use executors

Thank You

Hi @shailendrakumaromkar

Does this example work for you? Let me know if otherwise. It showcases how to pass the rate via environment variables, it should be the same with any other variable you want to specify via CLI. You can find how to pass environment variables in the docs as well.

Cheers!

Thank You @eyeveebe it helped

1 Like