Skip to content
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

Create modulesTestState helper #2598

Closed
mstoykov opened this issue Jul 14, 2022 · 1 comment
Closed

Create modulesTestState helper #2598

mstoykov opened this issue Jul 14, 2022 · 1 comment
Labels
documentation-needed A PR which will need a separate PR for documentation evaluation needed proposal needs to be validated or tested before fully implementing it in k6 help wanted
Milestone

Comments

@mstoykov
Copy link
Contributor

Across k6 and many extensions it is common to need to recreate how k6 will execute an extension.

This in general includes creating

  1. goja.Runtime
  2. lib.State
  3. common.InitEnv
  4. modules.VU
  5. an instance of a specific js module we need
  6. since recently an event loop
    combine all of them and run a script.

This isn't exactly hard but there are bunch of stuff that arguably can just be extracted in a helper struct and used across k6 and extensions.

No particular design is proposed, but I will link to some such places:

There are many more, I am also pretty certain there was one that went from init context evaluation to vu context ... but can't find it. (related to this comment)

@mstoykov mstoykov added help wanted evaluation needed proposal needs to be validated or tested before fully implementing it in k6 documentation-needed A PR which will need a separate PR for documentation labels Jul 14, 2022
@oleiade
Copy link
Member

oleiade commented Jul 14, 2022

This would also be really useful in xk6-redis 👍🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation-needed A PR which will need a separate PR for documentation evaluation needed proposal needs to be validated or tested before fully implementing it in k6 help wanted
Projects
None yet
Development

No branches or pull requests

3 participants