-
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
Provide JS modules for making the configuration easier #974
Comments
I like it, thanks for the issue! I also wanted to create some JS helpers for building the new execution schedulers configuration, so that can fall under this issue as well. As you can see in the simple example here, they would be quite finicky to configure with pure JSON/untyped JS objects... Though I still haven't decided what the best UX there will be, I imagine some JS config-builder functions and/or predefined JS objects will be very helpful to users... I'm not sure all of these should be pure JS, but likely most of them shouldn't involve Go code at all, for increased flexibility and better UX. To me it seems like the only thing from these we should handle on the Go side are the constants, like the Regarding load zones and LoadImpact-specific settings - I'd be fine if we bundled them in k6. But I'm not sure how frequently we change them, so we might also offer them as a import { loadZones } from "github.com/loadimpact/cloud/helper.js";
// or even something like import loadimpact from "github.com/loadimpact/cloud/helper.js"
export let options = {
ext: {
loadimpact: {
name: "Hello k6 cloud!",
distribution: {
scenarioLabel1: { loadZone: loadZones.ashburn, percent: 50 },
scenarioLabel2: { loadZone: loadZones.dublin, percent: 50 }
}
}
}
}; And finally, this issue is somewhat connected with #929 |
I am more inclined toward things like this to be js files that we host in github (or some other place) that you can just import as you have shown. |
Remote` modules are good for me. As far as we provide the proper instructions, the different options are valid. I have written some comments about remote modules at #778 (comment) For the future, when the new module resolution lands, the JS modules could be located in an additional repo and check if Babel can transform the module namespace https://www.npmjs.com/package/babel-plugin-transform-imports / |
We believe this is an outdated issue and will close it. |
From Slack:
A few ideas came after reading the comment. Draft ideas:
The list of options are https://docs.k6.io/docs/cloud-execution#section-cloud-execution-options
This particular module could make the info available like:
I reviewed the
options
API and I found other two possible ideas:tlsCipherSuites
options.stages
configuration for common type of load tests:Note: I was considering these to be pure JS modules.
Thoughts?
The text was updated successfully, but these errors were encountered: