k6-docs icon indicating copy to clipboard operation
k6-docs copied to clipboard

Documentation feedback: /docs/sources/k6/v0.55.x/javascript-api/k6-execution.md

Open bernhard-dwe opened this issue 11 months ago • 2 comments

It would be useful to know how to alter the return/exit code of k6 from the script. I.e. how can I communicate to code calling k6 that this run of k6 was successful or unsuccessful?

bernhard-dwe avatar Jan 03 '25 15:01 bernhard-dwe

@grafana/k6-core is this doable from a k6 script? 🤔

heitortsergent avatar Jan 06 '25 22:01 heitortsergent

@bernhard-dwe, the abort() method stops the test run and exits with a predefined 108 code. If you want to keep the test running but mark it as failed upon exit, then this issue may be relevant to you. We are gathering requirements and would love to learn more about your use case. Please feel free to comment on the issue!

andrewslotin avatar Jan 07 '25 14:01 andrewslotin