Due to how my test suite is designed, I need to be able to share some info between successive executions of the k6 binary ( e.g. k6 run test.js where my test.js is a wrapper with placeholders like URL/VU count etc injected via environment variables ) - I have noticed that there is no easy way to share such info across k6 runs ( e.g. file writes are not allowed etc via k6 ). Is it possible to set an environment variable ( just like how we can read those ) or is there another simple way of sharing info ?
Looking for lightweight/no-frills approach to this.
You can write files from
handleSummary(), though in that callback you only have access to the aggregated end-of-test summary data, so it might not be enough for your use case?
Alternatively, you can use an external HTTP key-value store to save information from VUs, or write that to something like redis (via an xk6 extension), but that also has its limitations…
What exactly is the information you want to save?
Thanks for the quick reply. The handleSummary approach might actually work - will explore a bit more. The use of an external kv store is ruled out due to preference of not wanting any external dependencies.