Skip to content

Commit 38423ec

Browse files
Merge pull request #1338 from grafana/chore/options-config-file
Update options config file section to not be collapsible
2 parents 9557706 + a03e4d1 commit 38423ec

File tree

3 files changed

+6
-10
lines changed

3 files changed

+6
-10
lines changed

src/data/markdown/docs/03 cloud/01 Creating and running a test/300 Cloud scripting extras/100 Cloud options.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export const options = {
3535
| Name | Default | Description |
3636
|-------------------------------|----------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
3737
| name (string) | The name of the main script file, so something like `script.js`. | The name of the test in the k6 Cloud UI. Test runs with the same name will be grouped together. |
38-
| projectID (number) | It is empty by default. | The ID of the project to which the test is assigned in the k6 Cloud UI. That's in the default project of the user's default organization. |
38+
| projectID (number) | Empty by default. | The ID of the project to which the test is assigned in the k6 Cloud UI. That's in the default project of the user's default organization. |
3939
| distribution (object) | The equivalent of `someDefaultLabel: { loadZone: "amazon:us:ashburn", percent: 100 }`. | How the traffic should be distributed across existing [Load Zones](/cloud/creating-and-running-a-test/cloud-scripting-extras/cloud-options/). The keys are string labels that will be injected as [environment variables](/cloud/creating-and-running-a-test/cloud-scripting-extras/cloud-environment-variables). |
4040
| staticIPs (boolean) | `false` by default | When set to `true` the cloud system will use dedicated IPs assigned to your organization to execute the test. |
4141
| note (string) | Empty by default. | Notes regarding the test, changes made, or anything that may be worth noting about your test. |

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.

src/data/markdown/translated-guides/en/02 Using k6/05 k6 Options/02 Reference.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Each option has its own detailed reference in a separate section.
2727
| [Duration](#duration) | A string specifying the total duration of the test run; together with the [vus option](#vus), it's a shortcut for a single [scenario](/using-k6/scenarios) with a [constant VUs executor](/using-k6/scenarios/executors/constant-vus) |
2828
| [Execution segment](#execution-segment) | Limit execution to a segment of the total test |
2929
| [Exit on running](#exit-on-running) | Exits when test reaches the running status |
30-
| [Extension options](#extension-options) | An object used to set configuration options for third-party collectors |
30+
| [Extension options](#extension-options) | An object used to set configuration options for cloud parameters and third-party collectors |
3131
| [Hosts](#hosts) | An object with overrides to DNS resolution |
3232
| [HTTP debug](#http-debug) | Log all HTTP requests and responses |
3333
| [Include system Env vars](#include-system-env-vars) | Pass the real system environment variables to the runtime |
@@ -351,7 +351,7 @@ export const options = {
351351

352352
## Extension options
353353

354-
An object used to set configuration options for third-party collectors, like plugins. For more information about available parameters, refer to [Cloud options](/cloud/creating-and-running-a-test/cloud-scripting-extras/cloud-options/).
354+
An object used to set configuration options for cloud parameters and third-party collectors, like plugins. For more information about available parameters, refer to [Cloud options](/cloud/creating-and-running-a-test/cloud-scripting-extras/cloud-options/).
355355

356356
| Env | CLI | Code / Config file | Default |
357357
| --- | --- | ------------------ | ------- |

0 commit comments

Comments
 (0)