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

Feature/containerize #11

Merged
merged 8 commits into from
Oct 1, 2023
Merged

Feature/containerize #11

merged 8 commits into from
Oct 1, 2023

Conversation

szkiba
Copy link
Collaborator

@szkiba szkiba commented Oct 1, 2023

Main new features:

Add dependencies on the command line

In some cases, it may be useful to add dependencies on the command line without modifying the test script.

Additional dependencies and version constraints can be specified on the command line with the --with flag.

--with dependency you can specify additional dependencies and version constraints, the form of the dependency is the same as that used in the "use k6 with" pragma (practically the same as the string after the use k6 with)

k6x run --with k6/x/mock script.js

The example above adds the xk6-mock extension to the list of dependencies.

Docker Image

In certain circumstances, it can be useful to run k6x using the docker engine itself, as a drop-in replacement of the k6 docker image. Therefore, it is advisable to publish in the form of a docker image that contains the tools necessary for building (golang, git).

The szkiba/k6x docker image is available from the Docker Hub.

The k6x docker builder (--builder docker) now uses the k6x docker image instead of the xk6 docker image to build the k6 binary. This results in a significant reduction in build time. The speed increase is due to the use of persistent go cache. The k6x-cache volume is a persistent local docker volume. This is where the go cache and the go module cache are placed.

@szkiba szkiba merged commit e65cc15 into master Oct 1, 2023
9 checks passed
@szkiba szkiba deleted the feature/containerize branch October 1, 2023 19:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant