Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release notes v0.50.0 #3646

Merged
merged 34 commits into from Mar 25, 2024
Merged
Changes from 31 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
b403bec
Add k6 v0.50.0 release notes
oleiade Jan 29, 2024
970d3c8
Add changes for the goja refactors in browser
ankur22 Jan 29, 2024
e0b0c40
Update release notes/v0.50.0.md
ankur22 Jan 30, 2024
65b6e43
Add browser#1163 to release notes
ankur22 Jan 30, 2024
ad518e1
Add browser#1205 to release notes (#3584)
inancgumus Feb 7, 2024
ac8c417
Add 1215 to release notes
ankur22 Feb 14, 2024
d13c8e3
Update release notes/v0.50.0.md
ankur22 Feb 14, 2024
434e5c7
Add screenshot upload to release notes
ankur22 Feb 14, 2024
1d6b371
Update wording for screenshot upload update
ankur22 Feb 14, 2024
e93914a
Add browser 1209 to release notes (#3604)
inancgumus Feb 16, 2024
0d6cfba
Add browser 1217 to release notes (#3603)
inancgumus Feb 16, 2024
00fdd35
Add browser 850 and Go 1.20 PRs to release notes (#3605)
inancgumus Feb 16, 2024
3e29110
Add browser 1220 and 1221 to release notes
ankur22 Feb 26, 2024
7fc5512
Add/browser 1112 to release notes (#3624)
inancgumus Mar 6, 2024
68214c6
Add better error pr for browser evaluate APIs
ankur22 Mar 11, 2024
8e9c61f
Add browser testRunId inject prs to release note
ankur22 Mar 11, 2024
6a935c3
Update the verb
ankur22 Mar 11, 2024
0bda276
Add details of browser#1238 to release notes
ankur22 Mar 11, 2024
0e9ce55
Add details of browser#1097 to release notes
ankur22 Mar 11, 2024
8a30f57
Apply suggestions from code review
ankur22 Mar 12, 2024
ecc69c9
JWK, options.cloud and some other changelogs
olegbespalov Mar 14, 2024
70ac7ef
Link webcrypto JWK import/export to PR
oleiade Mar 18, 2024
e32e5d2
Add browser#1241 to release notes
ankur22 Mar 18, 2024
59b4c59
Update the browser#1097 release notes
ankur22 Mar 18, 2024
993d55c
Add browser 986 (#3652)
inancgumus Mar 18, 2024
bccd7c8
Add k6/timers stabilization release notes
mstoykov Mar 18, 2024
28683c0
Add #3653 to release notes
joanlopez Mar 18, 2024
b537bcc
Apply suggestions from code review
oleiade Mar 20, 2024
d98c72d
Add notice for async browser API breaking change
ankur22 Mar 11, 2024
02ae6fd
Apply suggestions from code review
ankur22 Mar 11, 2024
dadab76
Add await explanation on non thenable
ankur22 Mar 19, 2024
e605df5
Add release changes top-level summary
oleiade Mar 22, 2024
68c37b0
Apply suggestions from code review
oleiade Mar 25, 2024
57304f0
Remove placeholders
oleiade Mar 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
170 changes: 170 additions & 0 deletions release notes/v0.50.0.md
@@ -0,0 +1,170 @@
k6 `v0.50.0` is here 🎉! This release includes:

- (_optional_) `<highlight of breaking changes>`
- `<Summary of new features>` (_one or multiple bullets_)
oleiade marked this conversation as resolved.
Show resolved Hide resolved


## Breaking changes

- `#pr`, `<small_break_1>`
- [websockets#60](https://github.com/grafana/xk6-websockets/pull/60) allows manually setting the `name` tag, which also overwrites the `url` tag with the `name` value. This change makes it consistent with the logic that was implemented in k6 v0.41. Thanks, @mkadirtan for contributing!

### Browser APIs to Async

In future releases, we are going to be moving most of the synchronous browser APIs to asynchronous ones (promisifying them). We expect this will affect most of our users, so we are posting this upfront before making the change. Here are the reasons for making this large breaking change:

1. Most browser APIs use some form of long-running IO operation (networking) to perform the requested action on the web browser against the website under test. We need to avoid blocking Javascript's runtime event loop for such operations.
oleiade marked this conversation as resolved.
Show resolved Hide resolved
2. We're going to add more asynchronous event-based APIs (such as [page.on](https://github.com/grafana/xk6-browser/issues/1227)) that our current synchronous APIs would block.
3. To align with how developers expect to work with JavaScript APIs.
4. To have better compatibility with Playwright.

You can find a list of all the APIs that we expect to convert to async in a comment in issue [browser#428](https://github.com/grafana/xk6-browser/issues/428#issuecomment-1964020837).

Awaiting on something that’s not a thenable just resolves to that value, which means you can add the `await` keyword against APIs that will become async to future proof your test scripts.
oleiade marked this conversation as resolved.
Show resolved Hide resolved

### (_optional h3_) `<big_breaking_change>` `#pr`
oleiade marked this conversation as resolved.
Show resolved Hide resolved

## New features

### Add support for uploading files from the browser module [browser#1097](https://github.com/grafana/xk6-browser/pull/1097), [browser#1244](https://github.com/grafana/xk6-browser/pull/1244)
heitortsergent marked this conversation as resolved.
Show resolved Hide resolved

You can now upload files using the available input forms on the website under test. The new API is `setInputFiles` which can be called from a `page`, `frame` or `elementHandle` types. It can upload one or more files encoded in the test script. To upload files from the local file system, work with the [experimental fs module](https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/fs/).

<details>
<summary>Expand to see the examples.</summary>

For the following examples, we will use the HTML file:

```html
<html>

<body>
<form method="POST" action="/upload" enctype="multipart/form-data">
<input type="file" name="upl" id="upload" multiple />
<input type="submit" value="Send" />
</form>
</body>

</html>
```

Uploading a file can be achieved with the following script:

```js
// Import the k6 encoder module.
import encoding from 'k6/encoding';
...
export default async function () {
const page = browser.newPage();

await page.goto(url)

// Encode and upload some data into a plain text file called test.txt.
page.setInputFiles('input[id="upload"]', { name: 'test.txt', mimetype: 'text/plain', buffer: encoding.b64encode('Hello World') })

// Click on the submit button on the form to upload the file.
const submitButton = page.locator('input[type="submit"]')
await Promise.all([page.waitForNavigation(), submitButton.click()])

page.close();
}
```

Uploading multiple files can be done with the use of an array:

```js
page.setInputFiles('input[id="upload"]',
[{ name: 'test.txt', mimetype: 'text/plain', buffer: encoding.b64encode('Hello World') },
{ name: 'test.json', mimetype: 'text/json', buffer: encoding.b64encode('{"message": "Hello World"}') }])
```

</details>

Thanks to @bandorko! :bow: :tada:

### Introducing options.cloud [#3348](https://github.com/grafana/k6/pull/3348), [#3407](https://github.com/grafana/k6/pull/3407)

In this release, we introduce a new way of defining cloud options. From now on, you can use `options.cloud` instead of `options.ext.loadimpact`.

To migrate, you can move the `loadimpact` object to the root of the `options` object and rename it to `cloud`. For example:

```javascript
export let options = {
ext: {
loadimpact: {
name: "Legacy way of defining cloud options",
projectID: 12345,
}
}
};

export let options = {
cloud: {
name: "Current way of defining cloud options",
projectID: 12345,
}
};
```

All scripts with legacy `options.ext.loadimpact` will continue to function as before. There's no planned sunset date for the legacy option, but we highly encourage using `options.cloud` going forward. For more details about cloud options, refer to [Cloud options](https://grafana.com/docs/grafana-cloud/k6/author-run/cloud-scripting-extras/cloud-options/).

### Timers API becomes part of the k6 core [#3587](https://github.com/grafana/k6/pull/3587)
heitortsergent marked this conversation as resolved.
Show resolved Hide resolved

With this release, the timers API is no longer experimental and can be imported as `k6/timers` instead of as `k6/experimental/timers`. The later will be supported until `v0.52.0`.

You can also contribute to the discussion on making the current timer exports globally available in [#3589](https://github.com/grafana/k6/issues/3589), or just give it a :+1:.

### JSON Web Key support in `k6/experimental/webcrypto` module [webcrypto#61](https://github.com/grafana/xk6-webcrypto/pull/61)

The experimental webcrypto module now supports the JSON Web Key (JWK) format, using the `importKey` and `exportKey` methods.

This allows you to import and export keys in the JWK format for the supported algorithms.

```js
const generatedKey = await crypto.subtle.generateKey({name: "AES-CBC", length: "256"}, true, [ "encrypt", "decrypt"]);

const exportedKey = await crypto.subtle.exportKey("jwk", generatedKey);
```

## UX improvements and enhancements

- [browser#1197](https://github.com/grafana/xk6-browser/pull/1197), [browser#1202](https://github.com/grafana/xk6-browser/pull/1202), [browser#1203](https://github.com/grafana/xk6-browser/pull/1203), [browser#1221](https://github.com/grafana/xk6-browser/pull/1221) adds the ability to upload screenshots to a remote location.
- [browser#1209](https://github.com/grafana/xk6-browser/pull/1209) adds a shadow DOM usage example.
- [browser#1233](https://github.com/grafana/xk6-browser/pull/1233) returns actionable errors for `evaluate` APIs.
- [browser#1228](https://github.com/grafana/xk6-browser/pull/1228), [browser#1232](https://github.com/grafana/xk6-browser/pull/1232), [browser#1235](https://github.com/grafana/xk6-browser/pull/1235) injects the `testRunId` into the `window.k6` object for external applications to query (for example, Grafana Faro).

### Browser Context Isolation [browser#1112](https://github.com/grafana/xk6-browser/issues/1112)

With this release, we have overhauled and (tremendously) improved the performance and stability of the browser module. It's now possible to run tests with a larger number of VUs concurrently without any performance issues. Previously, when running tests with multiple VUs concurrently, each VU's browser context would attach to the pages from the other VUs' browser contexts. This led to unexpected behavior and performance issues and, to an extent, reduced the module's capability to run multi-VU tests.

## Bug fixes

- [#3653](https://github.com/grafana/k6/pull/3653) fixes a connectivity issue with non-lowercase `options.hosts`.
- [browser#1215](https://github.com/grafana/xk6-browser/pull/1215) fixes a data race during logging that panics.
- [browser#1238](https://github.com/grafana/xk6-browser/pull/1238) fixes fill functionality for textarea. Thanks @bandorko for the fix! :bow: :tada:
- [browser#1242](https://github.com/grafana/xk6-browser/pull/1242) fixes XPath evaluation on `DocumentFragment`.

## Maintenance and internal improvements

- [browser#1164](https://github.com/grafana/xk6-browser/pull/1164), [browser#1166](https://github.com/grafana/xk6-browser/pull/1166), [browser#1171](https://github.com/grafana/xk6-browser/pull/1171),
[browser#1173](https://github.com/grafana/xk6-browser/pull/1173), [browser#1175](https://github.com/grafana/xk6-browser/pull/1175), [browser#1179](https://github.com/grafana/xk6-browser/pull/1179),
[browser#1183](https://github.com/grafana/xk6-browser/pull/1183), [browser#1186](https://github.com/grafana/xk6-browser/pull/1186), [browser#1188](https://github.com/grafana/xk6-browser/pull/1188),
[browser#1189](https://github.com/grafana/xk6-browser/pull/1189), [browser#1190](https://github.com/grafana/xk6-browser/pull/1190), [browser#1191](https://github.com/grafana/xk6-browser/pull/1191),
[browser#1193](https://github.com/grafana/xk6-browser/pull/1193), [browser#1163](https://github.com/grafana/xk6-browser/pull/1163), [browser#1205](https://github.com/grafana/xk6-browser/pull/1205),
[browser#1217](https://github.com/grafana/xk6-browser/pull/1217) refactors internals to improve stability.
- [browser#850](https://github.com/grafana/xk6-browser/pull/850), [browser#1211](https://github.com/grafana/xk6-browser/pull/1211), [browser#1212](https://github.com/grafana/xk6-browser/pull/1212),
[browser#1214](https://github.com/grafana/xk6-browser/pull/1214), [browser#1216](https://github.com/grafana/xk6-browser/pull/1216) refactors to work with errors.Join and sets the minimum Go version to 1.20.
- [browser#1220](https://github.com/grafana/xk6-browser/pull/1220) adds more logging.
- [browser#1112](https://github.com/grafana/xk6-browser/issues/1112) fixes deadlock issues when running multiple VUs, iterations, and Chrome instances.
- [browser#1246](https://github.com/grafana/xk6-browser/issues/1246) removes logging of in-flight requests when a request fails.
- [#3586](https://github.com/grafana/k6/pull/3586) fixes file traversal for the test.
- [#3588](https://github.com/grafana/k6/pull/3588) updates `codeql` GitHub action to v3.
* [webcrypto#62](https://github.com/grafana/xk6-webcrypto/pull/62) fixes display error message in the console and does minor maintenance.
* [webcrypto#60](https://github.com/grafana/xk6-webcrypto/pull/60) leverages some of the k6 APIs to handle JavaScript operations.
* [webcrypto#59](https://github.com/grafana/xk6-webcrypto/pull/59) makes `newTestSetup` rely on k6's modulestest.
* [webcrypto#58](https://github.com/grafana/xk6-webcrypto/pull/58) addresses linter issues related to repeated static strings.
* [3633](https://github.com/grafana/k6/pull/3633) updates k6 dependencies.

## _Optional_ Roadmap

_Discussion of future plans_