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: src/data/markdown/translated-guides/en/02 Using k6/05 k6 Options/01 How to.md
+3-7Lines changed: 3 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,7 @@ k6 provides multiple places to set options:
9
9
- In CLI flags
10
10
- In environment variables
11
11
- In the script `options` object
12
+
- In a configuration file
12
13
13
14
Most likely, your use case will determine where you want to set the particular options for a particular test.
14
15
You can also access option values as your test runs.
@@ -21,7 +22,7 @@ You can set options in multiple places.
21
22
If there are conflicts, k6 uses the option from the place with the highest _order of precedence_.
22
23
23
24
1. First, k6 uses the option's default value.
24
-
1. Next, k6 uses the options set by the `--config` flag.
25
+
1. Next, k6 uses the options set in a configuration file via the `--config` flag.
25
26
1. Then, k6 uses the script value (if set).
26
27
1. After, k6 uses the environment variable (if set).
27
28
1. Finally, k6 takes the value from the CLI flag (if set).
@@ -141,12 +142,9 @@ export default function () {
141
142
> **Note**: Though this method uses the `--env` flag, this is not the same as using an environment variable.
142
143
> For an explanation, refer to the [environment variables document](/using-k6/environment-variables).
143
144
144
-
145
-
<Collapsibletitle="Set options with config">
146
-
147
145
### Set options with the --config flag
148
146
149
-
You can also define the same options through a config file, then use a CLI flag to specify the config.
147
+
k6 includes a [default configuration file](/using-k6/k6-options/reference/#config) that you can edit, or you can create a new file and then use a CLI flag to point to that file.
150
148
If you use it, the options take the _second lowest order of precedence_ (after defaults).
151
149
If you set options anywhere else, they will override the `--config` flag options.
0 commit comments