Skip to content

Commit

Permalink
Merge 1678be8 into 4c1b2bd
Browse files Browse the repository at this point in the history
  • Loading branch information
ka3de authored Aug 10, 2023
2 parents 4c1b2bd + 1678be8 commit fad6c81
Showing 1 changed file with 68 additions and 0 deletions.
68 changes: 68 additions & 0 deletions release notes/v0.46.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,49 @@ k6 `v0.46` is here 🎉! This release includes:
- `#pr`, `<small_break_1>`
- `#pr`, `<small_break_2>`

### Browser

In this release, xk6-browser extension version is bumped up to `v1.0.2`, as it includes multiple breaking changes in relation with options, browser lifecycle and metrics.

**Options** `devtools`, `env` and `proxy` are deprecated ([browser#868](https://github.com/grafana/xk6-browser/pull/868), [browser#870](https://github.com/grafana/xk6-browser/pull/870), [browser#872](https://github.com/grafana/xk6-browser/pull/872)). Additionally, browser `launch`/`connect` options are no longer defined in the corresponding JS API methods, instead the test execution related options are now defined inside the browser scenario options (see [#3036](https://github.com/grafana/k6/pull/3036)), and the other more "environmental options", such as `headless`, `debug`, `executablePath`, are set as ENV vars. Also `slowMo` option is no longer supported, although it might be supported again in the future through a different API ([browser#876](https://github.com/grafana/xk6-browser/pull/876)).

**Metrics** also went through a few changes. The Web Vitals metrics are renamed to use `browser_` prefix and short namings (e.g.: `webvital_first_input_delay` -> `browser_web_vital_fid`) ([browser#885](https://github.com/grafana/xk6-browser/pull/885), [browser#903](https://github.com/grafana/xk6-browser/pull/903)), and the rating metric is removed, as it is now set as a label in the corresponding Web Vitals metrics ([browser#915](https://github.com/grafana/xk6-browser/pull/915))
The browser HTTP metrics have also been modified, as these are now split from the HTTP module ones, so there are new `browser_` prefixed HTTP metrics, specifically for request duration and failed requests ([browser#916](https://github.com/grafana/xk6-browser/pull/916)).

Another big change introduced in this version affects the way the **browser lifecycle** is handled. Now the users no longer have to explicitly initialize/close the browser instance through the JS API. Instead a browser instance will be automatically initialized/closed at the beginning/end of each iteration if the browser type is set in scenario options (see [#3036](https://github.com/grafana/k6/pull/3036)). This also implies that the `chromium` entity from `k6/experimental/browser` import path is no longer valid, instead the `browser` entity provides access to the browser methods such as `browser.newPage()` ([browser#910](https://github.com/grafana/xk6-browser/pull/910), [browser#944](https://github.com/grafana/xk6-browser/pull/944)). This change implies that the `browser.on()` method is no longer applicable, and therefore it has been removed ([browser#919](https://github.com/grafana/xk6-browser/pull/919)).

Following with **import changes**, the browser module version is no longer an exported field ([browser#923](https://github.com/grafana/xk6-browser/pull/923)).

Last but not least, this release also includes constraints on **browser contexts** usage as now only one `browserContext` is allowed per iteration, which means that the user can create a new `browserContext`, close it, and then create it again; but can not have more than one "live" `browserContext`. Instead, [scenarios](https://k6.io/docs/using-k6/scenarios/) should be used to separate independent actions in a test ([browser#929](https://github.com/grafana/xk6-browser/pull/929), [browser#945](https://github.com/grafana/xk6-browser/pull/945)).

With all these changes, a simple browser test now looks like:
```js
import { browser } from 'k6/experimental/browser';

export const options = {
scenarios: {
ui: {
executor: 'shared-iterations',
options: {
browser: {
type: 'chromium', // chromium is the only supported browser type so as long as
// the option is set, Chromium/Google Chrome will be used
},
},
},
},
};

export default async function () {
const page = browser.newPage();
try {
await page.goto('https://grafana.com')
} finally {
page.close();
}
}
```

### (_optional h3_) `<big_breaking_change>` `#pr`

## New features
Expand Down Expand Up @@ -108,6 +151,9 @@ _Format as `<number> <present_verb> <object>. <credit>`_:
- [#3176](https://github.com/grafana/k6/pull/3176) Adds a `js/promises` package, which enables extension developers to easily create promises that will be dispatched to the eventloop using the `New` function.
- [#3181](https://github.com/grafana/k6/pull/3181) Adds a `RunOnEventLoop` method to the `modulestest.Runtime` type, which allows extensions developers to run code on the event loop from their tests.
- [#xk6-grpc#19](https://github.com/grafana/xk6-grpc/pull/19) Writing to the closed GRPC stream no longer produce the EOF (end of file) error. Additionally, if no errors' handler were set up. The error is logged to the console.
- [browser#881](https://github.com/grafana/xk6-browser/pull/881) Adds a new `browser_http_req_failed` metric.
- [browser#901](https://github.com/grafana/xk6-browser/pull/901) Adds support for shadow DOM piercing in `locator`. Thanks to @tmc for its implementation.
- [browser#953](https://github.com/grafana/xk6-browser/pull/953) Improves Web Vitals reporting for better accuracy and consistency.

## Bug fixes

Expand All @@ -116,6 +162,12 @@ _Format as `<number> <present_verb> <object>. <credit>`_:
- [#3231](https://github.com/grafana/k6/pull/3231) Fixes the tracing module sampling option to default to 1.0 when not set by the user.
- [#3163](https://github.com/grafana/k6/pull/3163) Fixes our gRPC example.
- [#3196](https://github.com/grafana/k6/pull/3196) Logs packages lint fixes, and test for loki flushing at end.
- [browser#866](https://github.com/grafana/xk6-browser/pull/866) Disables the timeout on browser process execution.
- [browser#942](https://github.com/grafana/xk6-browser/pull/942) Fixes deadlock in `frameNavigated`.
- [browser#943](https://github.com/grafana/xk6-browser/pull/943) Fixes a race condition in navigation and lifecycle events.
- [browser#979](https://github.com/grafana/xk6-browser/pull/979) Fixes a deadlock on `pagehide` event evaluation when `page.close()` is called.
- [browser#980](https://github.com/grafana/xk6-browser/pull/980) Fixes Loki log output for console log serializer.
- [browser#991](https://github.com/grafana/xk6-browser/pull/991) Fixes data directory not being cleared during `browser.close()` panic.

## Maintenance and internal improvements

Expand All @@ -125,6 +177,22 @@ _Format as `<number> <present_verb> <object>. <credit>`_:
- [#3136](https://github.com/grafana/k6/pull/3136) Updates k6 Go dependencies.
- [#3131](https://github.com/grafana/k6/pull/3131) Updates our Pull Request template to be more structured and include a checklist for contributors.
- [#3177](https://github.com/grafana/k6/pull/3177) Updates the version of golangci-lint we use to the latest version.
- [browser#849](https://github.com/grafana/xk6-browser/pull/849) Updates `nil` session log warn to debug level in page attach.
- [browser#889](https://github.com/grafana/xk6-browser/pull/889) Refactors `isRemoteBrowser` check.
- [browser#889](https://github.com/grafana/xk6-browser/pull/899) Refactors pid registry.
- [browser#902](https://github.com/grafana/xk6-browser/pull/902) Refactors registry back into browser package.
- [browser#904](https://github.com/grafana/xk6-browser/pull/904) Fixes a race condition in Web Vitals unit test.
- [browser#906](https://github.com/grafana/xk6-browser/pull/906) Parses the scenarios JSON definition from the `K6_INSTANCE_SCENARIOS` environment variable.
- [browser#918](https://github.com/grafana/xk6-browser/pull/918) Replaces the usage of `os.LookupEnv` for k6 `LookupEnv` and abstracts environment variables lookup.
- [browser#935](https://github.com/grafana/xk6-browser/pull/935) Refactors the integration test browser implementation.
- [browser#936](https://github.com/grafana/xk6-browser/pull/936) Removes the `BaseEventEmitter` from browser.
- [browser#959](https://github.com/grafana/xk6-browser/pull/959) Fixes `TestFrameNoPanicNavigateAndClickOnPageWithIFrames` test.
- [browser#972](https://github.com/grafana/xk6-browser/pull/972) Fixes log level from `warn` to `debug` when `fetchBody` fails due to `context` being canceled on iteration end.
- [browser#977](https://github.com/grafana/xk6-browser/pull/977) Removes goroutine ID field from logger.
- [browser#978](https://github.com/grafana/xk6-browser/pull/978) Adds browser extension source log field.
- [browser#983](https://github.com/grafana/xk6-browser/pull/983) Avoids `onRequestPaused` error log when `context` is canceled.
- [browser#984](https://github.com/grafana/xk6-browser/pull/984) Ensures CDP requests message ID are unique at the connection scope.
- [browser#992](https://github.com/grafana/xk6-browser/pull/992) Fixes go mod prometheus dependency issue.

## _Optional_ Roadmap

Expand Down

0 comments on commit fad6c81

Please sign in to comment.