grafana / run-k6-action

GitHub Action for running k6 tests
Apache License 2.0
7 stars 0 forks source link

Inspect step fails, because of missing ENV #21

Open nexeck opened 1 month ago

nexeck commented 1 month ago

https://github.com/grafana/run-k6-action/blob/575942d000c76d66708b9232d2d506153df6dc8f/src/k6helper.ts#L29

Is there a reason, why ENV isn't pushed into the k6 inspect command? This makes it fail for aws tests

ERRO[0000] Error: invalid AWS region; reason: expected a valid AWS region name (e.g. "us-east-1"), gotundefined at apply (native) at webpack://k6-jslib-aws/./src/internal/endpoint.ts:4:21(12) at r (webpack://k6-jslib-aws/./src/internal/endpoint.ts:4:21(12)) at construct (native) at T (webpack://k6-jslib-aws/./src/internal/endpoint.ts:4:21(24)) at t (webpack://k6-jslib-aws/./src/internal/config.ts:177:33(14)) at e (webpack://k6-jslib-aws/./src/internal/config.ts:82:18(58)) at value (webpack://k6-jslib-aws/./src/internal/config.ts:65:15(24)) at file:///Users/xxxx/code/xxxxx/test/src/xxxxx--smoke-test.js:8:18(46) hint="script exception"

Part of the testfile which fails:

`import {AWSConfig, Endpoint, SignatureV4,} from 'https://jslib.k6.io/aws/0.12.3/signature.js';

const awsConfig = AWSConfig.fromEnvironment()`

The only missing part seems to be: https://github.com/grafana/run-k6-action/blob/main/src/index.ts#L190 And adding the flag: --include-system-env-vars

TuanNguyenEPI commented 1 month ago

I also got the same issue, but with k6 cloud command. I passed in all the environment variables using -e option in the flag. Looking forward to the solution.