Presenters
Source
k6 v2.0: Supercharging Your Testing with AI and a Smarter Platform 🚀
Get ready, developers! The k6 team at Grafana Labs is about to drop a major update: k6 version 2.0, launching on May 11th, 2026. This isn’t just another iteration; it’s a complete reimagining of k6, built for the AI-driven world we live in today. While your existing k6 v1.0 scripts and pipelines will feel familiar, k6 v2.0 introduces a powerful new suite of tools designed to tackle the complexities of modern development, especially with the rise of AI-generated code.
The AI Revolution and the Testing Imperative 🤖
The way we code is changing dramatically. As Théo from the k6 team highlights, AI is now a daily tool for a staggering 80% of engineers, with 60% using it for testing. This shift, while accelerating delivery, also brings new challenges. Studies point to a shocking 1000% increase in vulnerabilities, meaning we’re shipping faster, but potentially with more blind spots and a larger blast radius when things go wrong.
“Speed shouldn’t come at the cost of confidence,” Théo emphasizes. In this new era, testing isn’t a nice-to-have; it’s your safety net. And for it to be effective, it needs to be integrated directly into your workflows, right where the code is generated.
This is precisely why k6 v2.0 treats AI as a first-class feature.
Unveiling the New k6 v2.0: Key Highlights ✨
Andrey walks us through the exciting advancements in k6 v2.0, designed to empower both human and AI developers:
1. A Revamped Assertions API 🎯
Gone are the days of workarounds for functional and browser testing. k6 v2.0 introduces a new assertions API, heavily inspired by Playwright syntax. This API brings:
- Hard and soft assertions: For precise validation.
- Async assertions: Crucial for browser testing with convenient auto-retries.
This API shifts k6 from asking “did it crash?” to “did it do exactly what I expected?” – a critical question when AI is generating your code.
2. The Enhanced Extension Catalog 🌐
k6 v1.0 introduced native extensions, reducing the need for custom builds. However, discovery and trust were areas for improvement. k6 v2.0 addresses this with an extension catalog featuring:
- Automatic dependency resolution: Simply reference a module, and it works seamlessly.
- Official Tier: Extensions built and maintained by Grafana Labs,
guaranteeing stability and security (e.g.,
xk6-faker,xk6-mqtt,xk6-sql). - Community Tier: Extensions from external developers, fostering innovation
(e.g.,
xk6-sse,xk6-kafka). Grafana Labs provides guidelines and tooling to support these maintainers.
The extension catalog is available today, so dive in and explore!
3. Subcommand Extensions: A New CLI Frontier 🛠️
Beyond JavaScript modules, k6 v2.0 introduces a completely new type of extension: subcommands. These add entirely new commands to the k6 CLI, allowing you to tailor the tool to your specific workflow.
- Easy Creation: Built as Go modules, k6 automatically picks them up.
- On-Demand Provisioning: If an extension is in the catalog, k6 downloads and runs it automatically when you use the command.
- Custom Builds: For unique needs, the familiar
x k6and custom build pathways remain.
Theo showcased three powerful AI-focused subcommand extensions:
agent: Configures your chosen AI agent (e.g., Claude Code, Codex, Cursor) with the necessary tools and configuration to create and execute testing strategies.mcp(k6 MCP Server): This server, now runnable directly from the k6 CLI, allows agents to validate, run, and verify scripts on the go without external installations.docs: Helps AI agents efficiently understand k6’s JavaScript APIs, reducing the cost and complexity of script generation.
4. Machine-Readable Outputs & Observability 📡
Tests need to evolve from local runs to production-grade infrastructure. k6 v2.0 is designed for this scaling with:
- OpenTelemetry Output: Stream test results directly into your existing observability stack (Grafana, Tempo, Mimir), providing a single pane of glass for application and test telemetry.
- Structured JSON Output: Enables integration with custom pipelines, dashboards, or for AI agents to analyze and reason about test results.
5. Automation and Scaling 📈
- New
run-k6-actionGitHub Action: Effortlessly integrate k6 into your CI/CD pipelines for automated testing on every commit, merge, PR, and deployment. - k6 Operator v1.0: This milestone release signifies stability and readiness for production. The operator allows you to run distributed k6 tests on Kubernetes, seamlessly integrating testing into your infrastructure.
The AI-Powered Demo: Testing Grafana Live! 🤯
The team then moved to a live demo, showcasing the agent command in action on
the Grafana website itself (play.grafana.org).
- Initialization: The
agentcommand, configured for Claude Code, initialized the project, bringing in essential skills likeload-test,smoke-test,test-planner, andplaywright-converter. - Test Planning: Using a pre-written prompt describing the desired testing
scenarios (changing time ranges, editing panels, verifying data updates),
the AI agent, guided by the k6 documentation and the
mcpserver, began generating tests. - AI-Driven Test Generation: The agent explored the website, identified
key requests, and leveraged the
mcpto iterate on script creation and validation. - Results: In just five minutes, the AI generated a comprehensive test
suite, including:
- A browser dashboard test (smoke and load).
- Browser tests for time range changes and panel edits.
- API load tests for data endpoints.
The generated scripts were remarkably clean and followed k6 best practices, demonstrating how AI can accelerate test suite creation from days to minutes.
Your Call to Action: Embrace the Future of Testing! ✅
k6 v2.0 is more than an update; it’s an invitation to redefine your testing strategy. As Andrey and Théo urge:
- Use the
agentcommand: Initialize your workflows in any project, big or small. - Explore the extension catalog: Discover tools that fit your stack or contribute your own.
- Integrate
run-k6-action: Make testing non-negotiable in your CI/CD. - Scale with k6-operator: Deploy k6 in production for robust, distributed testing.
May 11th, 2026, is the day. Stop guessing, and start proving with k6 v2.0! Mark your calendars and get ready to supercharge your testing.