diff --git a/release notes/v1.0.0.md b/release notes/v1.0.0.md new file mode 100644 index 00000000000..c7581d8564c --- /dev/null +++ b/release notes/v1.0.0.md @@ -0,0 +1,139 @@ +k6 `v1.0.0` is here 🎉! + +After 9 years, 9k+ commits and 58 releases from the first commit in 2015, we're excited to announce that we're going to leave behind the `v0.x` series. Starting from now k6 aligns with the industry standard of following the semantic versioning scheme and will release this and future versions by following its new stability policy. + +This release includes: + +- Native support for extensions in the Cloud +- New test failure control with `execution.test.fail` +- Documentation for the stability guarantees + +## New features + +### Native support for extensions in the Cloud [#4670](https://github.com/grafana/k6/pull/4671) + +The new Binary provisioning feature automatically requests and uses custom k6 binaries with the required extensions for your tests. This allows you to run scripts that use extensions without manually rebuilding k6 as it was in the past by depending on tools like `xk6`. The system caches binaries locally for efficiency, and any additional runs with the same dependencies will use the same binary and will run faster. + +Binary provisioning is available for all k6 Cloud users (free and paid plans), and it's enabled by opt-in with the feature flag `K6_BINARY_PROVISIONING=true`. + +Binary provisioning is a limited set of extensions that are supported, and it's not available for the `k6 run` command that might be added in the future. However, local development is supported with the `k6 cloud --local-execution` command if a cloud token is provided by the canonical login methods. + +### Test failure control with `execution.test.fail` [#4672](https://github.com/grafana/k6/pull/4672) + +The new `execution.test.fail` function enables controlled test failure reporting without interrupting the test execution. When called, this method marks the entire test run as failed while allowing all iterations to complete normally. The test will exit with code `110`, making failures detectable by external systems. This provides graceful error handling for scenarios akin to [functional testing](https://github.com/grafana/k6-jslib-testing). + +For example, the following script: +```javascript +import http from "k6/http"; +import exec from "k6/execution"; + +export const options = { + iterations: 10, +}; + +export default function () { + http.get("https://quickpizza.grafana.com"); + + if (exec.vu.iterationInInstance === 3) { + exec.test.fail(`iteration ${exec.vu.iterationInInstance}: marked the test as failed`); + } + + console.log(`iteration ${exec.vu.iterationInInstance} executed`); +} +``` + +When ran: +```bash +k6 run script.js; echo $? +``` + +Will return with exit code `110` and the ending of its output will display the following messages: +``` +ERRO[0001] test run was marked as failed +k6 exited with status: 110 +``` + +
+ +Expand below to see the full output for the example: + +``` + /\ Grafana /‾‾/ + /\ / \ |\ __ / / + / \/ \ | |/ / / ‾‾\ + / \ | ( | (‾) | + / __________ \ |_|\_\ \_____/ + + execution: local + script: script.js + output: - + + scenarios: (100.00%) 1 scenario, 1 max VUs, 10m30s max duration (incl. graceful stop): + * default: 10 iterations shared among 1 VUs (maxDuration: 10m0s, gracefulStop: 30s) + +INFO[0000] iteration 0 executed source=console +INFO[0000] iteration 1 executed source=console +INFO[0000] iteration 2 executed source=console +ERRO[0000] iteration 3: marked the test as failed +INFO[0000] iteration 3 executed source=console +INFO[0001] iteration 4 executed source=console +INFO[0001] iteration 5 executed source=console +INFO[0001] iteration 6 executed source=console +INFO[0001] iteration 7 executed source=console +INFO[0001] iteration 8 executed source=console +INFO[0001] iteration 9 executed source=console + + + █ TOTAL RESULTS + + HTTP + http_req_duration.......................................................: avg=129.22ms min=127.9ms med=129.17ms max=130.83ms p(90)=130.51ms p(95)=130.67ms + { expected_response:true }............................................: avg=129.22ms min=127.9ms med=129.17ms max=130.83ms p(90)=130.51ms p(95)=130.67ms + http_req_failed.........................................................: 0.00% 0 out of 10 + http_reqs...............................................................: 10 5.763858/s + + EXECUTION + iteration_duration......................................................: avg=173.46ms min=128.07ms med=129.43ms max=569.82ms p(90)=174.89ms p(95)=372.36ms + iterations..............................................................: 10 5.763858/s + vus.....................................................................: 1 min=1 max=1 + vus_max.................................................................: 1 min=1 max=1 + + NETWORK + data_received...........................................................: 32 kB 19 kB/s + data_sent...............................................................: 1.0 kB 601 B/s + +running (00m01.7s), 0/1 VUs, 10 complete and 0 interrupted iterations +default ✓ [======================================] 1 VUs 00m01.7s/10m0s 10/10 shared iters +ERRO[0001] test run was marked as failed +k6 exited with status: 110 +``` + +
+ +## UX improvements and enhancements + +- [#4698](https://github.com/grafana/k6/pull/4698) Displays threshold values even when are not configured in `summaryTrendStats` option. +- [#4699](https://github.com/grafana/k6/pull/4699) Drops the link of the legacy k6 website from the user agent. + +## Bug fixes + +- [#4717](https://github.com/grafana/k6/pull/4717) Safeguards against `pressedKeys` being updated concurrently in browser module. Also empty struct instead of a bool for a set in browser module. +- [#4665](https://github.com/grafana/k6/pull/4665) Prevents race condition between `Ended` & `Interrupted` execution states. +- [#4677](https://github.com/grafana/k6/pull/4677) Makes `secretsource` also redact `float32` and `float64` values. +- [#4716](https://github.com/grafana/k6/pull/4716) Fix race where browser worker were added/removed concurrently. + +## Maintenance and internal improvements + +- [#4675](https://github.com/grafana/k6/pull/4675), [#4676](https://github.com/grafana/k6/pull/4676), [#4678](https://github.com/grafana/k6/pull/4678) Move several packages to `internal` as preparations for v1.0.0 stabilization +- [#4686](https://github.com/grafana/k6/pull/4686) Drops the redundant `NO_COLOR` detection. +- [#4709](https://github.com/grafana/k6/pull/4709) Fixes JS native objects override to avoid a page under the test from overwriting native JavaScript objects, like `Set` and `Map`. +- [#4726](https://github.com/grafana/k6/pull/4726) Unifies the internal/cmd.Execute methods. +- [#4669](https://github.com/grafana/k6/pull/4669) Do not report runs during tests. +- [#4693](https://github.com/grafana/k6/pull/4693) Bumps OTel dependency. +- [#4691](https://github.com/grafana/k6/pull/4691) Bumps x509roots/fallback dependency. +- [#4701](https://github.com/grafana/k6/pull/4701) Fixes WebCrypto errors not propagating from the tests. +- [#4703](https://github.com/grafana/k6/pull/4703) Makes wptTests run without tags or skip if repos not checkout. +- [#4674](https://github.com/grafana/k6/pull/4674) Bumps the golangx group across 1 directory with 6 updates. +- [#4673](https://github.com/grafana/k6/pull/4673) Bumps google.golang.org/grpc in the googles group. +- [#4663](https://github.com/grafana/k6/pull/4663) Bumps github.com/evanw/esbuild from 0.25.1 to 0.25.2. +- [#4739](https://github.com/grafana/k6/pull/4739) Removes deprecated `GetLayoutMetrics.VisualViewport` CDP usage.