You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The use case is being able to start a test run in a CI pipeline, but not wait for execution complete (so as to not block and pay for the pipeline agent). Then at some later time check on the status of the run and pass or fail the stage.
An example pipeline with Azure DevOps might look like this
stages:
- stage: Runjobs:
- job: Runsteps:
- script: | k6 cloud my-test.js --exit-on-running env: K6_CLOUD_TOKEN: TODO_SUBSTITUTE displayName: Schedule load test in k6 cloud workingDirectory: $(Pipeline.Workspace)/load-test# Align this wait time with expected execution time of the k6 run so we don't block an agent to get the results
- stage: WaitForExecutionjobs:
- job: WaitForExecutionpool: serversteps:
- task: Delay@1inputs:
delayForMinutes: '30'
- stage: InspectResultsjobs:
- job: InspectResultssteps:
- script: | k6 status ..... env: K6_CLOUD_TOKEN: TODO_SUBSTITUTE displayName: Inspect k6 results
Be able to initiate a test run, wait a while, and then get status of that run.
Today use --exit-on-running so the agent initiating the run isn't blocked
Could use Read load test run API to get the result, but CLI doesn't give an indication of the run id
Suggested Solution (optional)
k6 cloud my-test.js --exit-on-running --output json would output something such as { "reference_id": 123 }
This could then be set as a state in the pipeline so another stage could use this reference
Either use Cloud REST API to poll state after some delay, or k6 status command to enable this from CLI
Already existing or connected issues / PRs (optional)
No response
The text was updated successfully, but these errors were encountered:
So maybe also logging the reference ID with the k6 cloud command would be the quickest fix that would help you. Then you could parse the output as JSON and get the referenceId from there. --log-output file might help with that as well.
You might even parse the URL currently shown by k6 (output: https://k6.io/runs/150118), and just get it from there. It's a bit hacky, but should work.
Finally, I don't see why we can't start a REST API for k6 cloud, just as we do for k6 run. It wouldn't support some features like pause/resume/scale, but it should be able to show you the same as k6 status does with k6 run. We would only need to include the referenceId in the status output. That way you could call it after starting the test, instead of parsing the logging output.
Feature Description
The use case is being able to start a test run in a CI pipeline, but not wait for execution complete (so as to not block and pay for the pipeline agent). Then at some later time check on the status of the run and pass or fail the stage.
An example pipeline with Azure DevOps might look like this
--exit-on-running
so the agent initiating the run isn't blockedSuggested Solution (optional)
k6 cloud my-test.js --exit-on-running --output json
would output something such as{ "reference_id": 123 }
k6 status
command to enable this from CLIAlready existing or connected issues / PRs (optional)
No response
The text was updated successfully, but these errors were encountered: