1

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
2
  • Note that using $processEnvironment is deprecated, better to use $env instead, as mentioned in artillery.io/docs/reference/test-script. Commented 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. Commented Sep 27, 2024 at 18:58

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.