Skip to content

Commit 530bd74

Browse files
Update options config file section to not be collapsible
1 parent 7e15e4d commit 530bd74

File tree

1 file changed

+3
-7
lines changed
  • src/data/markdown/translated-guides/en/02 Using k6/05 k6 Options

1 file changed

+3
-7
lines changed

src/data/markdown/translated-guides/en/02 Using k6/05 k6 Options/01 How to.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ k6 provides multiple places to set options:
99
- In CLI flags
1010
- In environment variables
1111
- In the script `options` object
12+
- In a configuration file
1213

1314
Most likely, your use case will determine where you want to set the particular options for a particular test.
1415
You can also access option values as your test runs.
@@ -21,7 +22,7 @@ You can set options in multiple places.
2122
If there are conflicts, k6 uses the option from the place with the highest _order of precedence_.
2223

2324
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.
2526
1. Then, k6 uses the script value (if set).
2627
1. After, k6 uses the environment variable (if set).
2728
1. Finally, k6 takes the value from the CLI flag (if set).
@@ -141,12 +142,9 @@ export default function () {
141142
> **Note**: Though this method uses the `--env` flag, this is not the same as using an environment variable.
142143
> For an explanation, refer to the [environment variables document](/using-k6/environment-variables).
143144
144-
145-
<Collapsible title="Set options with config">
146-
147145
### Set options with the --config flag
148146

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.
150148
If you use it, the options take the _second lowest order of precedence_ (after defaults).
151149
If you set options anywhere else, they will override the `--config` flag options.
152150

@@ -198,8 +196,6 @@ const testConfig = JSON.parse(open('./config/test.json'));
198196
export const options = testConfig;
199197
```
200198

201-
</Collapsible>
202-
203199
## Get an option value from the script
204200

205201
The `k6/execution` API provides a [test.options](/javascript-api/k6-execution/#test) object.

0 commit comments

Comments
 (0)