Skip to content

Commit

Permalink
add v0.36.0 release notes
Browse files Browse the repository at this point in the history
  • Loading branch information
oleiade committed Jan 18, 2022
1 parent 22a0db3 commit 57960ea
Showing 1 changed file with 129 additions and 0 deletions.
129 changes: 129 additions & 0 deletions release notes/v0.36.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
k6 v0.36.0 is here! 🎉 It introduces a couple of new features which enhance its usability, includes a number of fixes, and the result of ongoing refactoring efforts.

In total, we have closed 27 issues.

## New Features!

### Sourcemaps support ([#2082](https://github.com/grafana/k6/pull/2082))

Following [#2082](https://github.com/grafana/k6/pull/2082), k6's now has support for [Source Maps](https://developer.mozilla.org/en-US/docs/Tools/Debugger/How_to/Use_a_source_map). k6 will now try to load sourcemaps either from the filesystem(s) or from inside the script, based on the standard(-ish) `//#sourceMappingURL=` comments. Furthermore, as k6 internally uses Babel to transform ES6+ scripts to ES5.1+, it will now make use of its ability to generate sourcemaps, including combining with previously generated ones, to report correct line numbers. This should fix [#1804](https://github.com/grafana/k6/issues/1804); however, we anticipate some more issues will arise, and further tweaking will be necessary.

Thus, given an `imported.js` module such as:
```javascript
export function f1() {
throw "line 2";
}

export function f2() {
throw "line 6";
}

export function f3() {
throw "line 10";
}
```

and a k6 test script importing it as such:
```javascript
import { f2 } from "./imported.js"

export default function() {
f2();
}
```

Previous versions of k6 would report an error stacktrace indicating an invalid line number in `imported.js` (*10*):
```
ERRO[0000] line 6
at f2 (file:///some/path/imported.js:10:61(2))
at file:///some/path/sourcemap.js:4:20(4) executor=per-vu-iterations scenario=default source=stacktrace
```

Starting with `v0.36.0` and sourcemaps support, k6 would now report the exception at the correct line in `imported.js`:
```
ERRO[0000] line 6
at f2 (file:///some/path/imported.js:6:2(2))
at file:///some/path/loadtest.js:4:2(4)
at native executor=per-vu-iterations scenario=default source=stacktrace
```

### Ability to abort tests ([#2093](https://github.com/grafana/k6/pull/2093))

Thanks to the contribution of [@gernest](https://github.com/gernest), k6 now has the ability to abort a test. [#2093](https://github.com/grafana/k6/pull/2093) made the `k6/execution` expose the `test.abort()` function, which allows to immediately abort a k6 load test run with the exit code `108`. Note that aborting a test is also fully supported in k6 cloud, preserving the same user-experience for both local and cloud users.

Aborting is possible during initialization:
```javascript
import exec from "k6/execution";
exec.test.abort();
```

As well as inside the default function:
```javascript
import exec from "k6/execution";

export default function() {
// Note that you can abort with a specific message too
exec.test.abort("this is the reason");
}

export function teardown() {
console.log("teardown will still be called after test.abort()");
}
```

Or during the VU initialization:
```javascript
import exec from "k6/execution";

// This won't fail on initial parsing of the script, but on VU initialization.
if (__VU == 1) {
exec.test.abort();
}

export default function() {}
```

### k6 inspect extended output ([#2279](https://github.com/grafana/k6/pull/2279))

Following [#2279](https://github.com/grafana/k6/pull/2279), the `k6 inspect` command now supports an `--execution-requirements` flag. When used, the command's output will include fields related to the execution requirements, by deriving k6's configuration from the execution context, and including the `maxVUs` and `totalDuration` fields to the output.


### Forcing HTTP/1 protocol ([#2222](https://github.com/grafana/k6/pull/2222))

Thanks to the work of [@sjordhani22](https://github.com/sjordhani22), [#2222](https://github.com/grafana/k6/pull/2222) made it possible to force k6 to use version 1.1 of the protocol when firing HTTP requests.

It can be done by setting the `http2client=0` value in the `GODEBUG` environment variable:

```
GODEBUG=http2client=0 k6 run testscript.js
```

**Nota Bene**: the usage of the `GODEBUG` variable is considered temporary, and expected to change in the future. If you start using this feature, keep an eye out for potential future changes.

## Breaking changes

### Restricting file opening to init context

Opening files is now restricted to the init context of the VU that's initialized to get the options from the script. While it was somewhat possible, yet [unreliably](https://github.com/grafana/k6/issues/1771), to open files during other stages of the test in the past: [#2314](https://github.com/grafana/k6/pull/2314) ensures that k6 would now throw an error in a similar scenario.

The following statement, unless the `arr.json` file is opened somewhere else, will now throw an error:
```javascript
if (__VU >0) {
JSON.parse(open("./arr.json"));
}
```

## Bugs Fixed!


* We addressed an issue uncovered by [our community](https://community.k6.io/t/v0-35-0-grpc-server-reflection-error/2383), which kept our users from using GRPC with multiple services definition in a single *proto* file. This issue was solved in [#2265](https://github.com/grafana/k6/pull/2265).
* Thanks to the contribution of [@Resousse](https://github.com/Resousse), we've now updated k6's [`go-ntlmssp`](https://github.com/Azure/go-ntlmssp) dependency. The updating PR [#2290](https://github.com/grafana/k6/pull/2290) indeed fixes issues with NTLM Authentication backends returning two authorization headers.

## Maintenance

- `v0.36.0` marks the switch to a new JS module's internal API. Most of our official JS modules have now been ported to this new version, which should make the process of developing modules easier and more streamlined in the future. See for more details: [#2243](https://github.com/grafana/k6/pull/2243), [#2241](https://github.com/grafana/k6/pull/2241), [#2239](https://github.com/grafana/k6/pull/2239), [#2242](https://github.com/grafana/k6/pull/2242), [#2226](https://github.com/grafana/k6/pull/2226), and [#2232](https://github.com/grafana/k6/pull/2232).
- We have refactored our implementation of the RampingVU executor, for better clarity and maintainability. See [#2155](https://github.com/grafana/k6/pull/2155).
- [#2316](https://github.com/grafana/k6/pull/2316) relaxed quite a few of the code linting rules we applied to k6's code.
- [#2304](https://github.com/grafana/k6/pull/2304) prepared the removal external of dependencies from k6's JSONAPI compliant Rest API, and deprecated the `api.v1`'s `client.Call` method in favor of its newer `client.CallAPI` counterpart. It allows us to both reduce our reliance on external dependencies and improve its maintainability.
- We have updated our Goja dependency, our JS interpreter, to its latest available version. We are, unfortunately, not ready to integrate some of the new features it supports just yet. Namely, Goja now supports the [optional chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining) syntax, but the Babel version we use at the moment does not. See [#2317](https://github.com/grafana/k6/pull/2317) and [#2238](https://github.com/grafana/k6/pull/2238)
- [#2312](https://github.com/grafana/k6/pull/2312) upgraded `loadimpact/k6` docker image base to Alpine *3.15*.

0 comments on commit 57960ea

Please sign in to comment.