Update module go.k6.io/k6 to v0.49.0 #378
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
v0.47.0
->v0.49.0
Release Notes
grafana/k6 (go.k6.io/k6)
v0.49.0
Compare Source
k6
v0.49.0
is here π! This release:clear
functionality to the browser module'slocator
classes.k6/html
.k6/experimental/timers
for stabilization.Breaking changes
loadimpact/k6
docker image. If you still use it, please migrate to the grafana/k6 image.timeout
option forisVisible
andisHidden
since the API no longer waits for the element to appear on the page.New features
Web Dashboard
The new web dashboard brings real-time visualization to load testing. This feature allows users to monitor test progress and analyze
results dynamically, enhancing the overall testing experience.
Real-time test results
Activate this feature using the environment variable
K6_WEB_DASHBOARD=true
. For this initial release, the dashboard is not enabled by default to allow users to opt into this new experience as it evolves.Once enabled and the test script is running, navigate to http://localhost:5665 in your web browser to access the dashboard.
Test report
The web dashboard also offers an HTML test report (see an example) for detailed analysis, enabling easy sharing and downloading capabilities for
collaboration.
To access and download the report, click on the Report button in the dashboard's top right corner or use the
K6_WEB_DASHBOARD_EXPORT
environment variable.Add
clear
to thelocator
class browser#1149The new
clear
method on thelocator
class clears the text boxes and input fields. This is useful when navigating to a website where the text boxes and input fields already contain a value that needs to be cleared before filling it with a specific value.Expand to see an example of the new functionality.
Add tracing to the browser module browser#1100
The browser module now generates traces that provide a representation of its inner workings, such as API methods executed (for example
browser.newPage
andpage.goto
), page navigations, and Web Vitals measurements.Currently, the instrumented methods are a subset of all the methods exposed by the browser module API, but this will be extended in the future.
The traces generation for the browser module depends on the overall
k6
traces option introduced in v0.48.0. Check out the documentation to learn more about it.gRPC streaming API becomes part of the k6 core #β3490
With this release, gRPC's streaming API becomes part of the core's
k6/net/grpc
module. The experimentalk6/experimental/grpc
has been back-merged into the core.You can still use import
k6/experimental/grpc
for a couple of releases, but it's deprecated and will be removed in the future (planned in k6 versionv0.51.0
).To migrate your scripts, replace
k6/experimental/grpc
withk6/net/grpc
in your script imports, and the code should work as before.k6/html: Extract selection from element #β3519
k6/html
has been around for a while and allows you to search within an HTML document with a jQuery-like API called Selection, and also has support for the more standard Element that represents DOM element.For a long time, you could get an Element from a Selection using the
.get(index)
, but you couldn't get back to a Selection from an Element.This is not a common case, but one that requires quite a bit of code. For example, see the following jQuery snippet:
In order to support the above example, you can use
selection
, without going to the element:This is not always possible though, and arguably isn't what most users will naturally do.
Because of this, we have now added a new
.selection()
which returns a selection for its element.Thanks to @βAzhovan! π π
Collect usage data on imported internal modules and outputs #β3525
k6 now collects usage data of the modules and outputs that are being used when the usage report is enabled. The data collection is only related to the built-in k6 modules and outputs. Private, custom modules and extensions are never collected. The usage report is enabled by default in k6, but it is possible to opt-out using the no-usage-report option.
We always want to improve the product, but at the same time, we need to pay attention to where we allocate our resources. Having data of what are the most used modules and outputs gives us better confidence to make decisions because we are supported by data.
The data can let us know what percentage of our users will benefit from the introduction of a new feature and also, how many of them would be impacted in case of a breaking change.
UX improvements and enhancements
@mem
for working on it!console
in the k6 logs.grafana.com/docs/k6/latest/
.Bug fixes
console
.BigInt
parsing.isVisible
andisHidden
so that it doesn't wait for an element to match with the givenselector
, allowing it to continue on with the test script when elements are not on the page.dblClick
so that it works withonDblClick
and performs two clicks on the specified element.Maintenance and internal improvements
CODEOWNERS
from GitHub Action.open
andrequire
and their handling of paths.Roadmap
As mentioned earlier, there's work in progress to make xk6-timers stable as part of the next release. You can find more information on issue #β3297.
v0.48.0
Compare Source
k6 v0.48.0 is here π! This release includes:
k6 new
subcommand to generate a new test script.k6/experimental/fs
module for file interactions.Breaking changes
This release includes several breaking changes, mainly cleaning up deprecations from previous versions. They should have a straightforward migration process, and not heavily impact existing users.
Client
signature ink6/experimental/redis
module. Refer to the module-related section below.grpc.invoke()
's parameterheaders
, deprecated in k6 v0.37. Use themetadata
parameter instead.--logformat
flag, deprecated in v0.38. Use the--log-format
flag instead.k6 convert
CLI command, deprecated in v0.41. Use the har-to-k6 package instead.https://
scheme to module specifiers that were not recognized. Deprecated in k6 v0.25. Use full URLs if you want to load remote modules instead.New features
Add
k6 new
subcommand #β3394k6
now has anew
subcommand that generates a new test script. This is useful for new users who want to get started quickly, or for experienced users who want to save time when creating new test scripts. To use the subcommand, open your terminal and type:If no filename is provided, k6 uses
script.js
as the default filename. The subcommand will create a new file with the provided name in the current directory, and populate it with a basic test script that can be run withk6 run
.Add a
k6/experimental/fs
module #β3165k6
now has a newk6/experimenal/fs
module providing a memory-efficient way to handle file interactions within your test scripts. It currently offers support for opening files, reading their content, seeking through it, and retrieving metadata about them.Unlike the traditional open function, which loads a file multiple times into memory, the filesystem module reduces memory usage by loading the file as little as possible, and sharing the same memory space between all VUs. This approach significantly reduces the memory footprint of your test script and lets you load and process large files without running out of memory.
For more information, refer to the module documentation.
Expand to see an example of the new functionality.
This example shows the new module usage:
Redis (m)TLS support and new Client constructor options #β3439, xk6-redis/#β17
In this release, the
k6/experimental/redis
module receives several important updates, including breaking changes.Connection URLs
The
Client
constructor now supports connection URLs to configure connections to Redis servers or clusters. These URLs can be in the formatredis://[[username][:password]@​][host][:port][/db-number]
for standard connections, orrediss://[[username][]:password@]][host][:port][/db-number]
for TLS-secured connections. For more details, refer to the documentation.Example usage
Revamped Options object
The
Client
constructor has been updated with a new Options object format. This change aligns the module with familiar patterns from Node.js and Deno libraries, offering enhanced flexibility and control over Redis connections. For more details, refer to the documentation.Expand to see an example of the new functionality.
This example shows the usage of the new
Options
object:(m)TLS support
The Redis module now includes (m)TLS support, enhancing security for connections. This update also improves support for Redis clusters and sentinel modes (failover). For connections using self-signed certificates, enable k6's insecureSkipTLSVerify option (set to
true
).Expand to see an example of the new functionality.
This example shows the configuration of a TLS connection:
Add tracing instrumentation #β3445
k6
now supports a new traces output option that allows you to configure the output for traces generated during its execution. This option can be set through the--traces-output
argument in thek6 run
command or by setting theK6_TRACES_OUTPUT
environment variable.Currently, no traces are generated by
k6
itself, but this feature represents the first step towards richer tracing functionalities ink6
and its extensions.By default traces output is set to
none
, and currently the only supported output isotel
which uses the opentelemetry-go's Open Telemetry API and SDK implementations. The format for theotel
traces output configuration is the following:Where
opt
s can be one of the following options:proto
: Specifies the protocol to use in the connection to the traces backend. Supportsgrpc
(default) andhttp
.header.<header_name>
: Specifies an additional header to include in the connection to the traces backend.Example:
Add support for browser module's
page.throttleCPU
browser#1095The browser module now supports throttling the CPU from chrome/chromium's perspective by using the
throttleCPU
API, which helps emulate slower devices when testing the website's frontend. It requires an argument of typeCPUProfile
, which includes arate
field that is a slow-down factor, where1
means no throttling,2
means 2x slowdown, and so on. For more details, refer to the documentation.Add support for browser module's
page.throttleNetwork
browser#1094The browser module now supports throttling the characteristics of the network from chrome/chromium's perspective by using the
throttleNetwork
API, which helps emulate slow network connections when testing the website's frontend. It requires an argument of typeNetworkProfile
, with a definition of:You can either define your own network profiles or use the ones we have defined by importing
networkProfiles
from thebrowser
module. For more details, refer to the documentation.k6's documentation is moving under grafana.com/docs/k6
It's not directly part of the k6 v0.48 release, but we believe it is worth mentioning that we're moving the documentation from k6.io/docs to grafana.com/docs/k6.
The legacy documentation space
k6.io/docs
will be available for a while, but we encourage you to update your bookmarks and links to the new domain.UX improvements and enhancements
browser.closeContext()
method to facilitate closing the current active browser context.--profiling-enabled
which enables exposing pprof profiling endpoints. The profiling endpoints are exposed on the same port as the HTTP REST API under the/debug/pprof/
path. This can be useful for extension developers.--version
flag, which has the same output ask6 version
command. Thanks, @βffapitalle!K6_INFLUXDB_PROXY
to the InfluxDB output which allows specifying proxy. Thanks, @βIvanovOleg!-o cloud
.fsext.Abs
helper function.Bug fixes
console.debug()
, aligning-v
output to--console-output
andstdout
.handleSummary()
.content-encoding
header and HTTP statuses known for having no body.browserContext.clearPermissions
to clear permissions without panic.browserContext.waitForEvent
which involved promisifying thewaitForEvent
API.page.$
so that it returnsnull
when no matches with given selector are found.goja
dependency. Fixes a possible panic and proper handling circular types atJSON.stringify
. Fixes an issue about dumping the correct stack trace when an error is re-thrown.iframe
s. Thanks, @βbandorko!Maintenance and internal improvements
gh
in GitHub actions creating the OSS release.js
package.make ci-like-lint
in favor ofmake lint
. Updates a golangci-lint version to v1.55.2.tests
reference in the all rule of the Makefile. Thanks, @βflyck!k6 cloud
.clearPermissions
andgrantPermissions
.force
andnoWaitAfter
inframe.newAction
.TestSetupTimeout
test.lib/strvals
package.Roadmap
Graduating from experimental
It has been a while since we've introduced the
k6/experimental
namespace. This namespace was specifically created to test new features before we fully committed to them. Thanks to it, we have been able to iterate on features and receive valuable feedback from the community before adding them to the core of k6.In the following releases, we're going to graduate
k6/experimental/grpc
andk6/experimental/timers
.These modules' "experimental" versions will remain available for a couple of releases, but the goal is to remove the "experimental" imports for them in favor of the core-only imports.
New dashboard features
We're happy to announce our work on a new, upcoming dashboard feature. Based on the xk6-dashboard extension, this upcoming feature will enable you to visualize your test runs and their results in your web browser, in real time. The k6 maintainers team is starting to work towards its integration into the core of k6, and we're aiming to release it in the next couple of releases.
While the final user-experience might differ, you can already try it out by following the instructions in the xk6-dashboard repository. We update the extension on a regular basis as we're converging towards the first release of the feature in k6. Go ahead and give it a try! Let us know what you think about it!
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 Mend Renovate. View repository job log here.