At k6, we pride ourselves in always putting the need of developers and testers first. Throughout the years, we've tried many different solutions to make the experience of authoring load tests as pleasant and value-creating as possible.
In the since-sunsetted LoadImpact v3, we allowed users to author tests in the lua scripting language, which, to us, was a big improvement to the earlier generation of tools, which either only allowed GUI-based test authoring, declarative configuration in XML files or writing your tests in C.
In 2017, we announced k6, a brand new next-gen load testing tool which in our opinion lowered the bar of entry even further by sporting a new, fast, JavaScript runtime backed by ever-so-performant go code.
Today, we're thrilled to announce our next exciting step, further pushing the limits of how intuitive and easy-to-use test authoring can be. As of this message, all users are invited to try out our brand-new runtime!
A couple of years ago one of our founders, Ragnar Lönn, did a nifty no-frills proof of concept called curl-basher.
Our new runtime builds upon the promising findings of that PoC, taking it one step further and giving you, the user, access to the whole powerhouse that is bash.
Getting started
So, let's have a look at how this will work in practice. During the beta-phase, you'll have to compile the k6 binary yourself using xk6:
That will produce a k6 binary in your current folder:
Once it reaches General Availability, this will become the default mode for writing k6 scripts, but for now we'll have to import the bash support function exec from k6/x/exec:
As you can tell from that snippet, it's really easy and intuitive to use. It's also blazingly fast! Let's run it and have a look at the output:
Only 8 seconds for 20 requests? Wow, that's fast! You can also see that we in our script added support for pass/fail visualisation using +'s to signal success, and - to signal fail.
Plans for the future
You tell us! We are planning to add support for other popular runtimes as well, like perl, x86-assembler and BASIC.
Imagine being able to author your tests with direct memory access! The future truly is now!
...
😂 Happy April's fools!
If you've gotten this far, we probably don't need to tell you this, but: Happy April's fools!
While the examples above indeed do work thanks to the xk6 extension system, we're staying comitted to building the k6 tool with the best developer experience and ergonomics in mind. Right now, this means sticking to the JavaScript runtime while making the tool even more solid and versatile.
Did you enjoy the article? Did we trick you? Please let us know in the comments below.
Much love,
the k6 Team