Cast phase config strings to numbers in order to support ENV vars
See original GitHub issueThe Issue
When using ENV-based config for phases, for example:
config:
phases:
- duration: "{{ $processEnvironment.DURATION }}"
arrivalRate: "{{ $processEnvironment.ARRIVAL_RATE }}"
rampTo: "{{ $processEnvironment.RAMP_TO }}" # The troublemaker
The scenario does not run as expected (finishes early). In my anecdotal setup the rampTo
bit is what introduces the issue.
Why does this happen?
The process environment variables which become the spec entry values are strings, and the various mathematical operations on these here: https://github.com/artilleryio/artillery/blob/74baeac42a7bfb9ad9378ce7b9a01f4535eb1490/core/lib/phases.js#L85-L92
Are likely the culprit.
The Solution
PR introduces a conversion of defined phase config entries (based on a keys whitelist) expected to have numerical values.
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Using Environment Variables | Cloud Functions Documentation
Setting runtime environment variables · Open the Functions Overview page in the Google Cloud console: · Click Create function. · Fill in the...
Read more >Jenkins Pipeline Environment Variables - The Definitive Guide
In this blog post, I will show you how you can work with Jenkins pipeline environment variables effectively. You will learn how to...
Read more >Environment variables — dynaconf 2.2.3 documentation
All configuration parameters, including custom environments and dynaconf configuration, can be overridden through environment variables.
Read more >using process.env in TypeScript - node.js - Stack Overflow
env can be indexed with a string in order to get a string back (or undefined , if the variable isn't set). To...
Read more >How To Handle Environment Variables With Kubernetes?
Environment variables are a common way for developers to move application and infrastructure configuration into an external source outside ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @xyngfei
Sorry for not double-checking, but it looks like the env-casting feature #978 + #1025 was not yet merged into a tagged release.
I’ll have to defer to @hassy as I’m not sure how the folks at artillery do
master -> x.y.z release
mergingHowever, if you must use this feature and can’t wait for a tagged version, you can do the following:
Which, for me, produced a successful (in that it finished) test:
@xyngfei