Skip to content

Releases: grafana/xk6

v1.1.2

17 Jul 18:56
33c66aa
Compare
Choose a tag to compare

Grafana xk6 v1.1.2 is here! 🎉

Bug Fixes

  • The xk6 build command now correctly logs the k6 version being used. The version number is emphasized, and a warning is displayed if it's not the latest.
  • xk6 build now respects HTTP_PROXY, HTTPS_PROXY, and NO_PROXY environment variables, allowing it to work in proxied environments.

New Feature

The xk6 sync command can now generate results in multiple formats:

  • Terminal text: The default, colored output.
  • JSON: Use the --json flag for standard JSON output or combine it with --compact for unindented JSON.
  • Markdown: Use the --markdown flag to generate a Markdown report, which is useful for changelogs.

v1.1.1

16 Jul 12:32
9564b85
Compare
Choose a tag to compare

Grafana xk6 v1.1.1 is here! 🎉

This is a patch release that addresses a critical bug in our multi-arch Docker image, ensuring proper functionality on arm64 platforms.

Bug Fix

Corrected the build process for the linux/arm64 Docker image. Previously, the image was incorrectly shipping amd64 binaries, causing an exec format error on ARM-based systems like Apple Silicon (M1/M2/M3) and AWS Graviton. The multi-arch image now contains the correct native binaries for the arm64 platform and functions as expected.

This resolves the issue where running xk6 on an arm64 host would fail. A big thank you to @potyl for reporting this!

v1.1.0

15 Jul 09:34
9b3397c
Compare
Choose a tag to compare

Grafana xk6 v1.1.0 is here! 🎉

New Features

xk6 sync subcommand

The xk6 sync subcommand synchronizes the versions of dependencies in go.mod with those used in the k6 project. Dependencies not found in k6's go.mod remain unchanged. Future updates may include synchronization of other files.

The purpose of xk6 sync subcommand is to avoid dependency conflicts when building the extension with k6 (and other extensions).

Inspired by the grafana/go-depsync command.

Maintenance

  • Docker base image updated to golang:1.24.5-alpine3.22

v1.0.1

25 Jun 10:05
78bf8ab
Compare
Choose a tag to compare

Grafana xk6 v1.0.0 is here! 🎉

xk6 v1.0.0 marks a significant milestone, incorporating numerous features and capabilities that were gradually introduced in previous versions. These release notes are a bit different, by detailing changes implemented incrementally in anticipation of this major release.

xk6 version 1.0.0 introduces significant enhancements, effectively evolving the Custom k6 builder into a comprehensive k6 extension developer toolbox.

What's been removed in xk6 v1.0.0?

Breaking Changes

No unknown k6 commands wrapping

xk6 v1.0.0 only wraps the k6 run command as xk6 run. Any other commands will no longer be automatically passed through. Previously, xk6 would forward all unrecognized commands to the dynamically built k6.

Previously, the xk6 version command displayed the k6 version built during the process. Now, this command shows the xk6 version itself.

No API exposed

xk6 v1.0.0 does not expose a public Go API.

A dedicated Go library (grafana/k6foundry) now exists for building k6 executables. Since xk6 utilizes this library directly, there is no benefit to adding another layer of wrapping.

What's new in xk6 v1.0.0?

Get started docs

Before getting into what's new, it's worth mentioning the new docs that help you get started with extension development.

The k6 extension development quick start guide offers a straightforward, step-by-step introduction. For a more in-depth understanding, the k6 extension development tutorial provides a practical example of extension development.

There are also two new example extensions to help users get started:

  • xk6-example: This JavaScript extension shows the integration between the k6 JavaScript runtime and a Go extension. It also provides JavaScript API documentation and demonstrates the use of reusable GitHub workflows offered by xk6.
  • xk6-output-example: This output extension shows how to process k6 runtime metrics within an extension.

Refactored command handling

The command-line interface has been significantly refactored in xk6 v1.0.0. This overhaul introduces new commands alongside the existing xk6 build and xk6 run, expanding xk6's functionality. All commands support the standard --help flag for displaying usage instructions.

Print xk6 Version

The command xk6 version is now available and outputs the xk6 version.

Create Extension

The xk6 new command simplifies the creation of new k6 extensions. With a single command, you can generate a functional extension. This command utilizes the grafana/xk6-example and grafana/xk6-output-example repositories as a template for the new extension.

Check Compliance

The xk6 lint command verifies an extension's compliance with recommended practices by examining the source directory. When used within a git repository, it also analyzes git metadata. Compliance is assessed as a weighted percentage (0-100), derived from individual checker scores. This percentage is then translated into a compliance grade (A-F).

