You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/sources/k6/next/extensions/run-extensions-using-binary-provisioning.md
+22-23Lines changed: 22 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,34 +1,22 @@
1
1
---
2
-
labels:
3
-
products:
4
-
- cloud
5
2
title: 'Run extensions using Binary Provisioning'
6
3
description: 'Learn how to run scripts that require extensions using Binary Provisioning.'
7
4
weight: 04
8
5
---
9
6
10
7
# Run extensions using Binary Provisioning
11
8
12
-
{{< admonition type="caution" >}}
13
-
14
-
This is an experimental feature. Breaking changes might occur prior to the feature being made generally available.
15
-
16
-
{{< /admonition >}}
17
-
18
9
k6 supports [extensions](https://grafana.com/docs/k6/<K6_VERSION>/extensions/) as a way of extending k6 native functionality, and support a wider variety of use cases.
19
10
20
-
Using k6 with extensions locally requires users to build a [custom k6 binary](https://grafana.com/docs/k6/<K6_VERSION>/extensions/#xk6-makes-custom-binaries) that includes the extension, which can then be used to run a test script. With the Binary Provisioning feature, Grafana Cloud k6 users can run tests with a [limited set of extensions](https://grafana.com/docs/grafana-cloud/testing/k6/author-run/use-k6-extensions/#supported-extensions-in-grafana-cloud), without having to manually build a k6 binary.
21
-
22
-
The `archive` and `inspect` commands also support Binary Provisioning to allow creating archives for Grafana Cloud.
11
+
Using k6 with extensions locally requires users to build a [custom k6 binary](https://grafana.com/docs/k6/<K6_VERSION>/extensions/#xk6-makes-custom-binaries) that includes the extension, which can then be used to run a test script. With the Binary Provisioning feature, k6 users can run tests using extensions without having to manually build a k6 binary.
23
12
24
13
## Before you begin
25
14
26
15
To use Binary Provisioning, you'll need:
27
16
28
-
- k6 v1.0 or greater [installed on your machine](https://grafana.com/docs/k6/latest/set-up/install-k6/).
29
-
- A [Grafana Cloud account](https://grafana.com/auth/sign-up/create-user).
17
+
- k6 v1.2 or greater [installed on your machine](https://grafana.com/docs/k6/latest/set-up/install-k6/).
30
18
31
-
## Set the Binary Provsioning environment flag
19
+
## Set the Binary Provisioning environment flag
32
20
33
21
To enable Binary Provisioning, you must set the `K6_BINARY_PROVISIONING` environment variable to `true`:
By default the Binary Provisioning allows using [a limited set of officially supported extensions](https://grafana.com/docs/grafana-cloud/testing/k6/author-run/use-k6-extensions/#supported-extensions-in-grafana-cloud). With the `ENABLE_COMMUNITY_EXTENSIONS` all extension in the extensions registry are available.
43
+
44
+
> When running tests in the cloud only the officially supported extensions are allowed.
45
+
46
+
{{< code >}}
47
+
48
+
```linux
49
+
export ENABLE_COMMUNITY_EXTENSIONS=true
50
+
```
51
+
52
+
```mac
53
+
export ENABLE_COMMUNITY_EXTENSIONS=true
54
+
```
53
55
54
-
To use Binary Provisioning, you must [authenticate to Grafana Cloud](https://grafana.com/docs/grafana-cloud/testing/k6/author-run/tokens-and-cli-authentication/#authenticate-with-the-login-command) using the `k6 cloud login` command:
56
+
```windows-powershell
57
+
$Env:ENABLE_COMMUNITY_EXTENSIONS = "true"
55
58
56
-
```bash
57
-
k6 cloud login --token <API_TOKEN>
58
59
```
60
+
{{< /code >}}
59
61
60
62
## Run a test
61
63
@@ -97,7 +99,7 @@ You should see an output similar to the following:
97
99
98
100
```sh
99
101
INFO[0000] The current k6 binary doesn't satisfy all dependencies, it is required to provision a custom binary. deps="k6/x/faker*"
100
-
INFO[0000] A new k6 binary has been provisioned with version(s): k6:v1.0.0 k6/x/faker:v0.4.3
102
+
INFO[0000] A new k6 binary has been provisioned with version(s): k6:v1.2.0 k6/x/faker:v0.4.3
0 commit comments