Closed luanholiv closed 1 year ago
Unable to parse and stringify .env files while executing the tests from dotenv.test.js file.
dotenv.test.js
xk6 build v0.40.0 --with github.com/szkiba/xk6-dotenv
.\k6 run --verbose .\dotenv.test.js
Getting error messages:
"TypeError: could not convert function call parameter 0: could not convert FOO = bar SIZE = small to context.Context"
"TypeError: could not convert function call parameter 0: could not convert [object Object] to context.Context"
Successful test execution.
DEBU[0000] Logger format: TEXT DEBU[0000] k6 version: v0.40.0 ((devel), go1.19.2, windows/amd64) /\ |‾‾| /‾‾/ /‾‾/ /\ / \ | |/ / / / / \/ \ | ( / ‾‾\ / \ | |\ \ | (‾) | / __________ \ |__| \__\ \_____/ .io DEBU[0000] Resolving and reading test '.\dotenv.test.js'... DEBU[0000] Loading... moduleSpecifier="file:///C:/repos/xk6-dotenv/test/dotenv.test.js" originalModuleSpecifier=".\\dotenv.test.js" DEBU[0000] '.\dotenv.test.js' resolved to 'file:///C:/repos/xk6-dotenv/test/dotenv.test.js' and successfully loaded 1997 bytes! DEBU[0000] Gathering k6 runtime options... DEBU[0000] Initializing k6 runner for '.\dotenv.test.js' (file:///C:/repos/xk6-dotenv/test/dotenv.test.js)... DEBU[0000] Detecting test type for... test_path="file:///C:/repos/xk6-dotenv/test/dotenv.test.js" DEBU[0000] Trying to load as a JS test... test_path="file:///C:/repos/xk6-dotenv/test/dotenv.test.js" DEBU[0000] Babel: Transformed t=128.9597ms DEBU[0000] Loading... moduleSpecifier="file:///C:/repos/xk6-dotenv/test/expect.js" originalModuleSpecifier=./expect.js DEBU[0001] Babel: Transformed t=461.2804ms DEBU[0001] Runner successfully initialized! DEBU[0001] Parsing CLI flags... DEBU[0001] Consolidating config layers... DEBU[0001] Parsing thresholds and validating config... DEBU[0001] Initializing the execution scheduler... DEBU[0001] Starting 1 outputs... component=output-manager DEBU[0001] Starting... component=metrics-engine-ingester DEBU[0001] Started! component=metrics-engine-ingester DEBU[0001] Starting the REST API server on localhost:6565 execution: local script: .\dotenv.test.js output: - scenarios: (100.00%) 1 scenario, 1 max VUs, 10m30s max duration (incl. graceful stop): * default: 1 iterations for each of 1 VUs (maxDuration: 10m0s, gracefulStop: 30s) DEBU[0001] Initialization starting... component=engine DEBU[0001] Starting emission of VUs and VUsMax metrics... DEBU[0001] Start of initialization executorsCount=1 neededVUs=1 phase=local-execution-scheduler-init DEBU[0001] Initialized VU #1 phase=local-execution-scheduler-init DEBU[0001] Finished initializing needed VUs, start initializing executors... phase=local-execution-scheduler-init DEBU[0001] Initialized executor default phase=local-execution-scheduler-init DEBU[0001] Initialization completed phase=local-execution-scheduler-init DEBU[0001] Execution scheduler starting... component=engine DEBU[0001] Start of test run executorsCount=1 phase=local-execution-scheduler-run DEBU[0001] Running setup() phase=local-execution-scheduler-run DEBU[0001] Metrics processing started... component=engine DEBU[0001] Start all executors... phase=local-execution-scheduler-run DEBU[0001] Starting executor executor=default startTime=0s type=per-vu-iterations DEBU[0001] Starting executor run... executor=per-vu-iterations iterations=1 maxDuration=10m0s scenario=default type=per-vu-iterations vus=1 ERRO[0001] Exception raised in test "parse". Failing the test and continuing. TypeError: could not convert function call parameter 0: could not convert FOO = bar SIZE = small to context.Context source=console ERRO[0001] Exception raised in test "stringify". Failing the test and continuing. TypeError: could not convert function call parameter 0: could not convert [object Object] to context.Context source=console ERRO[0001] Exception raised in test "sample". Failing the test and continuing. to context.Context source=console DEBU[0001] Regular duration is done, waiting for iterations to gracefully finish executor=per-vu-iterations gracefulStop=30s scenario=default DEBU[0001] Executor finished successfully executor=default startTime=0s type=per-vu-iterations DEBU[0001] Running teardown() phase=local-execution-scheduler-run DEBU[0001] Metrics emission of VUs and VUsMax metrics stopped DEBU[0001] Execution scheduler terminated component=engine error="<nil>" DEBU[0001] Processing metrics and thresholds after the test run has ended... component=engine DEBU[0001] run: execution scheduler terminated component=engine DEBU[0001] Stopping... component=metrics-engine-ingester DEBU[0001] Stopped! component=metrics-engine-ingester DEBU[0001] running thresholds component=metrics-engine metric_name=errors DEBU[0001] Thresholds failed component=metrics-engine metric_name=errors DEBU[0001] Engine run terminated cleanly running (00m00.0s), 0/1 VUs, 1 complete and 0 interrupted iterations default ✓ [======================================] 1 VUs 00m00.0s/10m0s 1/1 iters, 1 per VU DEBU[0001] Engine: Thresholds terminated component=engine █ parse ✗ Exception raised "TypeError: could not convert function call parameter 0: could not convert FOO = bar SIZE = small to context.Context" ↳ 0% — ✓ 0 / ✗ 1 ✗ Exception raised "TypeError: could not convert function call parameter 0: could not convert [object Object] to context.Context" ↳ 0% — ✓ 0 / ✗ 1 █ sample to context.Context" ↳ 0% — ✓ 0 / ✗ 1 checks...............: 0.00% ✓ 0 ✗ 3 data_received........: 0 B 0 B/s data_sent............: 0 B 0 B/s ✗ errors...............: 100.00% ✓ 3 ✗ 0 group_duration.......: avg=984.03µs min=974.3µs med=986.6µs max=991.2µs p(90)=990.28µs p(95)=990.74µs iteration_duration...: avg=4.45ms min=4.45ms med=4.45ms max=4.45ms p(90)=4.45ms p(95)=4.45ms iterations...........: 1 96.006144/s DEBU[0001] Waiting for engine processes to finish... DEBU[0001] Metrics processing winding down... component=engine DEBU[0001] running thresholds component=metrics-engine metric_name=errors DEBU[0001] Thresholds failed component=metrics-engine metric_name=errors DEBU[0001] Everything has finished, exiting k6! DEBU[0001] Stopping 1 outputs... component=output-manager DEBU[0001] Stopping... component=metrics-engine-ingester DEBU[0001] Stopped! component=metrics-engine-ingester ERRO[0001] some thresholds have failed
same v0.42.0
I'm back, sorry for the delay. Problem solved (in v0.1.2). @luanholiv may I ask you to close if it wors for you too...
And thanx @qapquiz for PR...
Hi, @szkiba, thanks for the feedback.
Summary
Unable to parse and stringify .env files while executing the tests from
dotenv.test.js
file.Steps to reproduce
xk6 build v0.40.0 --with github.com/szkiba/xk6-dotenv
.\k6 run --verbose .\dotenv.test.js
Current behavior
Getting error messages:
"TypeError: could not convert function call parameter 0: could not convert FOO = bar SIZE = small to context.Context"
"TypeError: could not convert function call parameter 0: could not convert [object Object] to context.Context"
Expected behavior
Successful test execution.
Relevant logs