Build logic extracted

The k6 build logic has been extracted into a dedicated go library (grafana/k6foundry). This library is used by all elements of the k6 ecosystem, including xk6.

The extraction of code into a library involved refactoring, which may introduce minor compatibility issues. These incompatibilities are actively being resolved.

Reusable GitHub workflows

xk6 offers two GitHub workflows to streamline k6 extension development:

  • Extension Validate: This workflow, usually triggered by a pull request, conducts several validation checks.
  • Extension Release: Triggered by creating a version tag, this workflow generates release artifacts. It builds k6 with the extension for specified platforms and includes it in the release.

You can find reusable workflows in the .github/workflows directory of the xk6-example repository.

Read more in xk6 workflows.

Simplified Go install

The main Go package is now located in the repository's root directory. This change simplifies the installation process using go install and direct execution with go run.

# install
go install go.k6.io/xk6@latest
# execute without install
go run go.k6.io/xk6@latest version

GitHub CLI extension

The gh-xk6 extension enables the use of xk6 commands within the GitHub CLI. This can streamline xk6 installation for users who already have the GitHub CLI.

# install
gh extension install grafana/gh-xk6
# execute
gh xk6 version

The GitHub CLI's availability by default in GitHub workflows is a significant advantage.

Homebrew formula

MacOS and Linux users can now install and manage xk6 with a dedicated Homebrew formula.

# install
brew install xk6
# execute
xk6 version

Dev Container Feature

Integrate xk6 into Development Containers by adding xk6 Feature to your Dev Containers configuration.

 "features": {
    "ghcr.io/grafana/devcontainer-features/xk6:1": { "version": "1.0.0" }
  }

For developing the following extensions, Dev Containers is now the recommended environment:

Read more in Development Containers and k6.

v1.0.0

10 Jun 08:29
Compare
Choose a tag to compare

Grafana xk6 v1.0.0 is here! 🎉

xk6 v1.0.0 marks a significant milestone, incorporating numerous features and capabilities that were gradually introduced in previous versions. These release notes are a bit different, by detailing changes implemented incrementally in anticipation of this major release.

xk6 version 1.0.0 introduces significant enhancements, effectively evolving the Custom k6 builder into a comprehensive k6 extension developer toolbox.

What's been removed in xk6 v1.0.0?

Breaking Changes

No unknown k6 commands wrapping

xk6 v1.0.0 only wraps the k6 run command as xk6 run. Any other commands will no longer be automatically passed through. Previously, xk6 would forward all unrecognized commands to the dynamically built k6.

Previously, the xk6 version command displayed the k6 version built during the process. Now, this command shows the xk6 version itself.

No API exposed

xk6 v1.0.0 does not expose a public Go API.

A dedicated Go library (grafana/k6foundry) now exists for building k6 executables. Since xk6 utilizes this library directly, there is no benefit to adding another layer of wrapping.

What's new in xk6 v1.0.0?

Get started docs

Before getting into what's new, it's worth mentioning the new docs that help you get started with extension development.

The k6 extension development quick start guide offers a straightforward, step-by-step introduction. For a more in-depth understanding, the k6 extension development tutorial provides a practical example of extension development.

There are also two new example extensions to help users get started:

  • xk6-example: This JavaScript extension shows the integration between the k6 JavaScript runtime and a Go extension. It also provides JavaScript API documentation and demonstrates the use of reusable GitHub workflows offered by xk6.
  • xk6-output-example: This output extension shows how to process k6 runtime metrics within an extension.

Refactored command handling

The command-line interface has been significantly refactored in xk6 v1.0.0. This overhaul introduces new commands alongside the existing xk6 build and xk6 run, expanding xk6's functionality. All commands support the standard --help flag for displaying usage instructions.

Print xk6 Version

The command xk6 version is now available and outputs the xk6 version.

Create Extension

The xk6 new command simplifies the creation of new k6 extensions. With a single command, you can generate a functional extension. This command utilizes the grafana/xk6-example and grafana/xk6-output-example repositories as a template for the new extension.

Check Compliance

The xk6 lint command verifies an extension's compliance with recommended practices by examining the source directory. When used within a git repository, it also analyzes git metadata. Compliance is assessed as a weighted percentage (0-100), derived from individual checker scores. This percentage is then translated into a compliance grade (A-F).

Build logic extracted

The k6 build logic has been extracted into a dedicated go library (grafana/k6foundry). This library is used by all elements of the k6 ecosystem, including xk6.

