I am trying to set artillery scenarios.flowFunction via an environment variable.
Here is my artillery execution cli statement:
"artillery": "export ARRIVAL_RATE=$arrivalRate && export DURATION=$duration && export MAX_USERS=$maxUsers && export LOB=$lob && export FUNCTION=$function && artillery run ./artillery/$lob.yml"
And here is my artillery.yml:
config:
target: https://url
phases:
- duration: "{{$processEnvironment.DURATION}}"
arrivalRate: "{{$processEnvironment.ARRIVAL_RATE}}"
maxVusers: "{{$processEnvironment.MAX_USERS}}"
engines:
playwright:
launchOptions:
headless: true
contextOptions:
storageState: './storage.json'
processor: '../playwright/{{$processEnvironment.LOB}}.ts'
variables:
function: "{{$processEnvironment.FUNCTION}}"
before:
engine: playwright
flowFunction: loginUserAndSaveStorage
scenarios:
- engine: playwright
flowFunction: "{{ function }}"
I keep getting undefined for my flowFunction, but not my other env vars. I have tried explicitly setting FUNCTION on my cli cmd, but still undefined.
I have also tried without the config.variable configuration, and referencing {{$processEnvironment.FUNCTION}} directly in flowFunctions, but same result, undefined.
asked Sep 26, 2024 at 13:15
notAChance
1,4304 gold badges19 silver badges52 bronze badges
-
Note that using $processEnvironment is deprecated, better to use $env instead, as mentioned in artillery.io/docs/reference/test-script.Bouke– Bouke2024年09月27日 18:27:45 +00:00Commented Sep 27, 2024 at 18:27
-
Also happens when using a variable for the engine property or when using testFunction instead of flowFunction (alias). Seems like variables are not supported for all property values.Bouke– Bouke2024年09月27日 18:58:05 +00:00Commented Sep 27, 2024 at 18:58
lang-yaml