processEnvironment variable not populated when running remotely
See original GitHub issue$processEnvironment variables are not getting populated when running remotely (using Artillery Pro)
Version info:
Artillery Core: 2.0.0-16
Artillery Pro: 3.0.0-9
YAML
before:
flow:
- log: "Getting Token"
- post:
url: "/v1/token"
name: get accessToken
json:
clientId: "{{ $processEnvironment.CLIENT_ID}}"
clientSecret: "{{ $processEnvironment.CLIENT_SECRET }}"
capture:
- json: "$.accessToken"
as: accessToken
strict: false
expect:
- statusCode: 201
- contentType: application/json
- hasProperty: accessToken
The following works when running locally with Artillery:
export CLIENT_ID=ABC
export CLIENT_SECRET=XYZ
artillery run /path/to/my/script.yml
But when executing tests remotely with Artillery Pro, the processEnvironment variables don’t seem to be getting set. The following results in “No measurements recorded during this period”
export CLIENT_ID=ABC
export CLIENT_SECRET=XYZ
artillery run-test --region us-east-1 --cluster artilleryio-cluster --count 1 --launch-type ecs:fargate --security-group-ids=XXXXXXX --subnet-ids=subnet-XXXXXX /path/to/my/script.yml
The documentation for Artillery Pro only mentions $processEnvironment in the context of secrets, so I also tried the following, but got the same result:
artillery set-secret --name CLIENT_ID --value ABC --region us-east-1
artillery set-secret --name CLIENT_SECRET --value XYZ --region us-east-1
artillery run-test --secret CLIENT_ID --secret CLIENT_SECRET --region us-east-1 --cluster artilleryio-cluster --count 1 --launch-type ecs:fargate --security-group-ids=XXXXXXX --subnet-ids=subnet-XXXXXX /path/to/my/script.yml
If I hard code the clientId and clientSecret values in the YAML rather than using $processEnvironment variables the remote execution succeeds - so there is definitely an issue with the $processEnvironment variables getting set in the remote environment.
Issue Analytics
- State:
- Created a year ago
- Comments:19 (8 by maintainers)
Top GitHub Comments
@danobri yes indeed,
--dotenv
will be supported in the local test runner too (just merged #1478)we’ll look into that, thank you
great suggestion, we’ll update the docs with more information on Cloudwatch logs created by Artillery Pro tests
Thank you!