Here is the first roundup of 2023, including a new k6 release, the latest developments in the k6 ecosystem, and news from the community. High time for a big update from your k6 amigos!
🙌 v0.43 released
v0.43 contains two releases which includes v0.43.0 and v0.43.1. v0.43.0 brings one of the most demanded k6 features: a friendlier syntax for working with asynchronous functionality via Javascript's async and await.
The lack of await support made using asynchronous functions inconvenient in k6. You needed to use the then() API to resolve a Promise and needed to design the k6 test as a nested Promise chain. Here’s a dummy example of an async client:
Now with await, k6 can wait for the Promise to get its value, so you could write the previous test as:
This release also includes a way to make asynchronous HTTP requests using http.asyncRequest to return a Promise. In future releases, we plan to introduce more k6 asynchronous APIs.
Distributed tracing
This release also includes a new experimental module to instrument HTTP requests with tracing data, supporting W3C or Jaeger traces. If you instrument your applications in the same way, you can now pinpoint the specific k6 traces in your observability (“o11y”) stack.
To learn more, check out the tracing module documentation.
More fixes and improvements in this k6 version can be found in the following release notes:
🌐 k6 Browser
xk6-browser, our extension that adds browser-level APIs to enable browser automation, is now bundled in k6 as an experimental module! 🙌🏼
This further simplifies browser automation and frontend performance since it’s now a core part of k6. You no longer need to create a custom binary of k6 or use a separate run command to run your browser tests.
Going forward, xk6-browser will be referred to as k6 browser or simply the browser module now that it's bundled in k6 natively.
To learn more about why the team decided to merge xk6-browser to k6 core, as well as the changes to your browser test scripts, check out our k6 browser module announcement blog post.
☁️ k6 Cloud
The k6 Cloud team is now entirely focused on bringing the k6 Cloud experience to Grafana Cloud. The benefits of closer integration within your o11y stack are huge. To start, you'll gain better visibility between your testing and the system's performance, and there's no longer the need to switch between different platforms.
Soon, Grafana Cloud users will be able to access most of the k6 Cloud capabilities within Grafana Cloud. Stay tuned for new announcements!
🔧 k6-operator
The k6-operator, the Kubernetes operator for running distributed k6 tests, has received some love these days! We've finally started resolving idempotency in the operator (#138), which is an umbrella epic for faulty cases related to timing and the state of test runs. Major improvements were made by @ivanape, including providing support for simultaneous tests execution without cloud output.
Other updates since v0.0.7 include:
- Support for new features: envFrom, imagePullPolicy, imagePullSecrets.
- Improved integration with the Distributed Application Runtime (Dapr) project.
- Bug fixes, other small improvements, and documentation.
For a full list of features and fixes, check out the release notes for v0.0.8 and v0.0.9rc3.
Be sure to watch Office Hours #72, which provided a demonstration of the k6-operator that you can run locally as well!
💥 xk6-disruptor
xk6-disruptor is one of the latest offerings from k6. The latest release brought support in Windows and within a Kubernetes cluster.
If your application runs in Kubernetes, this extension allows your k6 tests to inject HTTP failures at the application level.
This previous example disrupts the my-app service for 60 seconds. The disrupted service will respond with a 100ms delay and fail 10% of responses by returning the 500 HTTP status code.
With xk6-disruptor, you can more easily test how your application behaves when these errors occur.
⚙️ k6 Extensions
Our community of developers has been busy working on various extensions. At least 8 extensions have been updated while 4 new ones have been created!
xk6-distributed-tracing received some fixes for W3C compliance given its promotion to k6 core as an experimental module.
xk6-amqp migrated from a non-supported client to a maintained fork.
xk6-output-timescaledb received updates for batch handling thanks to a contribution from @miscjo.
xk6-output-influxdb was updated to remove strict reliance on the os package for accessing environment variables. This allows for easier unit testing.
- xk6-output-prometheus-remote had some documentation fixes and updates to the provided Grafana dashboard from @jwcastillo. We’re also happy to announce that this dashboard is now available as the official k6 dashboard for Prometheus.
From the community…
kubeshop/xk6-tracetest was created by the folks at Tracetest.io. Along with Tracetest, this allows you to perform trace-based testing with k6! Be sure to check out the Office Hours #77 for details on this exciting integration.
dataport/xk6-filewriter was created to write logging data to external files during a test.
martymarron/xk6-output-prometheus-pushgateway was created for situations where the remote_write feature for Prometheus cannot be enabled.
mostafa/xk6-kafka continues its cadence, staying up-to-date with this latest k6 release.
Once again, to our tireless community of extension developers: We see you and thank you!!!
🗞️ Must-reads
The reverse load test shows how we load tested k6 Cloud to prepare for high traffic and our learnings.
ChatGPT: a practical overview with k6 examines how to write a k6 test with ChatGPT.
Comparing LoadRunner vs. k6. Share this comparison with LoadRunner users who ask you what k6 is.
The k6 Champions program is recognizing community members who have been passionate about supporting the community and sharing their k6 knowledge.
Pair Grafana Faro and k6 for frontend observability shows the potential of using both tools together.
Get started with k6 browser provides an in-depth introductory guide on how to get started with the browser module.
📺 Must watch
Frontend vs. Backend performance testing talks about performance testing both sides and how a hybrid performance testing approach can combine both.
How to organize testing scripts in k6 (Office Hours #76) demonstrates features like tags, groups, and functions depending on what type of testing you want to do.
Shifting Left Chaos Testing details the challenges adopting chaos engineering practices by a broader audience and introduces xk6-disruptor.
Happy testing!
-The k6 team