-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update dependency grafana/k6 to v0.52.0 #749
Conversation
|
1 similar comment
|
* Chore(deps): Bump google.golang.org/grpc from 1.63.2 to 1.64.0 * grpc: nolint deprecated grpc options * Build(deps): Bump the prometheus-go group across 1 directory with 2 updates * http: rename `promconfig.Header` to `promconfig.ProxyHeader` * Add the basic stuff to support a browser check type (#737) * k6runner/test: ensure logs are sent to loki when runner reports user errors * k6runner: send logs even if metrics are malformed * Build(deps): Bump github.com/prometheus/common * Bump k6 version using renovate (#745) * Dispatch renovate workflow manually (#746) * Update renovate (#748) * Update dependency grafana/k6 to v0.52.0 (#749) * Fix renovate configuration (#751) * Update github.com/grafana/loki/pkg/push digest to 04bc3a4 (#752) * Update module github.com/dmarkham/enumer to v1.5.10 (#754) * Update module github.com/sirupsen/logrus to v1.9.3 (#755) * Update module github.com/stretchr/testify to v1.9.0 (#759) * Update dependency grafana/grafana-build-tools to v0.15.0 (#756) * Correct the listen address to scrape metrics to port 4050. (#743) * Build(deps): Bump google.golang.org/grpc from 1.64.0 to 1.65.0 * Update module github.com/securego/gosec to v2 * Split and fix renovate config (#767) * Update ghcr.io/grafana/grafana-build-tools Docker tag to v0.15.1 (#770) * add validation case for browser (#773) * Update module gotest.tools/gotestsum to v1.12.0 * Update module go.k6.io/k6 to v0.52.0 * Update golang.org/x/exp digest to 7f521ea * Update module golang.org/x/net to v0.27.0 (#775) * Update module github.com/securego/gosec to v2 * Update module gotest.tools/gotestsum to v1.12.0 * Update module github.com/spf13/afero to v1.11.0 (#758) * Update module github.com/golangci/golangci-lint to v1.59.1 * Update github.com/grafana/loki/pkg/push digest to 6da364e * Update module github.com/securego/gosec to v2 * Route browser checks to the browser prober (#780) * Update module google.golang.org/grpc to v1.65.0 (#761) * ci/renovate: limit gomod digest updates to once every two weeks (#785) * Update golang.org/x/exp digest to 46b0784 (#781) * cmd: default to sm-k6 binary * Dockerfile: copy sm-specific k6 as sm-k6 instead of just k6 * k6runner/test: pass address of expectErrorAs to errors.As * k6runner: log errors encountered by logfmt parser * Update github.com/grafana/loki/pkg/push digest to 7c86e65 * Add browser limits and class (#787) * Update module github.com/prometheus/prometheus to v0.53.1 (#790) * Report browser check's class as browser (#788) * Update github.com/grafana/loki/pkg/push digest to 527510d (#793) * Update github.com/securego/gosec/v2 digest to 4487a0c Signed-off-by: Ro Santalla <[email protected]>
* Chore(deps): Bump google.golang.org/grpc from 1.63.2 to 1.64.0 * grpc: nolint deprecated grpc options * Build(deps): Bump the prometheus-go group across 1 directory with 2 updates * http: rename `promconfig.Header` to `promconfig.ProxyHeader` * Add the basic stuff to support a browser check type (#737) * k6runner/test: ensure logs are sent to loki when runner reports user errors * k6runner: send logs even if metrics are malformed * Build(deps): Bump github.com/prometheus/common * Bump k6 version using renovate (#745) * Dispatch renovate workflow manually (#746) * Update renovate (#748) * Update dependency grafana/k6 to v0.52.0 (#749) * Fix renovate configuration (#751) * Update github.com/grafana/loki/pkg/push digest to 04bc3a4 (#752) * Update module github.com/dmarkham/enumer to v1.5.10 (#754) * Update module github.com/sirupsen/logrus to v1.9.3 (#755) * Update module github.com/stretchr/testify to v1.9.0 (#759) * Update dependency grafana/grafana-build-tools to v0.15.0 (#756) * Correct the listen address to scrape metrics to port 4050. (#743) * Build(deps): Bump google.golang.org/grpc from 1.64.0 to 1.65.0 * Update module github.com/securego/gosec to v2 * Split and fix renovate config (#767) * Update ghcr.io/grafana/grafana-build-tools Docker tag to v0.15.1 (#770) * add validation case for browser (#773) * Update module gotest.tools/gotestsum to v1.12.0 * Update module go.k6.io/k6 to v0.52.0 * Update golang.org/x/exp digest to 7f521ea * Update module golang.org/x/net to v0.27.0 (#775) * Update module github.com/securego/gosec to v2 * Update module gotest.tools/gotestsum to v1.12.0 * Update module github.com/spf13/afero to v1.11.0 (#758) * Update module github.com/golangci/golangci-lint to v1.59.1 * Update github.com/grafana/loki/pkg/push digest to 6da364e * Update module github.com/securego/gosec to v2 * Route browser checks to the browser prober (#780) * Update module google.golang.org/grpc to v1.65.0 (#761) * ci/renovate: limit gomod digest updates to once every two weeks (#785) * Update golang.org/x/exp digest to 46b0784 (#781) * cmd: default to sm-k6 binary * Dockerfile: copy sm-specific k6 as sm-k6 instead of just k6 * k6runner/test: pass address of expectErrorAs to errors.As * k6runner: log errors encountered by logfmt parser * Update github.com/grafana/loki/pkg/push digest to 7c86e65 * Add browser limits and class (#787) * Update module github.com/prometheus/prometheus to v0.53.1 (#790) * Report browser check's class as browser (#788) * Update github.com/grafana/loki/pkg/push digest to 527510d (#793) * Update github.com/securego/gosec/v2 digest to 4487a0c Signed-off-by: Ro Santalla <[email protected]>
This PR contains the following updates:
v0.50.0
->v0.52.0
Release Notes
grafana/k6 (grafana/k6)
v0.52.0
Compare Source
k6
v0.52.0
is here 🎉! Some special mentions included in this release:goja
namedsobek
.k6/browser
has graduated from an experimental module, and now has a fully Async API.Breaking changes
Switch
goja
to our own fork namedsobek
#3775To accelerate the development speed and bring ECMAScript Modules (ESM) support to k6 earlier (https://github.com/grafana/k6/issues/3265),
we have decided to create a fork of the
goja
project under the Grafana GitHub organization,named
sobek
.Starting on this release, k6 (and its extensions) now use
sobek
instead of the originalgoja
, for all (of thepublicly exposed parts of the API) except for a couple of packages that are only used internally by k6.
All k6 extensions linked in the docs have had a PR for this transition opened, as explained in this comment. Any extension author who hasn't gotten a PR can follow the same steps.
Find further details in #3772 and #3773.
Panics are no longer being captured #3777
Since this release, Go panics are no longer being captured by k6. This means that if a panic occurs while running a test,
the k6 process will crash, and the panic stack trace will be printed to the console.
We decided to change this behavior because it's something that was left from the past as a safeguard, but it's not as
good as it might seem. For most cases with multiple goroutines/async, it's not enough and also makes a bunch of potential
bugs seem like less of an issue.
Thus, this will help us to identify and fix bugs earlier, improve the overall stability of k6, and
most likely make the experience of developing k6 extensions friendlier.
lib.State
no longer hasGroup
#3750As the result of refactoring the implementation of
group
andcheck
methods, in order to decouple them, and thusenable other future improvements, the
lib.State
object no longer has aGroup
field.This change should not affect most users, except for a couple of extensions, for which the use of
Group
wasalready questionable:
xk6-fasthttp
xk6-g0
Other breaking changes
-
as a special value for--archive-out
to output the archive to stdout.Mouse.up
andMouse.down
methods no longer take x and y coordinates. Instead, they dispatch events on the current mouse position.New features
Experimental support for TypeScript and ES6+ using esbuild #3738
This release of k6 introduces experimental support for TypeScript and ES6+ using esbuild, thanks to a new
compatibility mode named
experimental_enhanced
.With this new compatibility mode, the test source code is transformed using esbuild instead of Babel, which also means
that source files with the extension ".ts" are loaded by esbuild's TypeScript loader, which results in partial
TypeScript support: it removes the type information but doesn't provide type safety.
k6/browser
has graduated from an experimental module #3793The browser module is now available as
k6/browser
instead ofk6/experimental/browser
. The previousk6/experimental/browser
module will be removed on September 23rd, 2024. Refer to the migration guide for more information on how to update your scripts.k6/browser
has now a fully Async API browser#428This release introduces a fully Async API for the
k6/browser
module. This means that nearly all the methods in the module now return promises. This change is part of the ongoing effort to make the browser module more user-friendly and easier to use. Please see the browser documentation for more information on how to use the new Async API.Related Changes:
Browser
,BrowserContext
,ElementHandle
,Frame
,JSHandle
,Keyboard
,Locator
,Mouse
,Page
,Request
,Response
APIs to async.UX improvements and enhancements
ReadableStream
objects from Go code (io.Reader
).warn
todebug
for cases when k6 can't detect the terminal's size.-
as the--archive-out
. Thanks to @roobre! 🙇 🎉GetAttribute
method now returnfalse
when the attribute is missing, making it easier to check for the presence of an attribute.TextContent
method now returnfalse
when the element's text content cannot be grabbed (like a JSdocument
), making it easier to check for the presence of text content.Request.headerValue
andResponse.headerValue
to be case-insensitive.await
usage in Javascript examples.BrowserContext.browser
andPage.context
mappings.Browser
,BrowserContext
,ElementHandle
,JSHandle
,Keyboard
,Mouse
,Locator
, andPage
types' panics into errors for stability and better error handling.Bug fixes
require
warning for those tests using the stdin.valueFromRemoteObject
null
detection by returning a Gonil
instead of"null"
as astring
.JSHandle.evaluate
andJSHandle.evaluateHandle
both set themselves as the first argument.Request
mappings.Mouse.move
to correctly dispatch adown
event.Maintenance and internal improvements
goja
stack traces on panics, which has been empty since a while.Group
andTag
usage for the latest k6.version
anduserAgent
methods are called. This change allows the browser module to expose these methods as a sync API to be consistent with the Playwright's API.goja
fork calledsobek
in the browser module.Roadmap
Native ECMAScript modules
As mentioned above, the k6 team has forked
goja
intosobek
and is currently working on native ECMAScript modules support. The current work in progress can be found in this PR and any feedback is welcome.As part of that there likely will be some breaking changes due to the current not native support allowing stuff that shouldn't work. Like for example mixing CommonJS and ESM in the same file. Which is for example why we have added a warning that it won't work.
Support across multiple files is also not standard but due to amount of users that seems to be mixing them across files a lot of work has been done to support it. It is still likely that in the future warnings and potentially at some point future breaking changes will be enacted.
OpenTelemetry metrics output
We're also happy to share that this release cycle, we've been working on xk6-output-opentelemetry, a k6 output extension that allows you to send k6 metrics to OpenTelemetry-compatible backends. We're looking for feedback from the community. If you're interested, please try it and let us know via the extension repository!
Depending on the feedback, we plan to include this extension as an experimental output in the next k6 release.
v0.51.0
Compare Source
k6
v0.51.0
is here 🎉! Some special mentions included in this release:Breaking changes
Transition browser APIs to Async
In the last release notes we mentioned this breaking change, and we wanted to remind and update you on the plan. In the next release (v0.52.0), most of the synchronous browser APIs will be migrated to be asynchronous (promisifying them). We expect this will affect most if not all of our users.
This breaking change will require you to add
await
in front of most of the browser module APIs. Without thisawait
you will witness undocumented and unknown behavior during the runtime. To make the migration simpler we advise that you work with the latest k6 type definitions.You can find a list of all the APIs that we expect to convert to async in a comment in issue browser#428.
Awaiting on something that’s not a thenable just returns that value, which means you can add the
await
keyword today on the APIs that will become async to future proof your test scripts.Here are the reasons for making this large breaking change:
As a starting point, we have migrated a single API (the
tap
method), which you can find the details below that will help visualize the upcoming breaking changes.Browser
Tap
is now an async method grafana/xk6-browser#1268This release converts the
Tap
method in thebrowser
module into an asynchronous method. This change is necessary to ensure that the method can be used in async contexts and to align with the rest of the browser module's planned asynchronous API. To use theTap
method, you must now add theawait
keyword before the method call.Affected components:
locator.tap
page.tap
frame.tap
elementHandle.tap
See the following example for how to use the
Tap
method after this change:Before:
After:
k6/experimental/websockets
will not defaultbinaryType
to `"arraybuffer"'As part of the stabilization of the API it needs to become as close to the specification.
Early in the development the idea of adding
Blob
support as part was deemed feature creep and was dropped in favor of going with only"arraybuffer"
. But the specification defaults to returning binary responses asBlob
- which was another thing that was changed.While adding
Blob
is still on our radar, moving the default is always going to be a breaking change that we need to do to align with the specification.For this release there is now a warning that will be printed if
binaryType
is not set to"arraybuffer"
and a binary response is received. The warning will go away whenbinaryType
is set to"arraybuffer"
.In the next release the warning will become an error.
More info and place for discussion can be found in an this issue.
k6/experimental/grpc
is no longer available #3530As the last step of the graduation process for the experimental gRPC module, we completely removed the module. It is now fully integrated into the stable
k6/net/grpc
module. So, if you haven't done this yet, replace your imports fromk6/experimental/grpc
tok6/net/grpc
.Deprecations
The following pull requests start the process to introduce breaking changes. They are currently starting to emit warning if their condition is hit, but they will turn to return errors in the future release.
It is recommended to use the suggested alternative, or to fix the script if you see the warning message.
require
expressions.New features
Introduction of
k6/experimental/streams
module #3696This release of k6 introduces the new
k6/experimental/streams
module, which partially supports the JavaScriptStreams API, focusing initially on the
ReadableStream
construct.With the
ReadableStream
, users can define and consume data streams within k6 scripts. This is particularly useful forefficiently handling large datasets or for processing data sequentially in a controlled flow.
Expand to see an example of stream's usage
The following example demonstrates creating and consuming a simple stream that emits numbers until it reaches a predefined limit:
For more advanced examples, please head to the MDN Web Docs on the Streams API.
Limitations
Currently, users can define and consume readable streams. However, this release does not include support for byte readers
and controllers, nor does it include support the
tee
,pipeTo
, andpipeThrough
methods of theReadableStream
object.New features and updates of WebCrypto API support #3714
This release brings support for asymmetric cryptography to the
k6/experimental/webcrypto
module. We added support of the elliptic curves algorithms ECDH (xk6-webcrypto#67) and ECDSA (xk6-webcrypto#69) algorithms along with new import/export key formats likespki
andpkcs8
.One of the newly added operations is
deriveBits
, which allows parties to generate a unique shared secret by using shared public and non-shared private keys.Expand to see an example of generating a shared secret for Alice and Bob.
The
sign
andverify
operations got support for ECDSA algorithm. Thesign
operation allows you to sign a message with a private key, while theverify
operation allows you to verify the signature with a public key.Other notable updates and fixes:
See webcrypto's module documentation for more details.
Timers globally available #3589
setTimeout
,setInterval
and related clear functions have been part of the JavaScript ecosystem, probably for as long as it has existed.In the previous releases we stabilized and made them available through
k6/timers
module. While the module isn't going anywhere and might get more identifiers,setTimeout
is usually used without importing it. For this reason it is now globally available alongclearTimeout
,setInterval
andclearInterval
.No code needs to be changed, but you no longer need to import
k6/timers
to use this functionality.UX improvements and enhancements
asyncInvoke
method to thek6/net/grpc
module. It's a non-blocking version of theinvoke
method.Bug fixes
execution.test.options
from Init context.k6_SYSTEM_TAGS
environment variable.mappings
field is empty in the provided SourceMap.Maintenance and internal improvements
golangci-lint
in the contribution guide. Thanks @yomek33 for your contribution!Future plans
Use Blob as default value for WebSocket.binaryType
As the changes in documentation mention,
binaryType
was by default set toarraybuffer
, now instead it is""
(empty string).In a not so remote future, instead, we expect to introduce and use Blob object.
WebCrypto graduation
WebCrypto got more features in the current release, and we expect to continue its expansion in the next iterations. Reaching a wider coverage will push WebCrypto module to being graduated as a stable module.
Streams API
In the not so distant future, we have plans to start using the Streams API in existing modules. Our first iteration being adding a
.readable
property to the already existing fs.File object.Improve user experience for Cloud related commands
In the near future, we intend to reiterate on
k6 cloud
and related commands to create a simplified and more ergonomic user experience.Remove experimental timers module
The
k6/experimental/timers
module is now part of the stable k6 API ask6/timers
and via the globally available functions. The next release will make the experimental import no longer available.Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Renovate Bot.