-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
v0.47.0.md
104 lines (69 loc) · 6.98 KB
/
v0.47.0.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
k6 `v0.47.0` is here 🎉! This release includes:
- (_optional_) `<highlight of breaking changes>`
- `<Summary of new features>` (_one or multiple bullets_)
## Breaking changes
- `#pr`, `<small_break_1>`
- `#pr`, `<small_break_2>`
### (_optional h3_) `<big_breaking_change>` `#pr`
## New features
_optional intro here_
### `<big_feature_1>` `#pr`
_what, why, and what this means for the user_
### `<big_feature_n>` `#pr`
_what, why, and what this means for the user_
### Add gRPC's binary metadata support [#3234](https://github.com/grafana/k6/pull/3234), [xk6-grpc#46](https://github.com/grafana/xk6-grpc/pull/46)
By specification gRPC metadata with the `-bin` postfix should be treated as binary data. These PRs add the support of such metadata to the `k6/net/grpc` and `k6/experimental/grpc` modules.
```js
let resp = client.invoke("grpc.testing.TestService/EmptyCall", {}, { metadata: { "X-Load-Tester-bin": new Uint8Array([2, 200]) } })
```
Thanks, @sapphire-janrain, for contribution!
### Add the reflection metadata [#3343](https://github.com/grafana/k6/pull/3343), [xk6-grpc#46](https://github.com/grafana/xk6-grpc/pull/46)
In some workflows the reflection call should also include some metadata. This PR adds [a new connection parameter `reflectMetadata`](https://k6.io/docs/javascript-api/k6-net-grpc/client/client-connect/#connectparams) that allows to specify the metadata to be sent with the reflection call.
### Improved the browser module's cookie API
The browser module now provides a more complete and robust API for handling cookies. We stabilized the cookie API by defining a new [`Cookie` class](https://k6.io/docs/javascript-api/k6-experimental/browser/browsercontext/cookie) ([browser#1008](https://github.com/grafana/xk6-browser/pull/1008), [browser#1030](https://github.com/grafana/xk6-browser/pull/1030)) that can be used while creating and retrieving cookies.
We added a new [`browserContext.cookies([urls])`](https://k6.io/docs/javascript-api/k6-experimental/browser/browsercontext/cookies/) ([browser#1005](https://github.com/grafana/xk6-browser/pull/1005)) method that returns all cookies from the current [browser context](https://k6.io/docs/javascript-api/k6-experimental/browser/browsercontext). The new API also supports filtering cookies by URL ([browser#1016](https://github.com/grafana/xk6-browser/pull/1016)). We also fixed a bug where the `expires` field was not being set correctly while adding cookies using the [`context.addCookie()`](https://k6.io/docs/javascript-api/k6-experimental/browser/browsercontext/addcookies/) method. Lastly, we fixed the existing [`context.clearCookies()`](https://k6.io/docs/javascript-api/k6-experimental/browser/browsercontext/clearcookies) method to clear all cookies from the current [browser context](https://k6.io/docs/javascript-api/k6-experimental/browser/browsercontext).
```js
const context = browser.newContext();
context.addCookies([
{name: 'foo', value: 'bar', url: 'https://test.k6.io'},
{name: 'baz', value: 'qux', url: 'https://grafana.com'},
]);
const cookies = context.cookies('https://test.k6.io');
console.log(cookies.length); // 1
console.log(cookies[0].name); // foo
console.log(cookies[0].value); // bar
context.clearCookies();
console.log(context.cookies.length); // 0
```
### Add support for browser module's `page.on('console')` [browser#1006](https://github.com/grafana/xk6-browser/pull/1006)
Allows users to register a handler to be executed every time the `console` API methods are called from within the page's JavaScript context. The arguments passed into the handler are defined by the (ConsoleMessage)[https://k6.io/docs/javascript-api/k6-experimental/browser/consolemessage/] class.
### UX improvements and enhancements
_Format as `<number> <present_verb> <object>. <credit>`_:
- [#3338](https://github.com/grafana/k6/pull/3338) and [xk6-grpc#48](https://github.com/grafana/xk6-grpc/pull/48). Adds a support of the v1 of the gRPC reflection protocol.
- [browser#1035](https://github.com/grafana/xk6-browser/pull/1035) Refactor `int64` timeout to `time.Duration` which ensures no confusion as to whether a timeout is in milliseconds or seconds.
- [browser#1007](https://github.com/grafana/xk6-browser/pull/1007) Inject `window.k6 = {};` to help identify k6 browser module tests.
- [browser#1022](https://github.com/grafana/xk6-browser/pull/1022) Refactor the `check` in `examples/fillform.js` so that it matches the type definitions and documentation for `check`.
- _`#999` Gives terminal output prettier printing. Thanks to `@person` for the help!_
- `#pr` `<description>`
- `#pr` `<description>`
## Bug fixes
- [xk6-grpc#47](https://github.com/grafana/xk6-grpc/pull/47) fix the premature closing of the stream when a stream's client has finished sending. Thanks, @thiagodpf, for reporting!
- [#3344](https://github.com/grafana/k6/pull/3344) and [xk6-grpc#49](https://github.com/grafana/xk6-grpc/pull/49) adds (fixes) the support of google protobuf wrappers. Thanks, @zibul444, for reporting!
- [browser#1040](https://github.com/grafana/xk6-browser/pull/1040) fix the `context.clearCookies()` method to clear all cookies from the current browser context.
- [browser#1031](https://github.com/grafana/xk6-browser/pull/1031) fix the `expires` field while adding cookies using the `context.addCookie()` method.
- [browser#1039](https://github.com/grafana/xk6-browser/pull/1039) fix Goja conversions while adding and retrieving cookies.
- [browser#1038](https://github.com/grafana/xk6-browser/pull/1038) Fix read/write data race for edge case with remote browsers.
- [browser#1034](https://github.com/grafana/xk6-browser/pull/1034) Fix `page.reload` & `page.setContent` to use the default navigation timeout over the default timeout.
- [browser#1033](https://github.com/grafana/xk6-browser/pull/1033) Fix the `page` timeouts so it is actually used after being set.
## Maintenance and internal improvements
_Format as `<number> <present_verb> <object>. <credit>`_:
- _`#2770` Refactors parts of the JS module._
- [#3342](https://github.com/grafana/k6/pull/3342). Updates xk6-grpc to the latest version. This change brings all the latest fixes and improvements to the experimental gRPC module.
- [browser#1043](https://github.com/grafana/xk6-browser/pull/1043), [browser#1021](https://github.com/grafana/xk6-browser/pull/1021), [browser#1019](https://github.com/grafana/xk6-browser/pull/1019), [browser#1014](https://github.com/grafana/xk6-browser/pull/1014) Fix tests.
- [browser#1000](https://github.com/grafana/xk6-browser/pull/1000), [browser#1024](https://github.com/grafana/xk6-browser/pull/1024) Refine issue and PR templates.
- [browser#1003](https://github.com/grafana/xk6-browser/pull/1003) Internal refactor.
- [browser#997](https://github.com/grafana/xk6-browser/pull/997) Update readme.
- [browser#962](https://github.com/grafana/xk6-browser/pull/962) CI fixes.
- [browser#1009](https://github.com/grafana/xk6-browser/pull/1009), [browser#1010](https://github.com/grafana/xk6-browser/pull/1010) Supporting internal changes.
## _Optional_ Roadmap
_Discussion of future plans_