k6 icon indicating copy to clipboard operation
k6 copied to clipboard

WIP Add a `k6 cloud run --local-execution` mode of execution

Open oleiade opened this issue 1 year ago • 1 comments

What?

This PR adds support for a new --local-execution flag to the k6 cloud run command. Using it, users can run their test script or archive on their local machine, while streaming the results to the cloud.

It is built upon the latter, and ⚠️ cannot be merged before #3813 ⚠️.

In the context of this PR, the goal is to reproduce the behavior of the k6 run -o cloud behavior, and depending on the advancement of internal work, to also add support for adding archive upload. In a future PR, at a later point in time, we will also add support for logs and traces streaming to the cloud but are dependent on internal work to be able to do so.

⚠️ This is currently a work-in-progress, and non-functional (yet) PR ⚠️

Why?

We aim to integrate the experience of running tests locally, whilst streaming results to the cloud more intuitive, and integrated in the k6 experience. We also aim to take this opportunity to align some of the logic and behavior involved in running tests in the cloud and running tests locally better.

Task list

  • [ ] We're gonna introduce a couple of options specific to --local-execution. One of the ideas we've been having in the k6 v1 UX work stream revolved around the idea of scoping options with a dot separator like in Prometheus: --local.execution, --local.send-archive, --local.send-logs, etc. cc @dgzlopes
  • [ ] Once we're at that point we'd like sending the archive to be opt-in (via an option that users need to explicitly pass). Same goes for logs. The reason being that they might contain sensitive info. cc @dgzlopes
  • [ ] When using k6 cloud run --local-execution, we should make sure the outputs field of the terminal output of the command displays a sensible value (like the URL of the job in the grafana cloud app?). cc @dgzlopes
  • [ ] Should the k6 cloud run --local-execution show the same terminal output as k6 run or k6 cloud run?

Checklist

  • [ ] I have performed a self-review of my code.
  • [ ] I have added tests for my changes.
  • [ ] I have run linter locally (make lint) and all checks pass.
  • [ ] I have run tests locally (make tests) and all tests pass.
  • [ ] I have commented on my code, particularly in hard-to-understand areas.

Related PR(s)/Issue(s)

oleiade avatar Jun 27 '24 15:06 oleiade