The extraction of code into a library involved refactoring, which may introduce minor compatibility issues. These incompatibilities are actively being resolved.

Reusable GitHub workflows

xk6 offers two GitHub workflows to streamline k6 extension development:

  • Extension Validate: This workflow, usually triggered by a pull request, conducts several validation checks.
  • Extension Release: Triggered by creating a version tag, this workflow generates release artifacts. It builds k6 with the extension for specified platforms and includes it in the release.

You can find reusable workflows in the .github/workflows directory of the xk6-example repository.

Read more in xk6 workflows.

Simplified Go install

The main Go package is now located in the repository's root directory. This change simplifies the installation process using go install and direct execution with go run.

# install
go install go.k6.io/xk6@latest
# execute without install
go run go.k6.io/xk6@latest version

GitHub CLI extension

The gh-xk6 extension enables the use of xk6 commands within the GitHub CLI. This can streamline xk6 installation for users who already have the GitHub CLI.

# install
gh extension install grafana/gh-xk6
# execute
gh xk6 version

The GitHub CLI's availability by default in GitHub workflows is a significant advantage.

Homebrew formula

MacOS and Linux users can now install and manage xk6 with a dedicated Homebrew formula.

# install
brew install xk6
# execute
xk6 version

Dev Container Feature

Integrate xk6 into Development Containers by adding xk6 Feature to your Dev Containers configuration.

 "features": {
    "ghcr.io/grafana/devcontainer-features/xk6:1": { "version": "1.0.0" }
  }

For developing the following extensions, Dev Containers is now the recommended environment:

Read more in Development Containers and k6.

v0.20.1

16 May 19:18
97e321c
Compare
Choose a tag to compare

xk6 v0.20.1 is here!

New Features

Info logging after sucessful xk6 new and xk6 adjust #197

After successful execution of xk6 new and xk6 adjust subcommands, the user will be informed about the successful operation with an info level log for a better user experience.

Bugfixes

Extension Validate Workflow: Check if GitHub Pages is enabled #193

In the extension-validate.yml shared workflow, the Pages job will only be active if GitHub Pages is enabled in the repository.

Maintenance

Docker base image version updated

Docker base image version updated from 1.24.2-alpine3.21 to 1.24.3-alpine3.21

v0.20.0

16 May 09:11
Compare
Choose a tag to compare

xk6 v0.20.0 is here!

This release includes the following subcommands as early access:

  • new subcommand
  • adjust subcommand

New features

new subcommand #182

Create and initialize a new k6 extension using one of the predefined templates.

The go module path of the new extension must be passed as an argument.

An optional extension description can be specified as a flag.
The default description is generated from the go module path as follows:

  • remote git URL is generated from the go module path
  • the description is retrieved from the remote repository manager

An optional go package name can be specified as a flag.
The default go package name is generated from the go module path as follows:

  • the last element of the go module path is kept
  • the xk6-output- and xk6- prefixes are removed
  • the - characters are replaced with _ characters

A JavaScript type k6 extension will be generated by default.
The extension type can be optionally specified as a flag.

The grafana/xk6-example and grafana/xk6-output-example GitHub repositories are used as sources for generation.

adjust subcommand

This command will make the necessary adjustments after forking the example repository.

  • The go module path and package name will be set
  • The JavaScript import path will be set
  • The example scripts will be adjusted to the new import path
  • The extension will be ready to build and test

This is an internal (hidden) command designed to be run as a Dev Container lifecycle script.


Early Access

Early access functionality is included in the xk6 executable, which can be activated by setting the XK6_EARLY_ACCESS environment variable to true. The early access executable (xk6ea) is still available in the release.

v0.19.3

10 May 17:33
a9915b8
Compare
Choose a tag to compare

xk6 v0.19.3 is here!

This is a maintenance release, changes:

  • added gh CLI extension support #186
  • fix CGO_ENABLED environment variable handling #188

v0.19.2

07 May 14:34
Compare
Choose a tag to compare

xk6 v0.19.2 is here!

This is an internal maintenance release for the security update of GitHub workflows.

v0.19.1

17 Apr 12:32
48f9ef0
Compare
Choose a tag to compare

xk6 v0.19.1 is here!

This is a minor bugfix release for reusable GitHub workflows:

Fix default golangci-lint arguments

The --preset flag has been deprecated since golangci-lint version 2.
Validate workflows used the --preset flag when there is no golangci-lint configuration file.
This caused an error, so the --preset flag has been removed from the default arguments.