Create k6runner.Script
and make probers aware of it
#727
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Before this PR,
MultiHTTP
andScripted
Prober
s created k6 runners using only the raw script data ([]byte
) as input to the runner. This have worked nicely, as until now runners only required two things to work: The raw script data, and a timeout that was encoded in the context forRunner.Run()
.We have seen however a couple scenarios that make me think this is not enough for the near future:
Runner.Run()
, a.k.a. the request timeout, from the check timeout that is communicated to the runners. This is needed to properly implement what k6runner: use check context for http request #715 workarounded.For these three reasons, I think it is beneficial to create a richer type so that
Prober
s can feed all these details to the k6 runner, which this PR does.Please note that this PR is not feature complete, namely how timeouts are handled does not fully makes sense. This is because I tried to keep the patchset as small as possible for reviewability. How timeouts are handled is improved in #724.