-
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
Improve UX of the new
command
#4154
Comments
I really like the templates idea, but the fact that |
Generally speaking, I also think that a simple templates mechanism would be needed here. Indeed, I think we even discussed that specifically at time of releasing That said,
I agree with @andrewslotin that |
Yup, makes sense! Thoughts on this @oleiade?
I'm not really sure about this. It seems a bit redundant to have a Cloud template when any of the existing templates can be converted (rather easily) to a Cloud test. |
Sorry, I wasn't clear enough. I didn't want to mean exactly like browser or protocol, but some option you can set on the templating system. Like with X or Y, where one of these would be with cloud. I explained it like this because I wanted to point to the fact that I see it as another option of the same templating system, and not a "completely separated" thing (like a different (sub)command). In essence, how I envision it , I think it's similar to your draft PR, except for the sub-command and its naming. |
Hey folks 👋🏻 I agree that it might be better to restrict the proposal to modifying Regarding templates, I gave that feedback to @dgzlopes prior to the issue that from a UX perspective I believe we should limit the amount of templates supported natively/out of the box by k6 to use-cases focused ones, like in this proposal: "as a user I want to write a browser test/functional test/protocol test", or "As a user, I want to run a test in the cloud, or in my local machine, or in kubernetes (insert anything relevant here"; essentially what and where, but limited to the minimum. We should also aim to support custom/user-defined templates, but that shouldn't block to move forward. Personally, I'd be really satisfied with the current state of the proposal already. Side-thought: maybe a cheap first step towards templates would be to offer environment variables interpolation in the k6 new command. As-in: if you use environment variables in your script Let's do it 🚀 🙇🏻 |
Gotcha! I have updated the draft PR to only have a single command 👍 (& fixed a bunch of linting issues) If the user adds
I think this would be very useful if we let users define their own templates b/c they can build conditional generation logic without us having to add support for "custom user-defined" flags/arguments. |
I generally agree with what has been said so far. I want to call out this part:
Because I think this is the really useful part/potential of this functionality that would make it easier for teams to deploy opinions on how to use k6 within their organization. For example, maybe we allow users to specify a
And the platform/perf engineering/sre/whoever team is able to manage this information so that other teams can easily/quickly adopt k6 and dont need to waste cycles reinventing the wheel And the structure of
|
Having more (simple) templates available sounds like a great idea to me. I think if the intention here is to make it easier for users to spin up new tests, then potentially an addition of a Extending that further, if you want to keep parity with the On @markjmeier's points - I like the idea of being able to override or specify custom templates. I'd like it if a |
I like the idea of letting users configure templates. However, I'm not sure about the flags approach. While the "minimal" template can be adjusted (e.g., URL, status, etc.), the "protocol" and "browser" templates aren't generic enough to be adapted that way. They are more like "real examples". If we were to add these as flags, I would expect them to work across all templates. But if we added support for this through environment variables, I think that would be great! Supporting this could also give our users endless flexibility once we support passing a custom template 🤔 |
An alternative solution to env variables would be to infer the template source from the value of
This approach is commonly used in CLI tools, does not require us to introduce new configuration variables and can be implemented iteratively in reverse order, i.e. introduce pre-defined templates, later add local file handling and eventually support remote templates, adding protocols once/if needed. |
Feature Description
The
k6 new
command was introduced to:After seeing it used in many places, I have detected some problems:
Suggested Solution (optional)
k6 new
k6 cloud new
--project-id
to override the dummy one.k6 cloud new --project-id 123145
k6 cloud new --project-id 123145 --template=browser
Minimal (default) - Small and concise script. It is ideal for folks who need a starting point for a new project
Protocol - More real script. It is ideal for folks learning, as a reference, or for demos.
Browser - Same as Protocol but with Browser.
(Future: We could let people leverage external templates)
Already existing or connected issues / PRs (optional)
#4153
The text was updated successfully, but these errors were encountered: