-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add --with option to specify extensions to build #5
Comments
Hi @pablochacin , Thanks for the suggestion. Frankly, in its current form, the --with option does not fit the concept of k6x, nor does skipping the extension detection step. Automatic extension detection and discovery is one of the main features of k6x. In addition, this option can be confusing from a UX point of view. I think I understand the use cases, I will try to describe what I understood and look for a solution that does not contradict the concept of k6x.
Please confirm whether I understood the requirements correctly and then I will work out how this can be implemented in accordance with the concept of k6x. |
Hi @szkiba I understand that this feature does not fit the main concept from which k6x was developed, but I think k6x does more than just autodiscovery and the idea of this option is to reuse these other functionalities in other contexts The ability to build and run k6 with the required extensions in one single step is still valuable, regardless of the auto-discovery. More so when considering the cache, that would improve the process in case multiple tests require different combinations of extensions. One alternative I see is to retrofit some of these functionalities in xk6, but this seems a more complex task than exposing them from k6x. |
Hi @pablochacin, As I wrote, I am trying to understand what the requirements are and to provide a solution that does not contradict the concept of the k6x. Yes, k6x is not only about automatic detection of extensions. Building and running in one step is also its main function. I understand that it could be used for something else and I would like to solve it. However, it is important to ensure that the user experience is not confused by parameters with different syntax used for the same purpose. The syntax of the proposed The expectations you expressed inspired the following features: Using these, your use cases can be solved as follows:
|
Hi @szkiba for me the name of the flag ( It also makes sense to use the same syntax as the pragmas that are used in the js code. From the usability perspective, I only would say that forcing to pass |
Hi @pablochacin , The k6x API consists of the command line and pragmas, i.e. the command line flags are part of the API design and therefore the user experience. It's relevant to me :) In the case of Since you didn't say anything else, I assume you will be able to solve your use cases with the help of the above two planned features. |
I hadn't considered the case of variable substitution. Good point.
Yes, I think your proposal covers the use cases pretty well. Thanks. |
Hi @pablochacin , During implementation, I decided to implement #10 instead of #8, because it gives a better user experience. In addition, your use cases can be solved without #7. #7 is not included in the scope of the k6x, so I did not implement it. According to these, your use cases can be solved as follows:
or
The implementation is included in the v0.3.0 release. |
The v0.4.0 includes filtering capability, so 3. can solved by using something like this:
|
In some cases, it would be desirable to allow the user to specify the extensions that should be built into the binary produced by k6x:
build
subcommand, for building a custom binary to be used with multiple tests (similar to using xk6)run
subcommand, to allow specifying the version of the extensions without having to modify the coderun
subcommand, when we want to ensure only a set of pre-approved extensions can be used and prevent the user from using other extensions in their tests (accidentally or maliciously)Cases
1
and3
require disabling the automatic dependency discovery. In the case of the build subcommand, the test script does not need to be provided.In case
2
it could still be valid to combine information from the--with
argument with the discovery of dependencies, but this creates some complexity in the CLI interface, so we suggest disabling auto-discovery when the with option is specified.The text was updated successfully, but these errors were encountered: