Quantcast
Channel: Grafana k6 - Grafana Labs Community Forums
Viewing all articles
Browse latest Browse all 363

Github run action does not allow env variables in option object?

$
0
0

Hi,

It would appear that the githib k6 run action does not allow environment variables to be used in the options object of a test.

Here are screenshots of minimal examples of the test.js and load-test.yaml files


Please note that there may be a syntactic mistake or 2 but hopefully the concept is still clear.

When the action is executed in github, the following error message is displayed.

:magnifying_glass_tilted_left: Validating test run files.
time=2025-05-15T10:03:36Z level=error msg=TypeError: Cannot read property ‘threshold_http_req_failed_rate’ of undefined\n\tat file:///home/runner/actions-runner/_work/test.js:21:50(xx)\n hint=script exception

This same script works when run locally: k6 run --env TEST_DURATION=5m --env TARGET_ENVIRONMENT=integration - <test.js
And it also works when manually installing and running k6 in the github workflow file instead of using the setup and run actions.

I suspect it may have something to do with the script validation step of the github run action as there does not seem to be a validation step when running locally

Any ideas what I might be doing wrong.

Thank you in advance.
Morné

4 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 363

Trending Articles