Replies: 3 comments
-
hi @blevinson 👋 Variables set with the Environment variables may be used anywhere in the script and can be accessed through |
Beta Was this translation helpful? Give feedback.
-
Understood, thank you! |
Beta Was this translation helpful? Give feedback.
-
Hey, I got an issue that is pretty similar. I got my testId for influx set to a environment variable to change its value dynamically, the thing is I haven't been able to change it in execution time. plugins: We define one scenario:
The {{ json }} is a parameter from a csv where I got the json bodies for the request. The thing is I am testing a single endpoint but it has multiple services I have to test. That's why i need the service field, for grouping results in grafana. setEnvironmentVariable is a js function that changes the value of the environment variable. However the value of testId dosen't seem to change at all. {{ service }} ->the csv of the json body also has a field for the service name. Is there a way to change dynamically the value in execution time? |
Beta Was this translation helpful? Give feedback.
-
I'm trying to dynamically change the test_id so it reflects well in the graph. The tag in the test changes but on in the plugin. How can I get the plugin to pull in the "token" variable.
Test:
config:
target: "https://site.com"
plugins:
publish-metrics:
- type: prometheus
pushgateway: "http://[IP]:9091"
prefix: 'artillery_k8s'
tags:
- "test_id:test-{{ token }}" <-- this won't change
- "type:loadtest"
...
before:
flow:
- log: "Running: test-{{ token }}". <-- this will
Command:
TEST_ID=$(echo $RANDOM | md5sum | head -c 5; echo;)
npx artillery run scenario.yaml --variables "{"token":"$TEST_ID"}"
Please assist as soon as possible
Beta Was this translation helpful? Give feedback.
All reactions