-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce experimental JS modules #2630
Conversation
The error you are getting in the tests is due to 1b0e24e . You should probably bump the k6 version in the extension and fix it there for now. |
Checklist:
|
844cf7b
to
7350f8c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM in general, but
- Can you add the websockets and timers as well just so we don't open multiple PRs (I am lazy)
- I think the experimental's README needs an update
0b30c35
to
7b82bcb
Compare
c29fe73
to
2cddbe2
Compare
2cddbe2
to
bdeca6a
Compare
ffaf255
to
097b560
Compare
github.com/cespare/xxhash/v2 v2.1.2 // indirect | ||
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect | ||
github.com/go-redis/redis/v8 v8.11.5 // indirect | ||
github.com/mstoykov/k6-taskqueue-lib v0.1.0 // indirect |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be in the bottom block 🤔
This commit imports the latest state of xk6-redis, xk6-websockets, and xk6-timers into k6's core as experimental modules importable under the "k6/experimental" import path. Specifically regarding the redis module: with it comes a single direct dependency, the `redis/v8` library, and two indirect dependencies implied by the former `xxhash` and `go-rendezvous`. This commit's essential files are: * `js/initcontext.go`: exposes the modules under `k6/experimental` * `samples/experimental/*.go`: exposes examples of the experimental module in action * `samples/docker-compose.yml`: allows to spin up a stack for testing the redis module The rest of the files are essentially go module and vendoring plumbing.
da648a9
a997947
to
da648a9
Compare
It's green again 🪴 🌱 |
Rationale
This PR makes
xk6-redis
,xk6-timers
andxk6-websockets
extensions importable under thek6/experimental
import path. Their code is not imported in k6's codebase, but instead added as dependencies, which allows for more flexibility during their integration and improvement process moving forward.Review
The code of each module themselves was already reviewed in their source extension's context. We'd be more interested in getting feedback on the integration. Modules are importable as
js/modules/k6/experimental
in k6 scripts, but their code remains in their respective k6 extensions, who have been especially structured to permit this import.Don't let the size of the PR scare you, most of it is "just" vendor anyway.
The significant files are:
js/initcontext.go
: exposes the modules underk6/experimental
samples/experimental/*.go
: exposes examples of the experimentalmodule in action
samples/docker-compose.yml
: allows spinning up a stack for testingthe Redis module
Let me know what you think 🙇🏻