From 99bb3aaaadb69978cfebf25e8b7f4353507fe578 Mon Sep 17 00:00:00 2001 From: Oleg Bespalov Date: Wed, 21 Aug 2024 07:25:07 +0200 Subject: [PATCH 01/41] v0.54.0 release notes from template --- release notes/v0.54.0.md | 47 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 release notes/v0.54.0.md diff --git a/release notes/v0.54.0.md b/release notes/v0.54.0.md new file mode 100644 index 00000000000..7802a5f986c --- /dev/null +++ b/release notes/v0.54.0.md @@ -0,0 +1,47 @@ +k6 `v0.54.0` is here ๐ŸŽ‰! This release includes: + +- (_optional_) `` +- `` (_one or multiple bullets_) + + +## Breaking changes + +- `#pr`, `` +- `#pr`, `` + +### (_optional h3_) `` `#pr` + +## New features + +_optional intro here_ + +### `` `#pr` + +_what, why, and what this means for the user_ + +### `` `#pr` + +_what, why, and what this means for the user_ + +## UX improvements and enhancements + +_Format as ` . `_: + +- _`#999` Gives terminal output prettier printing. Thanks to `@person` for the help!_ +- `#pr` `` +- `#pr` `` + +## Bug fixes + +_Format as ` . `_: +- _`#111` fixes race condition in runtime_ + +## Maintenance and internal improvements + +_Format as ` . `_: +- _`#2770` Refactors parts of the JS module._ + +## _Optional_ Roadmap + +_Discussion of future plans_ + From 8b296044d6538a824af3d21faf955aa209442270 Mon Sep 17 00:00:00 2001 From: ankur22 Date: Wed, 21 Aug 2024 09:46:20 +0100 Subject: [PATCH 02/41] Add browser#1406 to v0.54.0 release notes --- release notes/v0.54.0.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/release notes/v0.54.0.md b/release notes/v0.54.0.md index 7802a5f986c..2ace466fd6a 100644 --- a/release notes/v0.54.0.md +++ b/release notes/v0.54.0.md @@ -33,8 +33,7 @@ _Format as ` . `_: ## Bug fixes -_Format as ` . `_: -- _`#111` fixes race condition in runtime_ +- [browser#1406](https://github.com/grafana/xk6-browser/pull/1406) Fix panic on iframe attach when iframe didn't contain any UI elements. ## Maintenance and internal improvements From 10b57a8fb83d9d0daa5396b725a672e324b22b87 Mon Sep 17 00:00:00 2001 From: oleiade Date: Thu, 12 Sep 2024 15:56:55 +0200 Subject: [PATCH 03/41] Add release notes for experimental csv module --- release notes/v0.54.0.md | 89 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 85 insertions(+), 4 deletions(-) diff --git a/release notes/v0.54.0.md b/release notes/v0.54.0.md index 2ace466fd6a..2d795b8d766 100644 --- a/release notes/v0.54.0.md +++ b/release notes/v0.54.0.md @@ -13,11 +13,92 @@ k6 `v0.54.0` is here ๐ŸŽ‰! This release includes: ## New features -_optional intro here_ +### New experimental CSV module for efficient CSV data handling [`#3743`](https://github.com/grafana/k6/pull/3743) + +Weโ€™ve added a new experimental csv module to k6 for more efficient and convenient CSV parsing and streaming, addressing the limitations of preexisting JavaScript-based solutions like [papaparse](https://www.papaparse.com/). + +#### What is it? + +The csv module offers two key features: +* `csv.parse()` **Function**: Parses an entire CSV file at once into a [SharedArray](https://grafana.com/docs/k6/latest/javascript-api/k6-data/sharedarray/), using Go-based processing to using Go-based processing for faster parsing and lower memory usage compared to JavaScript alternatives. +* `csv.Parser` **Class**: Provides a streaming parser to read CSV files line-by-line, minimizing memory consumption and offering more control over parsing through a stream-like API. This is ideal for scenarios where memory optimization or fine-grained control of the parsing process is crucial. + +#### Benefits for Users + +* **Faster Parsing**: `csv.parse` bypasses most of the JavaScript runtime, offering significant speed improvements for large files. +* **Lower Memory Usage**: both solution support shared memory across virtual users (VUs) with the `fs.open` function. +* **Flexibility**: choose between full-file parsing with csv.parse() or memory-efficient streaming with csv.Parser. + +#### Tradeoffs + +* **`csv.Parse`**: Parses the entire file in the initialization phase of the test, which can increase startup time and memory usage for large files. Best suited for scenarios where performance is prioritized over memory consumption. +* **`csv.Parser`**: Reads the file line-by-line, making it more memory-efficient but potentially slower due to reading overhead for each line. Ideal for scenarios where memory usage is a concern or where fine-grained control over parsing is needed. + +#### Example Usage + +**Parsing a full CSV file into a [SharedArray](https://grafana.com/docs/k6/latest/javascript-api/k6-data/sharedarray/):** +```javascript +import { open } from 'k6/experimental/fs' +import csv from 'k6/experimental/csv' +import { scenario } from 'k6/execution' + +export const options = { + iterations: 10, +} + +let file; +let csvRecords; +(async function () { + file = await open('data.csv'); + + // The `csv.parse` function consumes the entire file at once, and returns + // the parsed records as a SharedArray object. + csvRecords = await csv.parse(file, {delimiter: ','}) +})(); + + +export default async function() { + // The csvRecords a SharedArray. Each element is a record from the CSV file, represented as an array + // where each element is a field from the CSV record. + // + // Thus, `csvRecords[scenario.iterationInTest]` will give us the record for the current iteration. + console.log(csvRecords[scenario.iterationInTest]) +} +``` + +**To stream a CSV file line-by-line:** +```javascript +import { open } from 'k6/experimental/fs' +import csv from 'k6/experimental/csv' + +export const options = { + iterations: 10, +} + +let file; +let parser; +(async function () { + file = await open('data.csv'); + parser = new csv.Parser(file); +})(); + +export default async function() { + // The parser `next` method attempts to read the next row from the CSV file. + // + // It returns an iterator-like object with a `done` property that indicates whether + // there are more rows to read, and a `value` property that contains the row fields + // as an array. + const {done, value} = await parser.next(); + if (done) { + throw new Error("No more rows to read"); + } + + // We expect the `value` property to be an array of strings, where each string is a field + // from the CSV record. + console.log(done, value); +} +``` -### `` `#pr` - -_what, why, and what this means for the user_ ### `` `#pr` From ec5a8548a8337893028a10c33b1a1407f129b0c3 Mon Sep 17 00:00:00 2001 From: Oleg Bespalov Date: Thu, 12 Sep 2024 17:21:03 +0200 Subject: [PATCH 04/41] Oleg's changelog --- release notes/v0.54.0.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/release notes/v0.54.0.md b/release notes/v0.54.0.md index 2d795b8d766..63b98d1c0c6 100644 --- a/release notes/v0.54.0.md +++ b/release notes/v0.54.0.md @@ -118,8 +118,12 @@ _Format as ` . `_: ## Maintenance and internal improvements -_Format as ` . `_: -- _`#2770` Refactors parts of the JS module._ +- [#3903](https://github.com/grafana/k6/pull/3903), [#3912](https://github.com/grafana/k6/pull/3912), [#3913](https://github.com/grafana/k6/pull/3913), [#3928](https://github.com/grafana/k6/pull/3928) update dependencies. +- [#3915](https://github.com/grafana/k6/pull/3915) switches to the go1.21, introduce toolchain to go.mod. +- [#3938](https://github.com/grafana/k6/pull/3938) updates k6's CI workflows to go 1.23. +- [#3939](https://github.com/grafana/k6/pull/3939) updates Dockerfile to use go 1.23 and alpine 3.20. +- [#3926](https://github.com/grafana/k6/pull/3926) documents maintenance of tc39 tests. +- [#3881](https://github.com/grafana/k6/pull/3881) adds top-level roadmap link. ## _Optional_ Roadmap From a85e5a0374669658420879d0ce206953f1752261 Mon Sep 17 00:00:00 2001 From: Oleg Bespalov Date: Thu, 12 Sep 2024 17:33:50 +0200 Subject: [PATCH 05/41] External contributors' changelog --- release notes/v0.54.0.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/release notes/v0.54.0.md b/release notes/v0.54.0.md index 63b98d1c0c6..934e2b958cb 100644 --- a/release notes/v0.54.0.md +++ b/release notes/v0.54.0.md @@ -106,11 +106,8 @@ _what, why, and what this means for the user_ ## UX improvements and enhancements -_Format as ` . `_: - -- _`#999` Gives terminal output prettier printing. Thanks to `@person` for the help!_ -- `#pr` `` -- `#pr` `` +- [#3877](https://github.com/grafana/k6/pull/3877), [#3820](https://github.com/grafana/k6/pull/3820) add `discardResponseMessage` option for gRPC module. Thank you, @lzakharov! +- [#3898](https://github.com/grafana/k6/pull/3898) adds `SetupTimeout` option validation. Thank you, @tsukasaI! ## Bug fixes @@ -118,12 +115,14 @@ _Format as ` . `_: ## Maintenance and internal improvements -- [#3903](https://github.com/grafana/k6/pull/3903), [#3912](https://github.com/grafana/k6/pull/3912), [#3913](https://github.com/grafana/k6/pull/3913), [#3928](https://github.com/grafana/k6/pull/3928) update dependencies. +- [#3871](https://github.com/grafana/k6/pull/3871) allows missing file descriptors for gRPC reflection. Thank you, @Lordnibbler! - [#3915](https://github.com/grafana/k6/pull/3915) switches to the go1.21, introduce toolchain to go.mod. - [#3938](https://github.com/grafana/k6/pull/3938) updates k6's CI workflows to go 1.23. - [#3939](https://github.com/grafana/k6/pull/3939) updates Dockerfile to use go 1.23 and alpine 3.20. +- [#3909](https://github.com/grafana/k6/pull/3909) fixes `ExitCode` description typo. Thank you, @eltociear! - [#3926](https://github.com/grafana/k6/pull/3926) documents maintenance of tc39 tests. - [#3881](https://github.com/grafana/k6/pull/3881) adds top-level roadmap link. +- [#3903](https://github.com/grafana/k6/pull/3903), [#3912](https://github.com/grafana/k6/pull/3912), [#3913](https://github.com/grafana/k6/pull/3913), [#3928](https://github.com/grafana/k6/pull/3928) update dependencies. ## _Optional_ Roadmap From b42d1b18c4cf4eb8f1a801af1e392a8fa2f64a62 Mon Sep 17 00:00:00 2001 From: Oleg Bespalov Date: Thu, 12 Sep 2024 17:46:35 +0200 Subject: [PATCH 06/41] Minor alignments of release notes --- release notes/v0.54.0.md | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/release notes/v0.54.0.md b/release notes/v0.54.0.md index 934e2b958cb..c33220ae451 100644 --- a/release notes/v0.54.0.md +++ b/release notes/v0.54.0.md @@ -20,6 +20,7 @@ Weโ€™ve added a new experimental csv module to k6 for more efficient and conveni #### What is it? The csv module offers two key features: + * `csv.parse()` **Function**: Parses an entire CSV file at once into a [SharedArray](https://grafana.com/docs/k6/latest/javascript-api/k6-data/sharedarray/), using Go-based processing to using Go-based processing for faster parsing and lower memory usage compared to JavaScript alternatives. * `csv.Parser` **Class**: Provides a streaming parser to read CSV files line-by-line, minimizing memory consumption and offering more control over parsing through a stream-like API. This is ideal for scenarios where memory optimization or fine-grained control of the parsing process is crucial. @@ -36,7 +37,9 @@ The csv module offers two key features: #### Example Usage -**Parsing a full CSV file into a [SharedArray](https://grafana.com/docs/k6/latest/javascript-api/k6-data/sharedarray/):** +
+ Expand to see an example of Parsing a full CSV file into a SharedArray. + ```javascript import { open } from 'k6/experimental/fs' import csv from 'k6/experimental/csv' @@ -66,7 +69,11 @@ export default async function() { } ``` -**To stream a CSV file line-by-line:** +
+ +
+ Expand to see an example of streaming a CSV file line-by-line. + ```javascript import { open } from 'k6/experimental/fs' import csv from 'k6/experimental/csv' @@ -99,6 +106,7 @@ export default async function() { } ``` +
### `` `#pr` @@ -111,12 +119,12 @@ _what, why, and what this means for the user_ ## Bug fixes -- [browser#1406](https://github.com/grafana/xk6-browser/pull/1406) Fix panic on iframe attach when iframe didn't contain any UI elements. +- [browser#1406](https://github.com/grafana/xk6-browser/pull/1406) fixes panic on iframe attach when iframe didn't contain any UI elements. ## Maintenance and internal improvements - [#3871](https://github.com/grafana/k6/pull/3871) allows missing file descriptors for gRPC reflection. Thank you, @Lordnibbler! -- [#3915](https://github.com/grafana/k6/pull/3915) switches to the go1.21, introduce toolchain to go.mod. +- [#3915](https://github.com/grafana/k6/pull/3915) switches `go.mod` to the go1.21, introduces toolchain. - [#3938](https://github.com/grafana/k6/pull/3938) updates k6's CI workflows to go 1.23. - [#3939](https://github.com/grafana/k6/pull/3939) updates Dockerfile to use go 1.23 and alpine 3.20. - [#3909](https://github.com/grafana/k6/pull/3909) fixes `ExitCode` description typo. Thank you, @eltociear! From a52892eef86775ef55cd506e7f6c9f61618d20bf Mon Sep 17 00:00:00 2001 From: ankur22 Date: Fri, 13 Sep 2024 09:58:32 +0100 Subject: [PATCH 07/41] Add browser#1420 & browser#1421 to release notes --- release notes/v0.54.0.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/release notes/v0.54.0.md b/release notes/v0.54.0.md index c33220ae451..342424dd6a7 100644 --- a/release notes/v0.54.0.md +++ b/release notes/v0.54.0.md @@ -120,6 +120,8 @@ _what, why, and what this means for the user_ ## Bug fixes - [browser#1406](https://github.com/grafana/xk6-browser/pull/1406) fixes panic on iframe attach when iframe didn't contain any UI elements. +- [browser#1420](https://github.com/grafana/xk6-browser/pull/1420) uses the vu context to control the iterations lifecycle which helps k6 shutdown in a timely manner when a test is aborted. +- [browser#1421](https://github.com/grafana/xk6-browser/pull/1421) fixes the navigation span by starting when the page starts to load so that it's a better representation of how long the test was on a page. ## Maintenance and internal improvements From b3bce17e0b5c91879d446aec6b7e29c4c11f3bbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joan=20L=C3=B3pez=20de=20la=20Franca=20Beltran?= Date: Fri, 13 Sep 2024 11:44:40 +0200 Subject: [PATCH 08/41] Joan's changelog --- release notes/v0.54.0.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/release notes/v0.54.0.md b/release notes/v0.54.0.md index c33220ae451..0b138142cea 100644 --- a/release notes/v0.54.0.md +++ b/release notes/v0.54.0.md @@ -108,6 +108,12 @@ export default async function() { +### New `k6 cloud upload` command for uploading test files to the cloud [`#3906`](https://github.com/grafana/k6/pull/3906) + +Although we continue to refine and improve the cloud service to handle better the uploading of test files, +as well as the overall user experience, we've added a new `k6 cloud upload` command that replaces the +`k6 cloud --upload-only` flag used so far, which is now considered deprecated. + ### `` `#pr` _what, why, and what this means for the user_ @@ -116,10 +122,15 @@ _what, why, and what this means for the user_ - [#3877](https://github.com/grafana/k6/pull/3877), [#3820](https://github.com/grafana/k6/pull/3820) add `discardResponseMessage` option for gRPC module. Thank you, @lzakharov! - [#3898](https://github.com/grafana/k6/pull/3898) adds `SetupTimeout` option validation. Thank you, @tsukasaI! +- [#3930](https://github.com/grafana/k6/pull/3930) adds token validation for `k6 cloud login`, so now you get immediate feedback right after logging in. +- [#3925](https://github.com/grafana/k6/pull/3925) updates Sobek to have support for numeric literal separators (e.g. `1_000_000`). +- [#3876](https://github.com/grafana/k6/pull/3876), [#3923](https://github.com/grafana/k6/pull/3923) adjusts the process' exit code for cloud test runs where thresholds have failed. +- [#3765](https://github.com/grafana/k6/pull/3765) stops using the confusing `โœ“` and `โœ—` for `Rate` metrics, and instead uses the form: `{x} out of {y}`. ## Bug fixes - [browser#1406](https://github.com/grafana/xk6-browser/pull/1406) fixes panic on iframe attach when iframe didn't contain any UI elements. +- [#3947](https://github.com/grafana/k6/pull/3947) fixes panic when `options` is `nil` (e.g. exported from a module where it isn't really exported). ## Maintenance and internal improvements @@ -131,6 +142,8 @@ _what, why, and what this means for the user_ - [#3926](https://github.com/grafana/k6/pull/3926) documents maintenance of tc39 tests. - [#3881](https://github.com/grafana/k6/pull/3881) adds top-level roadmap link. - [#3903](https://github.com/grafana/k6/pull/3903), [#3912](https://github.com/grafana/k6/pull/3912), [#3913](https://github.com/grafana/k6/pull/3913), [#3928](https://github.com/grafana/k6/pull/3928) update dependencies. +- [#3945](https://github.com/grafana/k6/pull/3945) updates the endpoint where [usage reports](https://grafana.com/docs/k6/latest/set-up/usage-collection/) are sent to. +- [#3922](https://github.com/grafana/k6/pull/3922) replaces custom `min`, `max` and similar functions available in stdlib since Go v1.21. ## _Optional_ Roadmap From cd79b78c51089a676c38e9c77bf49904fa618972 Mon Sep 17 00:00:00 2001 From: Oleg Bespalov Date: Fri, 13 Sep 2024 14:24:35 +0200 Subject: [PATCH 09/41] Breaking changes, minor adjustments --- release notes/v0.54.0.md | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/release notes/v0.54.0.md b/release notes/v0.54.0.md index 4e9f369e248..f87ac25dfa3 100644 --- a/release notes/v0.54.0.md +++ b/release notes/v0.54.0.md @@ -1,13 +1,12 @@ k6 `v0.54.0` is here ๐ŸŽ‰! This release includes: -- (_optional_) `` -- `` (_one or multiple bullets_) - +- A new experimental CSV module +- new ECMAScript features ## Breaking changes -- `#pr`, `` -- `#pr`, `` +- [#3913](https://github.com/grafana/k6/pull/3913) changes mapping of the Golang's `math/big.Int` type to `bigint` type in k6. +- [#3922](https://github.com/grafana/k6/pull/3922) removes `lib.Min` and `lib.Max` from k6's Go API, which could affect custom extensions that rely on these functions. ### (_optional h3_) `` `#pr` @@ -114,24 +113,38 @@ Although we continue to refine and improve the cloud service to handle better th as well as the overall user experience, we've added a new `k6 cloud upload` command that replaces the `k6 cloud --upload-only` flag used so far, which is now considered deprecated. -### `` `#pr` +### Sobek updates brings support of new ECMAScript features into k6 [`#3925`](https://github.com/grafana/k6/pull/3925), [`#3913`](https://github.com/grafana/k6/pull/3913) + +With this release, we've updated [Sobek](https://github.com/grafana/sobek) (the `ECMAScript` implementation in Go) which contains the new ECMAScript features that are now available in k6. + +This includes support for numeric literal separators, like: + +```javascript +const billion = 1_000_000_000 +``` + +And also support for `BigInt`, the values which are too large to be represented by the number primitive. + +```javascript +const huge = BigInt(9007199254740991); +``` -_what, why, and what this means for the user_ +Note: that prior k6 version v0.54, Golang's type `math/big.Int` mapped to another type, so it might be a breaking change for some extensions or users. ## UX improvements and enhancements - [#3877](https://github.com/grafana/k6/pull/3877), [#3820](https://github.com/grafana/k6/pull/3820) add `discardResponseMessage` option for gRPC module. Thank you, @lzakharov! - [#3898](https://github.com/grafana/k6/pull/3898) adds `SetupTimeout` option validation. Thank you, @tsukasaI! - [#3930](https://github.com/grafana/k6/pull/3930) adds token validation for `k6 cloud login`, so now you get immediate feedback right after logging in. -- [#3925](https://github.com/grafana/k6/pull/3925) updates Sobek to have support for numeric literal separators (e.g. `1_000_000`). - [#3876](https://github.com/grafana/k6/pull/3876), [#3923](https://github.com/grafana/k6/pull/3923) adjusts the process' exit code for cloud test runs where thresholds have failed. - [#3765](https://github.com/grafana/k6/pull/3765) stops using the confusing `โœ“` and `โœ—` for `Rate` metrics, and instead uses the form: `{x} out of {y}`. +- [#3801](https://github.com/grafana/k6/pull/3801) adds a new argument `meta` to gRPC's stream callback, which handles the timestamp of the original event (e.g. when message has been received). Thank you, @cchamplin! ## Bug fixes - [#3947](https://github.com/grafana/k6/pull/3947) fixes panic when `options` is `nil` (e.g. exported from a module where it isn't really exported). - [browser#1406](https://github.com/grafana/xk6-browser/pull/1406) fixes panic on iframe attach when iframe didn't contain any UI elements. -- [browser#1420](https://github.com/grafana/xk6-browser/pull/1420) uses the vu context to control the iterations lifecycle which helps k6 shutdown in a timely manner when a test is aborted. +- [browser#1420](https://github.com/grafana/xk6-browser/pull/1420) uses the VU context to control the iterations lifecycle which helps k6 shutdown in a timely manner when a test is aborted. - [browser#1421](https://github.com/grafana/xk6-browser/pull/1421) fixes the navigation span by starting when the page starts to load so that it's a better representation of how long the test was on a page. ## Maintenance and internal improvements @@ -143,9 +156,8 @@ _what, why, and what this means for the user_ - [#3909](https://github.com/grafana/k6/pull/3909) fixes `ExitCode` description typo. Thank you, @eltociear! - [#3926](https://github.com/grafana/k6/pull/3926) documents maintenance of tc39 tests. - [#3881](https://github.com/grafana/k6/pull/3881) adds top-level roadmap link. -- [#3903](https://github.com/grafana/k6/pull/3903), [#3912](https://github.com/grafana/k6/pull/3912), [#3913](https://github.com/grafana/k6/pull/3913), [#3928](https://github.com/grafana/k6/pull/3928) update dependencies. - [#3945](https://github.com/grafana/k6/pull/3945) updates the endpoint where [usage reports](https://grafana.com/docs/k6/latest/set-up/usage-collection/) are sent to. -- [#3922](https://github.com/grafana/k6/pull/3922) replaces custom `min`, `max` and similar functions available in stdlib since Go v1.21. +- [#3903](https://github.com/grafana/k6/pull/3903), [#3912](https://github.com/grafana/k6/pull/3912), [#3928](https://github.com/grafana/k6/pull/3928) update dependencies. ## _Optional_ Roadmap From 8da0ce8542e4cae938712356b25d2d2d9870d218 Mon Sep 17 00:00:00 2001 From: Oleg Bespalov Date: Fri, 13 Sep 2024 15:00:59 +0200 Subject: [PATCH 10/41] Extract gRPC updates under the feature --- release notes/v0.54.0.md | 37 ++++++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/release notes/v0.54.0.md b/release notes/v0.54.0.md index f87ac25dfa3..73239fd7b3d 100644 --- a/release notes/v0.54.0.md +++ b/release notes/v0.54.0.md @@ -113,6 +113,40 @@ Although we continue to refine and improve the cloud service to handle better th as well as the overall user experience, we've added a new `k6 cloud upload` command that replaces the `k6 cloud --upload-only` flag used so far, which is now considered deprecated. +### gRPC module updates driven by contributors + +#### New `discardResponseMessage` option + +[#3877](https://github.com/grafana/k6/pull/3877) and [#3820](https://github.com/grafana/k6/pull/3820) add a new option for gRPC module `discardResponseMessage` which allows users to discard the messages received from the server. + +```javascript +const resp = client.invoke('main.RouteGuide/GetFeature', req, {discardResponseMessage: true}); +``` + +This reduces the amount of memory required, and the amount of garbage collection, which reduces the load on the testing machine and can help produce more reliable test results. + +Thank you, @lzakharov! + +#### New argument `meta` for gRPC's stream callbacks + +[#3801](https://github.com/grafana/k6/pull/3801) adds a new argument `meta` to gRPC's stream callback, which handles the timestamp of the original event (e.g. when message has been received). + +```javascript +let stream = new grpc.Stream(client, "main.FeatureExplorer/ListFeatures") +stream.on('data', function (data, meta) { + // will print the timestamp when message has been received + call(meta.ts); +}); +``` + +Thank you, @cchamplin! + +#### Allow missing file descriptors for gRPC reflection + +[#3871](https://github.com/grafana/k6/pull/3871) allows missing file descriptors for gRPC reflection. + +Thank you, @Lordnibbler! + ### Sobek updates brings support of new ECMAScript features into k6 [`#3925`](https://github.com/grafana/k6/pull/3925), [`#3913`](https://github.com/grafana/k6/pull/3913) With this release, we've updated [Sobek](https://github.com/grafana/sobek) (the `ECMAScript` implementation in Go) which contains the new ECMAScript features that are now available in k6. @@ -133,12 +167,10 @@ Note: that prior k6 version v0.54, Golang's type `math/big.Int` mapped to anothe ## UX improvements and enhancements -- [#3877](https://github.com/grafana/k6/pull/3877), [#3820](https://github.com/grafana/k6/pull/3820) add `discardResponseMessage` option for gRPC module. Thank you, @lzakharov! - [#3898](https://github.com/grafana/k6/pull/3898) adds `SetupTimeout` option validation. Thank you, @tsukasaI! - [#3930](https://github.com/grafana/k6/pull/3930) adds token validation for `k6 cloud login`, so now you get immediate feedback right after logging in. - [#3876](https://github.com/grafana/k6/pull/3876), [#3923](https://github.com/grafana/k6/pull/3923) adjusts the process' exit code for cloud test runs where thresholds have failed. - [#3765](https://github.com/grafana/k6/pull/3765) stops using the confusing `โœ“` and `โœ—` for `Rate` metrics, and instead uses the form: `{x} out of {y}`. -- [#3801](https://github.com/grafana/k6/pull/3801) adds a new argument `meta` to gRPC's stream callback, which handles the timestamp of the original event (e.g. when message has been received). Thank you, @cchamplin! ## Bug fixes @@ -149,7 +181,6 @@ Note: that prior k6 version v0.54, Golang's type `math/big.Int` mapped to anothe ## Maintenance and internal improvements -- [#3871](https://github.com/grafana/k6/pull/3871) allows missing file descriptors for gRPC reflection. Thank you, @Lordnibbler! - [#3915](https://github.com/grafana/k6/pull/3915) switches `go.mod` to the go1.21, introduces toolchain. - [#3938](https://github.com/grafana/k6/pull/3938) updates k6's CI workflows to go 1.23. - [#3939](https://github.com/grafana/k6/pull/3939) updates Dockerfile to use go 1.23 and alpine 3.20. From befe03c886db2f681f0f12040dd3d3f7f1d82eb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0nan=C3=A7=20G=C3=BCm=C3=BC=C5=9F?= Date: Fri, 13 Sep 2024 16:36:52 -0400 Subject: [PATCH 11/41] Add setChecked to release notes --- release notes/v0.54.0.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/release notes/v0.54.0.md b/release notes/v0.54.0.md index 73239fd7b3d..8576d27279a 100644 --- a/release notes/v0.54.0.md +++ b/release notes/v0.54.0.md @@ -165,6 +165,17 @@ const huge = BigInt(9007199254740991); Note: that prior k6 version v0.54, Golang's type `math/big.Int` mapped to another type, so it might be a breaking change for some extensions or users. +### New `setChecked` method for the browser module [`#3914`](https://github.com/grafana/xk6-browser/pull/1403) + +Previously, users could check or uncheck checkbox and radio button elements using the [`check`](https://grafana.com/docs/k6/latest/javascript-api/k6-browser/page/check/) and [`uncheck`](https://grafana.com/docs/k6/latest/javascript-api/k6-browser/page/uncheck/) methods. Now, we've added a `setChecked` method that allows users to set either the checked or unchecked state of a checkbox or radio button with a single method and a boolean argument. + +```javascript +await page.setChecked('#checkbox', true); // check the checkbox +await page.setChecked('#checkbox', false); // uncheck the checkbox +``` + +[Page](https://grafana.com/docs/k6/next/javascript-api/k6-browser/page/setchecked/), [Frame](https://grafana.com/docs/k6/next/javascript-api/k6-browser/frame/), [ElementHandle](https://grafana.com/docs/k6/next/javascript-api/k6-browser/elementhandle/), and [Locator](https://grafana.com/docs/k6/next/javascript-api/k6-browser/locator/) now support the new `setChecked` method. + ## UX improvements and enhancements - [#3898](https://github.com/grafana/k6/pull/3898) adds `SetupTimeout` option validation. Thank you, @tsukasaI! From dfe6c0f90d69aff2519156d0d1ed66c8d8e22899 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0nan=C3=A7=20G=C3=BCm=C3=BC=C5=9F?= Date: Fri, 13 Sep 2024 16:38:47 -0400 Subject: [PATCH 12/41] Add file upload protocol to release notes --- release notes/v0.54.0.md | 1 + 1 file changed, 1 insertion(+) diff --git a/release notes/v0.54.0.md b/release notes/v0.54.0.md index 8576d27279a..d27f3cc49af 100644 --- a/release notes/v0.54.0.md +++ b/release notes/v0.54.0.md @@ -200,6 +200,7 @@ await page.setChecked('#checkbox', false); // uncheck the checkbox - [#3881](https://github.com/grafana/k6/pull/3881) adds top-level roadmap link. - [#3945](https://github.com/grafana/k6/pull/3945) updates the endpoint where [usage reports](https://grafana.com/docs/k6/latest/set-up/usage-collection/) are sent to. - [#3903](https://github.com/grafana/k6/pull/3903), [#3912](https://github.com/grafana/k6/pull/3912), [#3928](https://github.com/grafana/k6/pull/3928) update dependencies. +- [browser#1419](https://github.com/grafana/xk6-browser/pull/1419), [browser#1423](https://github.com/grafana/xk6-browser/pull/1423) adds a new remote file upload protocol. ## _Optional_ Roadmap From a42b2ff1199542b24ba9521d79e9e90d3f41484f Mon Sep 17 00:00:00 2001 From: ankur22 Date: Fri, 13 Sep 2024 10:59:50 +0100 Subject: [PATCH 13/41] Add browser#1408 & #1422 to release notes --- release notes/v0.54.0.md | 1 + 1 file changed, 1 insertion(+) diff --git a/release notes/v0.54.0.md b/release notes/v0.54.0.md index d27f3cc49af..12142819352 100644 --- a/release notes/v0.54.0.md +++ b/release notes/v0.54.0.md @@ -189,6 +189,7 @@ await page.setChecked('#checkbox', false); // uncheck the checkbox - [browser#1406](https://github.com/grafana/xk6-browser/pull/1406) fixes panic on iframe attach when iframe didn't contain any UI elements. - [browser#1420](https://github.com/grafana/xk6-browser/pull/1420) uses the VU context to control the iterations lifecycle which helps k6 shutdown in a timely manner when a test is aborted. - [browser#1421](https://github.com/grafana/xk6-browser/pull/1421) fixes the navigation span by starting when the page starts to load so that it's a better representation of how long the test was on a page. +- [browser#1408](https://github.com/grafana/xk6-browser/pull/1408), [#1422](https://github.com/grafana/xk6-browser/pull/1422) fixes the `page.reload` API so handles `null` responses without exceptions. ## Maintenance and internal improvements From f13b796d7c303b01f7608378efd47d055a30a32a Mon Sep 17 00:00:00 2001 From: Mihail Stoykov Date: Tue, 17 Sep 2024 12:03:15 +0300 Subject: [PATCH 14/41] mstoykov: most of my release notes changes --- release notes/v0.54.0.md | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/release notes/v0.54.0.md b/release notes/v0.54.0.md index 12142819352..0b93ea44255 100644 --- a/release notes/v0.54.0.md +++ b/release notes/v0.54.0.md @@ -7,6 +7,7 @@ k6 `v0.54.0` is here ๐ŸŽ‰! This release includes: - [#3913](https://github.com/grafana/k6/pull/3913) changes mapping of the Golang's `math/big.Int` type to `bigint` type in k6. - [#3922](https://github.com/grafana/k6/pull/3922) removes `lib.Min` and `lib.Max` from k6's Go API, which could affect custom extensions that rely on these functions. +- [#3838](https://github.com/grafana/k6/pull/3838) remove `k6/experimental/timers` - they are now available globally and no import is needed. ### (_optional h3_) `` `#pr` @@ -147,7 +148,7 @@ Thank you, @cchamplin! Thank you, @Lordnibbler! -### Sobek updates brings support of new ECMAScript features into k6 [`#3925`](https://github.com/grafana/k6/pull/3925), [`#3913`](https://github.com/grafana/k6/pull/3913) +### Sobek updates brings support of new ECMAScript features into k6 [`#3899`](https://github.com/grafana/k6/pull/3899), [`#3925`](https://github.com/grafana/k6/pull/3925), [`#3913`](https://github.com/grafana/k6/pull/3913) With this release, we've updated [Sobek](https://github.com/grafana/sobek) (the `ECMAScript` implementation in Go) which contains the new ECMAScript features that are now available in k6. @@ -157,7 +158,7 @@ This includes support for numeric literal separators, like: const billion = 1_000_000_000 ``` -And also support for `BigInt`, the values which are too large to be represented by the number primitive. +Support for `BigInt`, the values which are too large to be represented by the number primitive. ```javascript const huge = BigInt(9007199254740991); @@ -165,6 +166,20 @@ const huge = BigInt(9007199254740991); Note: that prior k6 version v0.54, Golang's type `math/big.Int` mapped to another type, so it might be a breaking change for some extensions or users. +Regexp dotall support - letting you match newline characters with `.`. + +``javascript +const str1 = "bar\nexample foo example"; + +const regex1 = /bar.example/s; + +console.log(regex1.dotAll); // true +``` + +Support for ES2023 Array methods: [`with`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/with), [`toSpliced`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toSpliced), [`toReversed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toReversed) and [`toSorted`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toSorted). + +Thank you @shiroyk for adding both the new array methods and BitInt :bow:. + ### New `setChecked` method for the browser module [`#3914`](https://github.com/grafana/xk6-browser/pull/1403) Previously, users could check or uncheck checkbox and radio button elements using the [`check`](https://grafana.com/docs/k6/latest/javascript-api/k6-browser/page/check/) and [`uncheck`](https://grafana.com/docs/k6/latest/javascript-api/k6-browser/page/uncheck/) methods. Now, we've added a `setChecked` method that allows users to set either the checked or unchecked state of a checkbox or radio button with a single method and a boolean argument. @@ -202,6 +217,9 @@ await page.setChecked('#checkbox', false); // uncheck the checkbox - [#3945](https://github.com/grafana/k6/pull/3945) updates the endpoint where [usage reports](https://grafana.com/docs/k6/latest/set-up/usage-collection/) are sent to. - [#3903](https://github.com/grafana/k6/pull/3903), [#3912](https://github.com/grafana/k6/pull/3912), [#3928](https://github.com/grafana/k6/pull/3928) update dependencies. - [browser#1419](https://github.com/grafana/xk6-browser/pull/1419), [browser#1423](https://github.com/grafana/xk6-browser/pull/1423) adds a new remote file upload protocol. +- [#3900](https://github.com/grafana/k6/pull/3900) and [#3902](https://github.com/grafana/k6/pull/3902) Update golangci-lint to 1.60.1 and add fatcontext and cononicalheader as linters. +- [#3908](https://github.com/grafana/k6/pull/3908) drop NetTrail internal type to simplify internal implementation on emitting iteration and data transmission metric. +- [#3935](https://github.com/grafana/k6/pull/3935) refactor some js tests to remove repeated setup code. ## _Optional_ Roadmap From 901251ff6f9b5ed8bb0f989804a43a70304ca22b Mon Sep 17 00:00:00 2001 From: oleiade Date: Tue, 17 Sep 2024 10:34:30 +0200 Subject: [PATCH 15/41] Add notes specific to --local-execution --- release notes/v0.54.0.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/release notes/v0.54.0.md b/release notes/v0.54.0.md index 0b93ea44255..dd65e42c9b4 100644 --- a/release notes/v0.54.0.md +++ b/release notes/v0.54.0.md @@ -13,6 +13,17 @@ k6 `v0.54.0` is here ๐ŸŽ‰! This release includes: ## New features +### New `k6 cloud run --local-execution` flag for local execution of cloud tests [`#3904`](https://github.com/grafana/k6/pull/3904), and [#3931](https://github.com/grafana/k6/pull/3931) + +This release introduces the --local-execution flag for the k6 cloud run command, allowing you to run test executions locally while sending the metrics to Grafana Cloud k6. +```bash +k6 cloud run --local-execution +``` + +By default, using the `--local-execution` flag uploads the test archive to Grafana Cloud k6. If you want to disable this upload, use the `--no-archive-upload` flag. + +The `--local-execution` flag currently functions similarly to the `k6 run -o cloud` command, which is now considered deprecated (though it is not planned to be removed). Future updates will enhance `--local-execution` with additional capabilities that the `k6 run -o cloud` command does not offer. + ### New experimental CSV module for efficient CSV data handling [`#3743`](https://github.com/grafana/k6/pull/3743) Weโ€™ve added a new experimental csv module to k6 for more efficient and convenient CSV parsing and streaming, addressing the limitations of preexisting JavaScript-based solutions like [papaparse](https://www.papaparse.com/). From 4fd717de0b9d0b4608da80ea227fc989c13b9b8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0nan=C3=A7=20G=C3=BCm=C3=BC=C5=9F?= Date: Tue, 17 Sep 2024 09:08:54 -0400 Subject: [PATCH 16/41] Improve browser release notes Co-authored-by: Ankur --- release notes/v0.54.0.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/release notes/v0.54.0.md b/release notes/v0.54.0.md index dd65e42c9b4..ac0902b5c7d 100644 --- a/release notes/v0.54.0.md +++ b/release notes/v0.54.0.md @@ -191,9 +191,9 @@ Support for ES2023 Array methods: [`with`](https://developer.mozilla.org/en-US/d Thank you @shiroyk for adding both the new array methods and BitInt :bow:. -### New `setChecked` method for the browser module [`#3914`](https://github.com/grafana/xk6-browser/pull/1403) +### New `setChecked` method for the browser module [`browser#1403`](https://github.com/grafana/xk6-browser/pull/1403) -Previously, users could check or uncheck checkbox and radio button elements using the [`check`](https://grafana.com/docs/k6/latest/javascript-api/k6-browser/page/check/) and [`uncheck`](https://grafana.com/docs/k6/latest/javascript-api/k6-browser/page/uncheck/) methods. Now, we've added a `setChecked` method that allows users to set either the checked or unchecked state of a checkbox or radio button with a single method and a boolean argument. +Previously, users could check or uncheck checkbox and radio button elements using the [`check`](https://grafana.com/docs/k6/latest/javascript-api/k6-browser/page/check/) and [`uncheck`](https://grafana.com/docs/k6/latest/javascript-api/k6-browser/page/uncheck/) methods. Now, we've added a `setChecked` method that allows users to set a checkbox or radio button to either the checked or unchecked state with a single method and a boolean argument. ```javascript await page.setChecked('#checkbox', true); // check the checkbox From dea59eda6640f0bedf396f1fcce941422a4c43e8 Mon Sep 17 00:00:00 2001 From: Mihail Stoykov Date: Tue, 17 Sep 2024 16:38:13 +0300 Subject: [PATCH 17/41] Add branding changes --- release notes/v0.54.0.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/release notes/v0.54.0.md b/release notes/v0.54.0.md index ac0902b5c7d..173c4016007 100644 --- a/release notes/v0.54.0.md +++ b/release notes/v0.54.0.md @@ -2,6 +2,7 @@ k6 `v0.54.0` is here ๐ŸŽ‰! This release includes: - A new experimental CSV module - new ECMAScript features +- Updated logo and branding ## Breaking changes @@ -13,6 +14,14 @@ k6 `v0.54.0` is here ๐ŸŽ‰! This release includes: ## New features +### Branding changes and logo [`#3946`](https://github.com/grafana/k6/pull/3946), [`#3953`](https://github.com/grafana/k6/pull/3953) + +As part of Grafana Labs, k6 got renamed to Grafana k6, instead of k6.io. We also had a purple icon making a bit jarring next to all the other orange-y ones. + +As such in this release we also got a new logo and the terminal banner has been redesigned to more closely match the current branding. + +![image](https://github.com/grafana/k6/blob/31e3db711850fdd270e56e53feb3a2e4209e542a/assets/logo.svg) + ### New `k6 cloud run --local-execution` flag for local execution of cloud tests [`#3904`](https://github.com/grafana/k6/pull/3904), and [#3931](https://github.com/grafana/k6/pull/3931) This release introduces the --local-execution flag for the k6 cloud run command, allowing you to run test executions locally while sending the metrics to Grafana Cloud k6. From 4b63d34de19c6d323524ddfceb65c6a21dadfcf0 Mon Sep 17 00:00:00 2001 From: Mihail Stoykov Date: Tue, 17 Sep 2024 16:56:33 +0300 Subject: [PATCH 18/41] add usage changes to release notes --- release notes/v0.54.0.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/release notes/v0.54.0.md b/release notes/v0.54.0.md index 173c4016007..6e7e7764120 100644 --- a/release notes/v0.54.0.md +++ b/release notes/v0.54.0.md @@ -211,6 +211,24 @@ await page.setChecked('#checkbox', false); // uncheck the checkbox [Page](https://grafana.com/docs/k6/next/javascript-api/k6-browser/page/setchecked/), [Frame](https://grafana.com/docs/k6/next/javascript-api/k6-browser/frame/), [ElementHandle](https://grafana.com/docs/k6/next/javascript-api/k6-browser/elementhandle/), and [Locator](https://grafana.com/docs/k6/next/javascript-api/k6-browser/locator/) now support the new `setChecked` method. +### Rework of how usage is being collected internally and additional counters [`#3917`](https://github.com/grafana/k6/pull/3917) and [`#3951`](https://github.com/grafana/k6/pull/3951) + +As part of working on k6 over the years we have many times wondered if given features is used or if this strange corner case behavior is being used. + +We usually made guesses or tried to extrapolate from experience on issues we see or maybe even cloud customers. This unfortunately isn't always easy or possible at all and definitely is very skewed. As such we usually also added warning messages to thing we intend on breaking to let people know and ask them to report if they see problems. This usually see very little activity especially before we make the changes. + +This also only works for things we want to remove, but doesn't help us know if people use new functionality at all or if there are patterns that we do not expect. + +While k6 has been collecting usage for a while it is usually very surface level stuff, such as how many VUs were run, k6 version, what *internal* modules were loaded and such. + +And the system for this was very rigid requiring usually a lot of work to add simple stuff, like if someone used the `require` function. + +This has been reworked to make this a lot easier to do and a few new usage reports have been added: +- when cloud is used it will also tell us which test run it is. We already have most if not actually more of the information reported through metrics and it being ran in the cloud. But this will also help us filter cloud from not cloud runs easier and also potentially tell cloud users that they are using experimental modules that are to be removed soon. +- number of files parsed as well as number of ts files parsed. This will be useful both in us figuring out if people use small projects or bigger ones as well as if ts file support is being used. +- usage of `require`. Now that we have ESM native support, using `require` and CommonJS adds complexity. It is interesting to us whether removing this in the future - likely years, given it support in other runtimes, is even feasable. +- usage of `global`. This for help us decide if we can [drop compatility-mode](https://github.com/grafana/k6/issues/3864) differences or even the whole concept of them. + ## UX improvements and enhancements - [#3898](https://github.com/grafana/k6/pull/3898) adds `SetupTimeout` option validation. Thank you, @tsukasaI! From 4b33ce645a2a9e109d20dfa8ad59c9256b45b5db Mon Sep 17 00:00:00 2001 From: Mihail Stoykov Date: Tue, 17 Sep 2024 17:03:23 +0300 Subject: [PATCH 19/41] xk6-websockets changes --- release notes/v0.54.0.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/release notes/v0.54.0.md b/release notes/v0.54.0.md index 6e7e7764120..4e5d1a86b28 100644 --- a/release notes/v0.54.0.md +++ b/release notes/v0.54.0.md @@ -9,6 +9,7 @@ k6 `v0.54.0` is here ๐ŸŽ‰! This release includes: - [#3913](https://github.com/grafana/k6/pull/3913) changes mapping of the Golang's `math/big.Int` type to `bigint` type in k6. - [#3922](https://github.com/grafana/k6/pull/3922) removes `lib.Min` and `lib.Max` from k6's Go API, which could affect custom extensions that rely on these functions. - [#3838](https://github.com/grafana/k6/pull/3838) remove `k6/experimental/timers` - they are now available globally and no import is needed. +- [#3944](https://github.com/grafana/k6/pull/3844) updates to `k6/experimental/websockets` made the default to binaryType to be `"blob"` as per the specification. Previously it was not set by default and required to be set and before that it was `"arraybuffer"`. With this change `k6/experimental/websockets` is now compliant with the specification. ### (_optional h3_) `` `#pr` @@ -211,6 +212,15 @@ await page.setChecked('#checkbox', false); // uncheck the checkbox [Page](https://grafana.com/docs/k6/next/javascript-api/k6-browser/page/setchecked/), [Frame](https://grafana.com/docs/k6/next/javascript-api/k6-browser/frame/), [ElementHandle](https://grafana.com/docs/k6/next/javascript-api/k6-browser/elementhandle/), and [Locator](https://grafana.com/docs/k6/next/javascript-api/k6-browser/locator/) now support the new `setChecked` method. +### Support ArrayBufferViews in send for `k6/experimental/websockets` [#3944](https://github.com/grafana/k6/pull/3844) + +As part of making `k6/experimental/websockets` complaint with the [WebSocket API](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket) it now support Uint8Array and other ArrayBufferViews directly as arguments to `send`, instead of having to specifically provide their `buffer`. + +This should make it more compliant with libraries that use WebSocket API. + +Thanks to @pixeldrew for [reporting](https://github.com/grafana/xk6-websockets/issues/75) this :bow: + + ### Rework of how usage is being collected internally and additional counters [`#3917`](https://github.com/grafana/k6/pull/3917) and [`#3951`](https://github.com/grafana/k6/pull/3951) As part of working on k6 over the years we have many times wondered if given features is used or if this strange corner case behavior is being used. From be907c9c80d9563ea8336dd0a7335ca46afa5de5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0nan=C3=A7=20G=C3=BCm=C3=BC=C5=9F?= Date: Tue, 17 Sep 2024 10:16:01 -0400 Subject: [PATCH 20/41] Add browser module notice --- release notes/v0.54.0.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/release notes/v0.54.0.md b/release notes/v0.54.0.md index 4e5d1a86b28..0ab3f698dda 100644 --- a/release notes/v0.54.0.md +++ b/release notes/v0.54.0.md @@ -269,7 +269,6 @@ This has been reworked to make this a lot easier to do and a few new usage repor - [#3908](https://github.com/grafana/k6/pull/3908) drop NetTrail internal type to simplify internal implementation on emitting iteration and data transmission metric. - [#3935](https://github.com/grafana/k6/pull/3935) refactor some js tests to remove repeated setup code. -## _Optional_ Roadmap - -_Discussion of future plans_ +## Roadmap +In version 0.52.0, the browser module [transitioned](https://github.com/grafana/k6/pull/3793) from the experimental phase to stable. The new module is more stable and has a [full Async API](https://github.com/grafana/xk6-browser/pull/1374). To ensure your scripts continue working, you must migrate to the new `k6/browser` module and discontinue using the previous `k6/experimental/browser` module. Please see [the migration guide](https://grafana.com/docs/k6/latest/using-k6-browser/migrating-to-k6-v0-52/) for more details. \ No newline at end of file From 469ecb471f2874070db074fddefcf97e3b6284f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0nan=C3=A7=20G=C3=BCm=C3=BC=C5=9F?= Date: Tue, 17 Sep 2024 10:17:41 -0400 Subject: [PATCH 21/41] Add future plans notice back --- release notes/v0.54.0.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/release notes/v0.54.0.md b/release notes/v0.54.0.md index 0ab3f698dda..35f2f5c3863 100644 --- a/release notes/v0.54.0.md +++ b/release notes/v0.54.0.md @@ -271,4 +271,6 @@ This has been reworked to make this a lot easier to do and a few new usage repor ## Roadmap -In version 0.52.0, the browser module [transitioned](https://github.com/grafana/k6/pull/3793) from the experimental phase to stable. The new module is more stable and has a [full Async API](https://github.com/grafana/xk6-browser/pull/1374). To ensure your scripts continue working, you must migrate to the new `k6/browser` module and discontinue using the previous `k6/experimental/browser` module. Please see [the migration guide](https://grafana.com/docs/k6/latest/using-k6-browser/migrating-to-k6-v0-52/) for more details. \ No newline at end of file +In version 0.52.0, the browser module [transitioned](https://github.com/grafana/k6/pull/3793) from the experimental phase to stable. The new module is more stable and has a [full Async API](https://github.com/grafana/xk6-browser/pull/1374). To ensure your scripts continue working, you must migrate to the new `k6/browser` module and discontinue using the previous `k6/experimental/browser` module. Please see [the migration guide](https://grafana.com/docs/k6/latest/using-k6-browser/migrating-to-k6-v0-52/) for more details. + +_Discussion of future plans_ \ No newline at end of file From d30a86d71df6ad677bedf86895f71a0d57fb492d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0nan=C3=A7=20G=C3=BCm=C3=BC=C5=9F?= Date: Tue, 17 Sep 2024 10:20:35 -0400 Subject: [PATCH 22/41] Fix regex code block release notes --- release notes/v0.54.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release notes/v0.54.0.md b/release notes/v0.54.0.md index 35f2f5c3863..42dda2e6407 100644 --- a/release notes/v0.54.0.md +++ b/release notes/v0.54.0.md @@ -189,7 +189,7 @@ Note: that prior k6 version v0.54, Golang's type `math/big.Int` mapped to anothe Regexp dotall support - letting you match newline characters with `.`. -``javascript +```javascript const str1 = "bar\nexample foo example"; const regex1 = /bar.example/s; From 802430d80323eddbbc8e86214c1e802935a291ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0nan=C3=A7=20G=C3=BCm=C3=BC=C5=9F?= Date: Tue, 17 Sep 2024 10:21:54 -0400 Subject: [PATCH 23/41] Fix doc next links to latest --- release notes/v0.54.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release notes/v0.54.0.md b/release notes/v0.54.0.md index 42dda2e6407..f93148fb460 100644 --- a/release notes/v0.54.0.md +++ b/release notes/v0.54.0.md @@ -210,7 +210,7 @@ await page.setChecked('#checkbox', true); // check the checkbox await page.setChecked('#checkbox', false); // uncheck the checkbox ``` -[Page](https://grafana.com/docs/k6/next/javascript-api/k6-browser/page/setchecked/), [Frame](https://grafana.com/docs/k6/next/javascript-api/k6-browser/frame/), [ElementHandle](https://grafana.com/docs/k6/next/javascript-api/k6-browser/elementhandle/), and [Locator](https://grafana.com/docs/k6/next/javascript-api/k6-browser/locator/) now support the new `setChecked` method. +[Page](https://grafana.com/docs/k6/latest/javascript-api/k6-browser/page/setchecked/), [Frame](https://grafana.com/docs/k6/latest/javascript-api/k6-browser/frame/), [ElementHandle](https://grafana.com/docs/k6/latest/javascript-api/k6-browser/elementhandle/), and [Locator](https://grafana.com/docs/k6/latest/javascript-api/k6-browser/locator/) now support the new `setChecked` method. ### Support ArrayBufferViews in send for `k6/experimental/websockets` [#3944](https://github.com/grafana/k6/pull/3844) From e575ea4dfd3d5e852ed9f7f0244454e9556bfdb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0nan=C3=A7=20G=C3=BCm=C3=BC=C5=9F?= Date: Tue, 17 Sep 2024 10:23:14 -0400 Subject: [PATCH 24/41] Add setChecked links --- release notes/v0.54.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release notes/v0.54.0.md b/release notes/v0.54.0.md index f93148fb460..6a43c905fc5 100644 --- a/release notes/v0.54.0.md +++ b/release notes/v0.54.0.md @@ -210,7 +210,7 @@ await page.setChecked('#checkbox', true); // check the checkbox await page.setChecked('#checkbox', false); // uncheck the checkbox ``` -[Page](https://grafana.com/docs/k6/latest/javascript-api/k6-browser/page/setchecked/), [Frame](https://grafana.com/docs/k6/latest/javascript-api/k6-browser/frame/), [ElementHandle](https://grafana.com/docs/k6/latest/javascript-api/k6-browser/elementhandle/), and [Locator](https://grafana.com/docs/k6/latest/javascript-api/k6-browser/locator/) now support the new `setChecked` method. +[Page](https://grafana.com/docs/k6/latest/javascript-api/k6-browser/page/setchecked/), [Frame](https://grafana.com/docs/k6/latest/javascript-api/k6-browser/frame/setchecked/), [ElementHandle](https://grafana.com/docs/k6/latest/javascript-api/k6-browser/elementhandle//setchecked/), and [Locator](https://grafana.com/docs/k6/latest/javascript-api/k6-browser/locator/setchecked/) now support the new `setChecked` method. ### Support ArrayBufferViews in send for `k6/experimental/websockets` [#3944](https://github.com/grafana/k6/pull/3844) From 6a9971be7cda7a6033a633b57fa5c4b4cf370ef2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0nan=C3=A7=20G=C3=BCm=C3=BC=C5=9F?= Date: Wed, 18 Sep 2024 12:50:22 -0400 Subject: [PATCH 25/41] Add async check utility --- release notes/v0.54.0.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/release notes/v0.54.0.md b/release notes/v0.54.0.md index 6a43c905fc5..fdf2813893a 100644 --- a/release notes/v0.54.0.md +++ b/release notes/v0.54.0.md @@ -212,6 +212,34 @@ await page.setChecked('#checkbox', false); // uncheck the checkbox [Page](https://grafana.com/docs/k6/latest/javascript-api/k6-browser/page/setchecked/), [Frame](https://grafana.com/docs/k6/latest/javascript-api/k6-browser/frame/setchecked/), [ElementHandle](https://grafana.com/docs/k6/latest/javascript-api/k6-browser/elementhandle//setchecked/), and [Locator](https://grafana.com/docs/k6/latest/javascript-api/k6-browser/locator/setchecked/) now support the new `setChecked` method. +### Async `check` function utility [`k6-utils#13`](https://github.com/grafana/k6-jslib-utils/pull/13) + +Writing clean code can be cumbersome using [the k6 `check` function](https://grafana.com/docs/k6/latest/javascript-api/k6/check/) with async code because the `check` function does not support asynchronous checks. One potential solution is to declare a temporary variable and wait for the value first, then check the result later. However, this approach can clutter the code with single-use declarations and unnecessary variable names: + +```javascript +const checked = await p.locator('.checked').isChecked(); + +check(page, { + 'checked': p => checked, +}); +``` + +To address this limitation, we've added a version of the `check` function to [jslib.k6.io](https://jslib.k6.io/) that makes working with `async`/`await` more ergonomic. The `check` function is a drop-in replacement for the built-in check, with added support for async code. Any `Promise`s will be awaited, and the result is reported once the operation has been completed: + +```javascript +// Import the new check function from jslib.k6.io/k6-utils +import { check } from 'https://jslib.k6.io/k6-utils/1.5.0/index.js'; + +// ... + +// Use the new check function with async code +check(page, { + 'checked': async p => p.locator('.checked').isChecked(), +}); +``` + +Check out [the `check` utility function's documentation](https://grafana.com/docs/k6/next/javascript-api/jslib/utils/check/) for more information on how to use it. + ### Support ArrayBufferViews in send for `k6/experimental/websockets` [#3944](https://github.com/grafana/k6/pull/3844) As part of making `k6/experimental/websockets` complaint with the [WebSocket API](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket) it now support Uint8Array and other ArrayBufferViews directly as arguments to `send`, instead of having to specifically provide their `buffer`. From cac0382550f93acc793ee35a2aa50561fa38a622 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0nan=C3=A7=20G=C3=BCm=C3=BC=C5=9F?= Date: Wed, 18 Sep 2024 13:14:25 -0400 Subject: [PATCH 26/41] Fix k6lib check next to latest --- release notes/v0.54.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release notes/v0.54.0.md b/release notes/v0.54.0.md index fdf2813893a..283a8a3494f 100644 --- a/release notes/v0.54.0.md +++ b/release notes/v0.54.0.md @@ -238,7 +238,7 @@ check(page, { }); ``` -Check out [the `check` utility function's documentation](https://grafana.com/docs/k6/next/javascript-api/jslib/utils/check/) for more information on how to use it. +Check out [the `check` utility function's documentation](https://grafana.com/docs/k6/latest/javascript-api/jslib/utils/check/) for more information on how to use it. ### Support ArrayBufferViews in send for `k6/experimental/websockets` [#3944](https://github.com/grafana/k6/pull/3844) From af29a6633c883a0d754d442c381d98745c707036 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0nan=C3=A7=20G=C3=BCm=C3=BC=C5=9F?= Date: Thu, 19 Sep 2024 11:36:48 -0400 Subject: [PATCH 27/41] Improve async check notes Co-authored-by: Ankur --- release notes/v0.54.0.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/release notes/v0.54.0.md b/release notes/v0.54.0.md index 283a8a3494f..565e0e90a16 100644 --- a/release notes/v0.54.0.md +++ b/release notes/v0.54.0.md @@ -214,13 +214,13 @@ await page.setChecked('#checkbox', false); // uncheck the checkbox ### Async `check` function utility [`k6-utils#13`](https://github.com/grafana/k6-jslib-utils/pull/13) -Writing clean code can be cumbersome using [the k6 `check` function](https://grafana.com/docs/k6/latest/javascript-api/k6/check/) with async code because the `check` function does not support asynchronous checks. One potential solution is to declare a temporary variable and wait for the value first, then check the result later. However, this approach can clutter the code with single-use declarations and unnecessary variable names: +Writing concise code can be difficult when using [the k6 `check` function](https://grafana.com/docs/k6/latest/javascript-api/k6/check/) with async code since it doesn't support async APIs. A solution that we have suggested so far is to declare a temporary variable, wait for the value that is to be checked, and then check the result later. However, this approach can clutter the code with single-use declarations and unnecessary variable names, e.g.: ```javascript const checked = await p.locator('.checked').isChecked(); -check(page, { - 'checked': p => checked, +check(checked, { + 'checked': c => c, }); ``` From ad5a90a323824c83791c7dacde704ce82b9047da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0nan=C3=A7=20G=C3=BCm=C3=BC=C5=9F?= Date: Fri, 20 Sep 2024 10:59:27 -0400 Subject: [PATCH 28/41] Improve browser release notes Co-authored-by: Heitor Tashiro Sergent --- release notes/v0.54.0.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/release notes/v0.54.0.md b/release notes/v0.54.0.md index 565e0e90a16..1456a80a0de 100644 --- a/release notes/v0.54.0.md +++ b/release notes/v0.54.0.md @@ -214,7 +214,7 @@ await page.setChecked('#checkbox', false); // uncheck the checkbox ### Async `check` function utility [`k6-utils#13`](https://github.com/grafana/k6-jslib-utils/pull/13) -Writing concise code can be difficult when using [the k6 `check` function](https://grafana.com/docs/k6/latest/javascript-api/k6/check/) with async code since it doesn't support async APIs. A solution that we have suggested so far is to declare a temporary variable, wait for the value that is to be checked, and then check the result later. However, this approach can clutter the code with single-use declarations and unnecessary variable names, e.g.: +Writing concise code can be difficult when using [the k6 `check` function](https://grafana.com/docs/k6/latest/javascript-api/k6/check/) with async code since it doesn't support async APIs. A solution that we have suggested so far is to declare a temporary variable, wait for the value that is to be checked, and then check the result later. However, this approach can clutter the code with single-use declarations and unnecessary variable names, for example: ```javascript const checked = await p.locator('.checked').isChecked(); @@ -224,7 +224,7 @@ check(checked, { }); ``` -To address this limitation, we've added a version of the `check` function to [jslib.k6.io](https://jslib.k6.io/) that makes working with `async`/`await` more ergonomic. The `check` function is a drop-in replacement for the built-in check, with added support for async code. Any `Promise`s will be awaited, and the result is reported once the operation has been completed: +To address this limitation, we've added a version of the `check` function to [jslib.k6.io](https://jslib.k6.io/) that makes working with `async`/`await` simpler. The `check` function is a drop-in replacement for the built-in check, with added support for async code. Any `Promise`s will be awaited, and the result is reported once the operation has been completed: ```javascript // Import the new check function from jslib.k6.io/k6-utils @@ -299,6 +299,4 @@ This has been reworked to make this a lot easier to do and a few new usage repor ## Roadmap -In version 0.52.0, the browser module [transitioned](https://github.com/grafana/k6/pull/3793) from the experimental phase to stable. The new module is more stable and has a [full Async API](https://github.com/grafana/xk6-browser/pull/1374). To ensure your scripts continue working, you must migrate to the new `k6/browser` module and discontinue using the previous `k6/experimental/browser` module. Please see [the migration guide](https://grafana.com/docs/k6/latest/using-k6-browser/migrating-to-k6-v0-52/) for more details. - -_Discussion of future plans_ \ No newline at end of file +In version 0.52.0, the browser module [transitioned](https://github.com/grafana/k6/pull/3793) from experimental to stable. The new module is more stable and has a [full Async API](https://github.com/grafana/xk6-browser/pull/1374). To ensure your scripts continue working, you must migrate to the new `k6/browser` module and discontinue using the previous `k6/experimental/browser` module. Please see [the migration guide](https://grafana.com/docs/k6/latest/using-k6-browser/migrating-to-k6-v0-52/) for more details. \ No newline at end of file From 856dec1df599971058faf1b0915ddab8f2deb5d8 Mon Sep 17 00:00:00 2001 From: Oleg Bespalov Date: Mon, 23 Sep 2024 08:25:26 +0200 Subject: [PATCH 29/41] Apply suggestions from code review Co-authored-by: Heitor Tashiro Sergent --- release notes/v0.54.0.md | 72 +++++++++++++++++++--------------------- 1 file changed, 35 insertions(+), 37 deletions(-) diff --git a/release notes/v0.54.0.md b/release notes/v0.54.0.md index 1456a80a0de..b30cfb245b0 100644 --- a/release notes/v0.54.0.md +++ b/release notes/v0.54.0.md @@ -1,14 +1,14 @@ k6 `v0.54.0` is here ๐ŸŽ‰! This release includes: - A new experimental CSV module -- new ECMAScript features +- New ECMAScript features - Updated logo and branding ## Breaking changes -- [#3913](https://github.com/grafana/k6/pull/3913) changes mapping of the Golang's `math/big.Int` type to `bigint` type in k6. +- [#3913](https://github.com/grafana/k6/pull/3913) changes the mapping of Golang's `math/big.Int` type to `bigint` type in k6. - [#3922](https://github.com/grafana/k6/pull/3922) removes `lib.Min` and `lib.Max` from k6's Go API, which could affect custom extensions that rely on these functions. -- [#3838](https://github.com/grafana/k6/pull/3838) remove `k6/experimental/timers` - they are now available globally and no import is needed. +- [#3838](https://github.com/grafana/k6/pull/3838) removes `k6/experimental/timers` - they are now available globally and no import is needed. - [#3944](https://github.com/grafana/k6/pull/3844) updates to `k6/experimental/websockets` made the default to binaryType to be `"blob"` as per the specification. Previously it was not set by default and required to be set and before that it was `"arraybuffer"`. With this change `k6/experimental/websockets` is now compliant with the specification. ### (_optional h3_) `` `#pr` @@ -25,9 +25,10 @@ As such in this release we also got a new logo and the terminal banner has been ### New `k6 cloud run --local-execution` flag for local execution of cloud tests [`#3904`](https://github.com/grafana/k6/pull/3904), and [#3931](https://github.com/grafana/k6/pull/3931) -This release introduces the --local-execution flag for the k6 cloud run command, allowing you to run test executions locally while sending the metrics to Grafana Cloud k6. +This release introduces the `--local-execution` flag for the k6 cloud run command, allowing you to run test executions locally while sending metrics to Grafana Cloud k6. + ```bash -k6 cloud run --local-execution +k6 cloud run --local-execution script.js ``` By default, using the `--local-execution` flag uploads the test archive to Grafana Cloud k6. If you want to disable this upload, use the `--no-archive-upload` flag. @@ -36,27 +37,27 @@ The `--local-execution` flag currently functions similarly to the `k6 run -o clo ### New experimental CSV module for efficient CSV data handling [`#3743`](https://github.com/grafana/k6/pull/3743) -Weโ€™ve added a new experimental csv module to k6 for more efficient and convenient CSV parsing and streaming, addressing the limitations of preexisting JavaScript-based solutions like [papaparse](https://www.papaparse.com/). +Weโ€™ve added a new experimental CSV module to k6 for more efficient and convenient CSV parsing and streaming, addressing the limitations of preexisting JavaScript-based solutions like [papaparse](https://www.papaparse.com/). #### What is it? -The csv module offers two key features: +The CSV module offers two key features: -* `csv.parse()` **Function**: Parses an entire CSV file at once into a [SharedArray](https://grafana.com/docs/k6/latest/javascript-api/k6-data/sharedarray/), using Go-based processing to using Go-based processing for faster parsing and lower memory usage compared to JavaScript alternatives. -* `csv.Parser` **Class**: Provides a streaming parser to read CSV files line-by-line, minimizing memory consumption and offering more control over parsing through a stream-like API. This is ideal for scenarios where memory optimization or fine-grained control of the parsing process is crucial. +* `csv.parse()`: This function parses a CSV file into a [SharedArray](https://grafana.com/docs/k6/latest/javascript-api/k6-data/sharedarray/) at once using Go-based processing for faster parsing and lower memory usage compared to JavaScript alternatives. +* `csv.Parser`: This class provides a streaming parser to read CSV files line-by-line, minimizing memory consumption and offering more control over parsing through a stream-like API. This is ideal for scenarios where memory optimization or fine-grained control of the parsing process is crucial. -#### Benefits for Users +#### Benefits for users * **Faster Parsing**: `csv.parse` bypasses most of the JavaScript runtime, offering significant speed improvements for large files. -* **Lower Memory Usage**: both solution support shared memory across virtual users (VUs) with the `fs.open` function. -* **Flexibility**: choose between full-file parsing with csv.parse() or memory-efficient streaming with csv.Parser. +* **Lower Memory Usage**: Both solutions support shared memory across virtual users (VUs) with the `fs.open` function. +* **Flexibility**: Choose between full-file parsing with `csv.parse()` or memory-efficient streaming with `csv.Parser`. #### Tradeoffs * **`csv.Parse`**: Parses the entire file in the initialization phase of the test, which can increase startup time and memory usage for large files. Best suited for scenarios where performance is prioritized over memory consumption. * **`csv.Parser`**: Reads the file line-by-line, making it more memory-efficient but potentially slower due to reading overhead for each line. Ideal for scenarios where memory usage is a concern or where fine-grained control over parsing is needed. -#### Example Usage +#### Example usage
Expand to see an example of Parsing a full CSV file into a SharedArray. @@ -131,27 +132,25 @@ export default async function() { ### New `k6 cloud upload` command for uploading test files to the cloud [`#3906`](https://github.com/grafana/k6/pull/3906) -Although we continue to refine and improve the cloud service to handle better the uploading of test files, -as well as the overall user experience, we've added a new `k6 cloud upload` command that replaces the -`k6 cloud --upload-only` flag used so far, which is now considered deprecated. +We continue to refine and improve the cloud service to improve how we handle uploading test files, so we've added a new `k6 cloud upload` command that replaces the `k6 cloud --upload-only` flag, which is now considered deprecated. ### gRPC module updates driven by contributors #### New `discardResponseMessage` option -[#3877](https://github.com/grafana/k6/pull/3877) and [#3820](https://github.com/grafana/k6/pull/3820) add a new option for gRPC module `discardResponseMessage` which allows users to discard the messages received from the server. +[#3877](https://github.com/grafana/k6/pull/3877) and [#3820](https://github.com/grafana/k6/pull/3820) add a new option for the gRPC module `discardResponseMessage`, which allows users to discard the messages received from the server. ```javascript const resp = client.invoke('main.RouteGuide/GetFeature', req, {discardResponseMessage: true}); ``` -This reduces the amount of memory required, and the amount of garbage collection, which reduces the load on the testing machine and can help produce more reliable test results. +This reduces the amount of memory required and the amount of garbage collection, which reduces the load on the testing machine and can help produce more reliable test results. Thank you, @lzakharov! #### New argument `meta` for gRPC's stream callbacks -[#3801](https://github.com/grafana/k6/pull/3801) adds a new argument `meta` to gRPC's stream callback, which handles the timestamp of the original event (e.g. when message has been received). +[#3801](https://github.com/grafana/k6/pull/3801) adds a new argument `meta` to gRPC's stream callback, which handles the timestamp of the original event (for example, when a message has been received). ```javascript let stream = new grpc.Stream(client, "main.FeatureExplorer/ListFeatures") @@ -173,21 +172,21 @@ Thank you, @Lordnibbler! With this release, we've updated [Sobek](https://github.com/grafana/sobek) (the `ECMAScript` implementation in Go) which contains the new ECMAScript features that are now available in k6. -This includes support for numeric literal separators, like: +This includes support for numeric literal separators: ```javascript const billion = 1_000_000_000 ``` -Support for `BigInt`, the values which are too large to be represented by the number primitive. +Support for `BigInt`, the values which are too large to be represented by the number primitive: ```javascript const huge = BigInt(9007199254740991); ``` -Note: that prior k6 version v0.54, Golang's type `math/big.Int` mapped to another type, so it might be a breaking change for some extensions or users. +Note: Before k6 version v0.54, Golang's type `math/big.Int` mapped to another type, so this might be a breaking change for some extensions or users. -Regexp dotall support - letting you match newline characters with `.`. +RegExp dotAll support, where you can match newline characters with `.`: ```javascript const str1 = "bar\nexample foo example"; @@ -240,32 +239,31 @@ check(page, { Check out [the `check` utility function's documentation](https://grafana.com/docs/k6/latest/javascript-api/jslib/utils/check/) for more information on how to use it. -### Support ArrayBufferViews in send for `k6/experimental/websockets` [#3944](https://github.com/grafana/k6/pull/3844) +### Support ArrayBufferViews in `send` for `k6/experimental/websockets` [#3944](https://github.com/grafana/k6/pull/3844) -As part of making `k6/experimental/websockets` complaint with the [WebSocket API](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket) it now support Uint8Array and other ArrayBufferViews directly as arguments to `send`, instead of having to specifically provide their `buffer`. +As part of making `k6/experimental/websockets` compliant with the [WebSocket API](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket), it now supports Uint8Array and other ArrayBufferViews directly as arguments to `send`, instead of having to specifically provide their `buffer`. -This should make it more compliant with libraries that use WebSocket API. +This should make the module more compliant with libraries that use the WebSocket API. -Thanks to @pixeldrew for [reporting](https://github.com/grafana/xk6-websockets/issues/75) this :bow: +Thanks to @pixeldrew for [reporting](https://github.com/grafana/xk6-websockets/issues/75) this. :bow: ### Rework of how usage is being collected internally and additional counters [`#3917`](https://github.com/grafana/k6/pull/3917) and [`#3951`](https://github.com/grafana/k6/pull/3951) -As part of working on k6 over the years we have many times wondered if given features is used or if this strange corner case behavior is being used. +As part of working on k6 over the years, we have often wondered if users use certain features or if they see a strange corner case behavior. -We usually made guesses or tried to extrapolate from experience on issues we see or maybe even cloud customers. This unfortunately isn't always easy or possible at all and definitely is very skewed. As such we usually also added warning messages to thing we intend on breaking to let people know and ask them to report if they see problems. This usually see very little activity especially before we make the changes. +We have usually made guesses or tried to extrapolate from experience on issues we see. Unfortunately, this isn't always easy or possible, and it's definitely very skewed. As such, we usually also add warning messages to things we intend to break to inform people and ask them to report problems. But we usually see very little activity, especially before we make changes. -This also only works for things we want to remove, but doesn't help us know if people use new functionality at all or if there are patterns that we do not expect. +This also only works for things we want to remove, and it doesn't help us know if people use new functionality at all or if there are patterns we don't expect. -While k6 has been collecting usage for a while it is usually very surface level stuff, such as how many VUs were run, k6 version, what *internal* modules were loaded and such. +While k6 has been collecting usage for a while, they're surface-level things, such as how many VUs were run, the k6 version, or which *internal* modules were loaded. The system for this was also very rigid, requiring a lot of work to add simple things, such as if someone used the `require` function. -And the system for this was very rigid requiring usually a lot of work to add simple stuff, like if someone used the `require` function. +This process has been reworked to make things easier, and a few new usage reports have been added: -This has been reworked to make this a lot easier to do and a few new usage reports have been added: -- when cloud is used it will also tell us which test run it is. We already have most if not actually more of the information reported through metrics and it being ran in the cloud. But this will also help us filter cloud from not cloud runs easier and also potentially tell cloud users that they are using experimental modules that are to be removed soon. -- number of files parsed as well as number of ts files parsed. This will be useful both in us figuring out if people use small projects or bigger ones as well as if ts file support is being used. -- usage of `require`. Now that we have ESM native support, using `require` and CommonJS adds complexity. It is interesting to us whether removing this in the future - likely years, given it support in other runtimes, is even feasable. -- usage of `global`. This for help us decide if we can [drop compatility-mode](https://github.com/grafana/k6/issues/3864) differences or even the whole concept of them. +- When Grafana Cloud is used, it will also tell us which test run it is. We already have most of the information reported through metrics and from the test being executed in the cloud. But this will help us filter cloud test runs from local runs and potentially warn cloud users if they're using experimental modules that will be removed. +- The number of files parsed, as well as the number of .ts files parsed. This will help us understand if people use small or big projects and if TypeScript support is being used. +- Usage of `require`. Now that we have ESM native support, using `require` and CommonJS adds complexity. It's interesting to us whether removing this in the future - likely years, given its support in other runtimes, is feasible. +- Usage of `global`. This will help us decide if we can [drop compatibility-mode](https://github.com/grafana/k6/issues/3864) differences or even the whole concept. ## UX improvements and enhancements From 317abfdfd38bfc88659ce0a82bfd2d9754fd78c0 Mon Sep 17 00:00:00 2001 From: Oleg Bespalov Date: Mon, 23 Sep 2024 09:30:31 +0200 Subject: [PATCH 30/41] Adding missing dependencies PRs, aligning the style --- release notes/v0.54.0.md | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/release notes/v0.54.0.md b/release notes/v0.54.0.md index b30cfb245b0..70e6d8d6685 100644 --- a/release notes/v0.54.0.md +++ b/release notes/v0.54.0.md @@ -11,8 +11,6 @@ k6 `v0.54.0` is here ๐ŸŽ‰! This release includes: - [#3838](https://github.com/grafana/k6/pull/3838) removes `k6/experimental/timers` - they are now available globally and no import is needed. - [#3944](https://github.com/grafana/k6/pull/3844) updates to `k6/experimental/websockets` made the default to binaryType to be `"blob"` as per the specification. Previously it was not set by default and required to be set and before that it was `"arraybuffer"`. With this change `k6/experimental/websockets` is now compliant with the specification. -### (_optional h3_) `` `#pr` - ## New features ### Branding changes and logo [`#3946`](https://github.com/grafana/k6/pull/3946), [`#3953`](https://github.com/grafana/k6/pull/3953) @@ -46,7 +44,7 @@ The CSV module offers two key features: * `csv.parse()`: This function parses a CSV file into a [SharedArray](https://grafana.com/docs/k6/latest/javascript-api/k6-data/sharedarray/) at once using Go-based processing for faster parsing and lower memory usage compared to JavaScript alternatives. * `csv.Parser`: This class provides a streaming parser to read CSV files line-by-line, minimizing memory consumption and offering more control over parsing through a stream-like API. This is ideal for scenarios where memory optimization or fine-grained control of the parsing process is crucial. -#### Benefits for users +#### Benefits for users * **Faster Parsing**: `csv.parse` bypasses most of the JavaScript runtime, offering significant speed improvements for large files. * **Lower Memory Usage**: Both solutions support shared memory across virtual users (VUs) with the `fs.open` function. @@ -278,7 +276,7 @@ This process has been reworked to make things easier, and a few new usage report - [browser#1406](https://github.com/grafana/xk6-browser/pull/1406) fixes panic on iframe attach when iframe didn't contain any UI elements. - [browser#1420](https://github.com/grafana/xk6-browser/pull/1420) uses the VU context to control the iterations lifecycle which helps k6 shutdown in a timely manner when a test is aborted. - [browser#1421](https://github.com/grafana/xk6-browser/pull/1421) fixes the navigation span by starting when the page starts to load so that it's a better representation of how long the test was on a page. -- [browser#1408](https://github.com/grafana/xk6-browser/pull/1408), [#1422](https://github.com/grafana/xk6-browser/pull/1422) fixes the `page.reload` API so handles `null` responses without exceptions. +- [browser#1408](https://github.com/grafana/xk6-browser/pull/1408), [browser#1422](https://github.com/grafana/xk6-browser/pull/1422) fixes the `page.reload` API so handles `null` responses without exceptions. ## Maintenance and internal improvements @@ -289,12 +287,12 @@ This process has been reworked to make things easier, and a few new usage report - [#3926](https://github.com/grafana/k6/pull/3926) documents maintenance of tc39 tests. - [#3881](https://github.com/grafana/k6/pull/3881) adds top-level roadmap link. - [#3945](https://github.com/grafana/k6/pull/3945) updates the endpoint where [usage reports](https://grafana.com/docs/k6/latest/set-up/usage-collection/) are sent to. -- [#3903](https://github.com/grafana/k6/pull/3903), [#3912](https://github.com/grafana/k6/pull/3912), [#3928](https://github.com/grafana/k6/pull/3928) update dependencies. -- [browser#1419](https://github.com/grafana/xk6-browser/pull/1419), [browser#1423](https://github.com/grafana/xk6-browser/pull/1423) adds a new remote file upload protocol. -- [#3900](https://github.com/grafana/k6/pull/3900) and [#3902](https://github.com/grafana/k6/pull/3902) Update golangci-lint to 1.60.1 and add fatcontext and cononicalheader as linters. -- [#3908](https://github.com/grafana/k6/pull/3908) drop NetTrail internal type to simplify internal implementation on emitting iteration and data transmission metric. -- [#3935](https://github.com/grafana/k6/pull/3935) refactor some js tests to remove repeated setup code. +- [browser#1419](https://github.com/grafana/xk6-browser/pull/1419), [browser#1423](https://github.com/grafana/xk6-browser/pull/1423) add a new remote file upload protocol. +- [#3900](https://github.com/grafana/k6/pull/3900), [#3902](https://github.com/grafana/k6/pull/3902) update golangci-lint to 1.60.1 and add `fatcontext` and `cononicalheader` as linters. +- [#3908](https://github.com/grafana/k6/pull/3908) drops `NetTrail` internal type to simplify internal implementation on emitting iteration and data transmission metric. +- [#3935](https://github.com/grafana/k6/pull/3935) refactors some js tests to remove repeated setup code. +- [#3903](https://github.com/grafana/k6/pull/3903), [#3912](https://github.com/grafana/k6/pull/3912), [#3928](https://github.com/grafana/k6/pull/3928), [#3910](https://github.com/grafana/k6/pull/3910), [#3954](https://github.com/grafana/k6/pull/3954), [#3963](https://github.com/grafana/k6/pull/3963) update dependencies. ## Roadmap -In version 0.52.0, the browser module [transitioned](https://github.com/grafana/k6/pull/3793) from experimental to stable. The new module is more stable and has a [full Async API](https://github.com/grafana/xk6-browser/pull/1374). To ensure your scripts continue working, you must migrate to the new `k6/browser` module and discontinue using the previous `k6/experimental/browser` module. Please see [the migration guide](https://grafana.com/docs/k6/latest/using-k6-browser/migrating-to-k6-v0-52/) for more details. \ No newline at end of file +In version 0.52.0, the browser module [transitioned](https://github.com/grafana/k6/pull/3793) from experimental to stable. The new module is more stable and has a [full Async API](https://github.com/grafana/xk6-browser/pull/1374). To ensure your scripts continue working, you must migrate to the new `k6/browser` module and discontinue using the previous `k6/experimental/browser` module. Please see [the migration guide](https://grafana.com/docs/k6/latest/using-k6-browser/migrating-to-k6-v0-52/) for more details. From 44c1f51b233c38d41c489af639d927fae9986ef0 Mon Sep 17 00:00:00 2001 From: oleiade Date: Mon, 23 Sep 2024 09:55:37 +0200 Subject: [PATCH 31/41] Mention further bug fixes and maintenance work --- release notes/v0.54.0.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/release notes/v0.54.0.md b/release notes/v0.54.0.md index 70e6d8d6685..e96ba65aa68 100644 --- a/release notes/v0.54.0.md +++ b/release notes/v0.54.0.md @@ -273,6 +273,7 @@ This process has been reworked to make things easier, and a few new usage report ## Bug fixes - [#3947](https://github.com/grafana/k6/pull/3947) fixes panic when `options` is `nil` (e.g. exported from a module where it isn't really exported). +- [#3901](https://github.com/grafana/k6/pull/3901) fixes the `cloud` command not being display in the `k6` command's help text. - [browser#1406](https://github.com/grafana/xk6-browser/pull/1406) fixes panic on iframe attach when iframe didn't contain any UI elements. - [browser#1420](https://github.com/grafana/xk6-browser/pull/1420) uses the VU context to control the iterations lifecycle which helps k6 shutdown in a timely manner when a test is aborted. - [browser#1421](https://github.com/grafana/xk6-browser/pull/1421) fixes the navigation span by starting when the page starts to load so that it's a better representation of how long the test was on a page. @@ -290,6 +291,8 @@ This process has been reworked to make things easier, and a few new usage report - [browser#1419](https://github.com/grafana/xk6-browser/pull/1419), [browser#1423](https://github.com/grafana/xk6-browser/pull/1423) add a new remote file upload protocol. - [#3900](https://github.com/grafana/k6/pull/3900), [#3902](https://github.com/grafana/k6/pull/3902) update golangci-lint to 1.60.1 and add `fatcontext` and `cononicalheader` as linters. - [#3908](https://github.com/grafana/k6/pull/3908) drops `NetTrail` internal type to simplify internal implementation on emitting iteration and data transmission metric. +- [#3933](https://github.com/grafana/k6/pull/3933) adds a `testutils.MakeMemMapFs` test helper facilitating simulating a file system in tests. +- [#3943](https://github.com/grafana/k6/pull/3943) raises `TestStreamLogsToLogger` log sending delay to improve the reliability of tests. - [#3935](https://github.com/grafana/k6/pull/3935) refactors some js tests to remove repeated setup code. - [#3903](https://github.com/grafana/k6/pull/3903), [#3912](https://github.com/grafana/k6/pull/3912), [#3928](https://github.com/grafana/k6/pull/3928), [#3910](https://github.com/grafana/k6/pull/3910), [#3954](https://github.com/grafana/k6/pull/3954), [#3963](https://github.com/grafana/k6/pull/3963) update dependencies. From 1c2ae2a5fae2f4ec04253424298dc69c617917e3 Mon Sep 17 00:00:00 2001 From: Oleg Bespalov Date: Mon, 23 Sep 2024 14:11:11 +0200 Subject: [PATCH 32/41] Apply suggestions from code review Co-authored-by: Andrey Slotin --- release notes/v0.54.0.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/release notes/v0.54.0.md b/release notes/v0.54.0.md index e96ba65aa68..5c1ab71f2df 100644 --- a/release notes/v0.54.0.md +++ b/release notes/v0.54.0.md @@ -19,7 +19,9 @@ As part of Grafana Labs, k6 got renamed to Grafana k6, instead of k6.io. We also As such in this release we also got a new logo and the terminal banner has been redesigned to more closely match the current branding. -![image](https://github.com/grafana/k6/blob/31e3db711850fdd270e56e53feb3a2e4209e542a/assets/logo.svg) +

+ Grafana k6 logo +

### New `k6 cloud run --local-execution` flag for local execution of cloud tests [`#3904`](https://github.com/grafana/k6/pull/3904), and [#3931](https://github.com/grafana/k6/pull/3931) From 4199f09ce29785aacdd7696f5abf9db24aff94dc Mon Sep 17 00:00:00 2001 From: ankur22 Date: Mon, 23 Sep 2024 16:57:47 +0100 Subject: [PATCH 33/41] Add fix browser#1435 --- release notes/v0.54.0.md | 1 + 1 file changed, 1 insertion(+) diff --git a/release notes/v0.54.0.md b/release notes/v0.54.0.md index 5c1ab71f2df..b7a862d2bac 100644 --- a/release notes/v0.54.0.md +++ b/release notes/v0.54.0.md @@ -280,6 +280,7 @@ This process has been reworked to make things easier, and a few new usage report - [browser#1420](https://github.com/grafana/xk6-browser/pull/1420) uses the VU context to control the iterations lifecycle which helps k6 shutdown in a timely manner when a test is aborted. - [browser#1421](https://github.com/grafana/xk6-browser/pull/1421) fixes the navigation span by starting when the page starts to load so that it's a better representation of how long the test was on a page. - [browser#1408](https://github.com/grafana/xk6-browser/pull/1408), [browser#1422](https://github.com/grafana/xk6-browser/pull/1422) fixes the `page.reload` API so handles `null` responses without exceptions. +- [browser#1435](https://github.com/grafana/xk6-browser/pull/1435) fixes an NPD when performing a `click` action. ## Maintenance and internal improvements From e032c06d51ee6b729ed5b537243ed43083110fe7 Mon Sep 17 00:00:00 2001 From: Oleg Bespalov Date: Tue, 24 Sep 2024 11:15:25 +0200 Subject: [PATCH 34/41] Apply suggestions from code review Co-authored-by: Mihail Stoykov <312246+mstoykov@users.noreply.github.com> Co-authored-by: Heitor Tashiro Sergent --- release notes/v0.54.0.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/release notes/v0.54.0.md b/release notes/v0.54.0.md index b7a862d2bac..07f019f1813 100644 --- a/release notes/v0.54.0.md +++ b/release notes/v0.54.0.md @@ -9,15 +9,15 @@ k6 `v0.54.0` is here ๐ŸŽ‰! This release includes: - [#3913](https://github.com/grafana/k6/pull/3913) changes the mapping of Golang's `math/big.Int` type to `bigint` type in k6. - [#3922](https://github.com/grafana/k6/pull/3922) removes `lib.Min` and `lib.Max` from k6's Go API, which could affect custom extensions that rely on these functions. - [#3838](https://github.com/grafana/k6/pull/3838) removes `k6/experimental/timers` - they are now available globally and no import is needed. -- [#3944](https://github.com/grafana/k6/pull/3844) updates to `k6/experimental/websockets` made the default to binaryType to be `"blob"` as per the specification. Previously it was not set by default and required to be set and before that it was `"arraybuffer"`. With this change `k6/experimental/websockets` is now compliant with the specification. +- [#3944](https://github.com/grafana/k6/pull/3844) updates to `k6/experimental/websockets` made the binaryType default value equal to "blob". With this change, `k6/experimental/websockets` is now compliant with the specification. ## New features ### Branding changes and logo [`#3946`](https://github.com/grafana/k6/pull/3946), [`#3953`](https://github.com/grafana/k6/pull/3953) -As part of Grafana Labs, k6 got renamed to Grafana k6, instead of k6.io. We also had a purple icon making a bit jarring next to all the other orange-y ones. +As part of joining Grafana Labs in 2021, k6 was renamed to Grafana k6. The original k6 logo and branding was purple, which didn't fit very well next to the Grafana Labs orange logo and all its other products. -As such in this release we also got a new logo and the terminal banner has been redesigned to more closely match the current branding. +In this release, we have a new logo in a new color, and the terminal banner has been redesigned to match the current branding more closely.

Grafana k6 logo From abb23cff1f5f6b5921b1bd4a7ed87f518d66c5af Mon Sep 17 00:00:00 2001 From: ankur22 Date: Thu, 26 Sep 2024 08:30:47 +0100 Subject: [PATCH 35/41] Add most recent browser related fixes --- release notes/v0.54.0.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/release notes/v0.54.0.md b/release notes/v0.54.0.md index 07f019f1813..00bd79d479a 100644 --- a/release notes/v0.54.0.md +++ b/release notes/v0.54.0.md @@ -281,6 +281,9 @@ This process has been reworked to make things easier, and a few new usage report - [browser#1421](https://github.com/grafana/xk6-browser/pull/1421) fixes the navigation span by starting when the page starts to load so that it's a better representation of how long the test was on a page. - [browser#1408](https://github.com/grafana/xk6-browser/pull/1408), [browser#1422](https://github.com/grafana/xk6-browser/pull/1422) fixes the `page.reload` API so handles `null` responses without exceptions. - [browser#1435](https://github.com/grafana/xk6-browser/pull/1435) fixes an NPD when performing a `click` action. +- [browser#1438](https://github.com/grafana/xk6-browser/pull/1438) fixes a goroutine that waits indefinitely when writing to a channel. +- [#3968](https://github.com/grafana/k6/pull/3968) fixes an issue with the event system where it was dropping events which led to it hanging indefinitely. +- [browser#1442](https://github.com/grafana/xk6-browser/pull/1442) fixes `browser.close` to abort the cdp close request when the browser process has already exited. ## Maintenance and internal improvements From 83a656c85959eefce1725d32442e1fa1323e721f Mon Sep 17 00:00:00 2001 From: Oleg Bespalov Date: Thu, 26 Sep 2024 09:45:40 +0200 Subject: [PATCH 36/41] Apply suggestions from code review Co-authored-by: Heitor Tashiro Sergent --- release notes/v0.54.0.md | 1 + 1 file changed, 1 insertion(+) diff --git a/release notes/v0.54.0.md b/release notes/v0.54.0.md index 00bd79d479a..d314b54d2f9 100644 --- a/release notes/v0.54.0.md +++ b/release notes/v0.54.0.md @@ -1,6 +1,7 @@ k6 `v0.54.0` is here ๐ŸŽ‰! This release includes: - A new experimental CSV module +- New `k6 cloud` commands for local execution and upload script files - New ECMAScript features - Updated logo and branding From 92c120dc0916adbfbc1ec5d6d81328a4dbb21356 Mon Sep 17 00:00:00 2001 From: Oleg Bespalov Date: Thu, 26 Sep 2024 10:27:40 +0200 Subject: [PATCH 37/41] Apply code review suggestions, mentioning new PRs --- release notes/v0.54.0.md | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/release notes/v0.54.0.md b/release notes/v0.54.0.md index d314b54d2f9..b5a3a0db1f2 100644 --- a/release notes/v0.54.0.md +++ b/release notes/v0.54.0.md @@ -14,7 +14,7 @@ k6 `v0.54.0` is here ๐ŸŽ‰! This release includes: ## New features -### Branding changes and logo [`#3946`](https://github.com/grafana/k6/pull/3946), [`#3953`](https://github.com/grafana/k6/pull/3953) +### Branding changes and logo [`#3946`](https://github.com/grafana/k6/pull/3946), [`#3953`](https://github.com/grafana/k6/pull/3953), [`#3969`](https://github.com/grafana/k6/pull/3969) As part of joining Grafana Labs in 2021, k6 was renamed to Grafana k6. The original k6 logo and branding was purple, which didn't fit very well next to the Grafana Labs orange logo and all its other products. @@ -24,18 +24,6 @@ In this release, we have a new logo in a new color, and the terminal banner has Grafana k6 logo

-### New `k6 cloud run --local-execution` flag for local execution of cloud tests [`#3904`](https://github.com/grafana/k6/pull/3904), and [#3931](https://github.com/grafana/k6/pull/3931) - -This release introduces the `--local-execution` flag for the k6 cloud run command, allowing you to run test executions locally while sending metrics to Grafana Cloud k6. - -```bash -k6 cloud run --local-execution script.js -``` - -By default, using the `--local-execution` flag uploads the test archive to Grafana Cloud k6. If you want to disable this upload, use the `--no-archive-upload` flag. - -The `--local-execution` flag currently functions similarly to the `k6 run -o cloud` command, which is now considered deprecated (though it is not planned to be removed). Future updates will enhance `--local-execution` with additional capabilities that the `k6 run -o cloud` command does not offer. - ### New experimental CSV module for efficient CSV data handling [`#3743`](https://github.com/grafana/k6/pull/3743) Weโ€™ve added a new experimental CSV module to k6 for more efficient and convenient CSV parsing and streaming, addressing the limitations of preexisting JavaScript-based solutions like [papaparse](https://www.papaparse.com/). @@ -131,6 +119,18 @@ export default async function() {
+### New `k6 cloud run --local-execution` flag for local execution of cloud tests [`#3904`](https://github.com/grafana/k6/pull/3904), and [#3931](https://github.com/grafana/k6/pull/3931) + +This release introduces the `--local-execution` flag for the k6 cloud run command, allowing you to run test executions locally while sending metrics to Grafana Cloud k6. + +```bash +k6 cloud run --local-execution script.js +``` + +By default, using the `--local-execution` flag uploads the test archive to Grafana Cloud k6. If you want to disable this upload, use the `--no-archive-upload` flag. + +The `--local-execution` flag currently functions similarly to the `k6 run -o cloud` command, which is now considered deprecated (though it is not planned to be removed). Future updates will enhance `--local-execution` with additional capabilities that the `k6 run -o cloud` command does not offer. + ### New `k6 cloud upload` command for uploading test files to the cloud [`#3906`](https://github.com/grafana/k6/pull/3906) We continue to refine and improve the cloud service to improve how we handle uploading test files, so we've added a new `k6 cloud upload` command that replaces the `k6 cloud --upload-only` flag, which is now considered deprecated. @@ -301,7 +301,7 @@ This process has been reworked to make things easier, and a few new usage report - [#3933](https://github.com/grafana/k6/pull/3933) adds a `testutils.MakeMemMapFs` test helper facilitating simulating a file system in tests. - [#3943](https://github.com/grafana/k6/pull/3943) raises `TestStreamLogsToLogger` log sending delay to improve the reliability of tests. - [#3935](https://github.com/grafana/k6/pull/3935) refactors some js tests to remove repeated setup code. -- [#3903](https://github.com/grafana/k6/pull/3903), [#3912](https://github.com/grafana/k6/pull/3912), [#3928](https://github.com/grafana/k6/pull/3928), [#3910](https://github.com/grafana/k6/pull/3910), [#3954](https://github.com/grafana/k6/pull/3954), [#3963](https://github.com/grafana/k6/pull/3963) update dependencies. +- [#3903](https://github.com/grafana/k6/pull/3903), [#3912](https://github.com/grafana/k6/pull/3912), [#3928](https://github.com/grafana/k6/pull/3928), [#3910](https://github.com/grafana/k6/pull/3910), [#3954](https://github.com/grafana/k6/pull/3954), [#3963](https://github.com/grafana/k6/pull/3963), [#3965](https://github.com/grafana/k6/pull/3965), [#3966](https://github.com/grafana/k6/pull/3966), [#3965](https://github.com/grafana/k6/pull/3965), [#3970](https://github.com/grafana/k6/pull/3970) update dependencies. ## Roadmap From 2570cd968e7d9e3469fc636a76ef64a74d0c99a2 Mon Sep 17 00:00:00 2001 From: Oleg Bespalov Date: Thu, 26 Sep 2024 15:25:14 +0200 Subject: [PATCH 38/41] Apply suggestions from code review Co-authored-by: Heitor Tashiro Sergent --- release notes/v0.54.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release notes/v0.54.0.md b/release notes/v0.54.0.md index b5a3a0db1f2..90cda4f14f7 100644 --- a/release notes/v0.54.0.md +++ b/release notes/v0.54.0.md @@ -1,7 +1,7 @@ k6 `v0.54.0` is here ๐ŸŽ‰! This release includes: - A new experimental CSV module -- New `k6 cloud` commands for local execution and upload script files +- New `k6 cloud` commands for local execution and uploading script files - New ECMAScript features - Updated logo and branding From 774a42106ca3f8a434c0e449f8c263687c878852 Mon Sep 17 00:00:00 2001 From: Oleg Bespalov Date: Mon, 30 Sep 2024 09:53:39 +0200 Subject: [PATCH 39/41] Apply suggestions from code review Co-authored-by: Mihail Stoykov <312246+mstoykov@users.noreply.github.com> --- release notes/v0.54.0.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/release notes/v0.54.0.md b/release notes/v0.54.0.md index 90cda4f14f7..9e15eff0e4d 100644 --- a/release notes/v0.54.0.md +++ b/release notes/v0.54.0.md @@ -239,15 +239,22 @@ check(page, { ``` Check out [the `check` utility function's documentation](https://grafana.com/docs/k6/latest/javascript-api/jslib/utils/check/) for more information on how to use it. +### `k6/experimnetal/websockets` updates towards WebSockets API compatibility -### Support ArrayBufferViews in `send` for `k6/experimental/websockets` [#3944](https://github.com/grafana/k6/pull/3844) +#### Support ArrayBufferViews in `send` for `k6/experimental/websockets` [#3944](https://github.com/grafana/k6/pull/3844) As part of making `k6/experimental/websockets` compliant with the [WebSocket API](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket), it now supports Uint8Array and other ArrayBufferViews directly as arguments to `send`, instead of having to specifically provide their `buffer`. This should make the module more compliant with libraries that use the WebSocket API. Thanks to @pixeldrew for [reporting](https://github.com/grafana/xk6-websockets/issues/75) this. :bow: +#### `readyState` actually being a number [#3972](https://github.com/grafana/k6/pull/3972) +Due to goja/Sobek internal workings, `readyState` wasn't exactly a number in JavaScript code. This had some abnormal behavior, which limited interoperability with libraries. + +This has been fixed, and `readyState` is a regular number from the JavaScript perspective. + +Thanks to @dougw-bc for [reporting](https://github.com/grafana/xk6-websockets/issues/79) this. :bow: ### Rework of how usage is being collected internally and additional counters [`#3917`](https://github.com/grafana/k6/pull/3917) and [`#3951`](https://github.com/grafana/k6/pull/3951) From 88f6226f4714980c1a5247129eae876a6062e790 Mon Sep 17 00:00:00 2001 From: Oleg Bespalov Date: Mon, 30 Sep 2024 10:10:18 +0200 Subject: [PATCH 40/41] Apply suggestions from code review --- release notes/v0.54.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release notes/v0.54.0.md b/release notes/v0.54.0.md index 9e15eff0e4d..580bd67b415 100644 --- a/release notes/v0.54.0.md +++ b/release notes/v0.54.0.md @@ -210,7 +210,7 @@ await page.setChecked('#checkbox', true); // check the checkbox await page.setChecked('#checkbox', false); // uncheck the checkbox ``` -[Page](https://grafana.com/docs/k6/latest/javascript-api/k6-browser/page/setchecked/), [Frame](https://grafana.com/docs/k6/latest/javascript-api/k6-browser/frame/setchecked/), [ElementHandle](https://grafana.com/docs/k6/latest/javascript-api/k6-browser/elementhandle//setchecked/), and [Locator](https://grafana.com/docs/k6/latest/javascript-api/k6-browser/locator/setchecked/) now support the new `setChecked` method. +[Page](https://grafana.com/docs/k6/latest/javascript-api/k6-browser/page/setchecked/), [Frame](https://grafana.com/docs/k6/latest/javascript-api/k6-browser/frame/setchecked/), [ElementHandle](https://grafana.com/docs/k6/latest/javascript-api/k6-browser/elementhandle/setchecked/), and [Locator](https://grafana.com/docs/k6/latest/javascript-api/k6-browser/locator/setchecked/) now support the new `setChecked` method. ### Async `check` function utility [`k6-utils#13`](https://github.com/grafana/k6-jslib-utils/pull/13) From 1fa158700e331b168178ffc522e4023c8fab2bc1 Mon Sep 17 00:00:00 2001 From: Oleg Bespalov Date: Mon, 30 Sep 2024 10:42:15 +0200 Subject: [PATCH 41/41] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Joan Lรณpez de la Franca Beltran <5459617+joanlopez@users.noreply.github.com> --- release notes/v0.54.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release notes/v0.54.0.md b/release notes/v0.54.0.md index 580bd67b415..38735cb3f74 100644 --- a/release notes/v0.54.0.md +++ b/release notes/v0.54.0.md @@ -10,7 +10,7 @@ k6 `v0.54.0` is here ๐ŸŽ‰! This release includes: - [#3913](https://github.com/grafana/k6/pull/3913) changes the mapping of Golang's `math/big.Int` type to `bigint` type in k6. - [#3922](https://github.com/grafana/k6/pull/3922) removes `lib.Min` and `lib.Max` from k6's Go API, which could affect custom extensions that rely on these functions. - [#3838](https://github.com/grafana/k6/pull/3838) removes `k6/experimental/timers` - they are now available globally and no import is needed. -- [#3944](https://github.com/grafana/k6/pull/3844) updates to `k6/experimental/websockets` made the binaryType default value equal to "blob". With this change, `k6/experimental/websockets` is now compliant with the specification. +- [#3944](https://github.com/grafana/k6/pull/3944) updates to `k6/experimental/websockets`, which makes the `binaryType` default value equal to `"blob"`. With this change, `k6/experimental/websockets` is now compliant with the specification. ## New features