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: README.md
+14-14Lines changed: 14 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
<divalign="center">
2
-
2
+
3
3
<img
4
4
src="./images/k6.gif"
5
5
width="600"
@@ -12,7 +12,7 @@
12
12
13
13
# run-k6-action
14
14
15
-
This action allows you to easily execute k6 tests as part of your GitHub Actions workflow.
15
+
This action allows you to easily execute k6 tests as part of your GitHub Actions workflow.
16
16
17
17
It is a wrapper over `k6 run`, with support for globs, parallel execution, fail-fast, and many other features.
18
18
@@ -22,19 +22,19 @@ It is a wrapper over `k6 run`, with support for globs, parallel execution, fail-
22
22
23
23
The following inputs can be used as `step.with` key:
24
24
25
-
| Name | Type | Required | Default | Description
26
-
| --- | --- | --- | --- | --- |
27
-
| `path` | string | `true` | `''` | Glob pattern to select one or multiple test scripts to run. <br/> e.g. `./tests/api*.js` <br/> One can also supply multiple patterns by separating them with new line.<br/><code>path: \|<br/> ./tests/api*.js<br/> ./tests/app*.js</code>
28
-
| `cloud-run-locally` | boolean | `false` | `true` | If `true`, the tests are executed locally and the results are uploaded to Grafana Cloud k6
29
-
| `parallel` | boolean | `false` | `false` | If `true` and multiple tests are executed, all them run in parallel.
30
-
| `fail-fast` | boolean | `false` | `false` | If `true`, the whole pipeline fails as soon as the first test fails
31
-
| `flags` | string | `false` | `''` | Additional flags to be passed on to the `k6 run` command.<br/>e.g. `--vus 10 --duration 20s`
32
-
| `cloud-comment-on-pr` | boolean | `false` | `true` | If `true`, the workflow comments a link to the cloud test run on the pull request (if present)
33
-
| `only-verify-scripts` | boolean | `false` | `false` | If `true`, only check if the test scripts are valid and skip the test execution'
34
-
25
+
| Name | Type | Required | Default | Description |
|`path`| string |`true`|`''`| Glob pattern to select one or multiple test scripts to run. <br/> e.g. `./tests/api*.js` <br/> One can also supply multiple patterns by separating them with new line.<br/><code>path: \|<br/> ./tests/api*.js<br/> ./tests/app*.js</code>|
28
+
|`cloud-run-locally`| boolean |`false`|`true`| If `true`, the tests are executed locally and the results are uploaded to Grafana Cloud k6|
29
+
|`parallel`| boolean |`false`|`false`| If `true` and multiple tests are executed, all them run in parallel. |
30
+
|`fail-fast`| boolean |`false`|`false`| If `true`, the whole pipeline fails as soon as the first test fails |
31
+
|`flags`| string |`false`|`''`| Additional flags to be passed on to the `k6 run` command.<br/>e.g. `--vus 10 --duration 20s`|
32
+
|`cloud-comment-on-pr`| boolean |`false`|`true`| If `true`, the workflow comments a link to the cloud test run on the pull request (if present)|
33
+
|`only-verify-scripts`| boolean |`false`|`false`| If `true`, only check if the test scripts are valid and skip the test execution|
34
+
|`debug`| boolean |`false`|`false`| If true, the output from k6 will be shown in the action logs, else only the summary will be shown. |
35
35
## Usage
36
36
37
-
Following are some examples of using the workflow.
37
+
Following are some examples of using the workflow.
38
38
39
39
### Basic
40
40
@@ -113,7 +113,7 @@ jobs:
113
113
fail-fast: false # optional: fail the step early if any test fails (default: true)
@@ -34668,7 +34669,7 @@ function checkIfK6ASCIIArt(data) {
34668
34669
return true;
34669
34670
}
34670
34671
}
34671
-
function parseK6Output(data, testRunUrlsMap, totalTestRuns) {
34672
+
function parseK6Output(data, testRunUrlsMap, totalTestRuns, debug) {
34672
34673
/*
34673
34674
* This function is responsible for parsing the output of the k6 command.
34674
34675
* It filters out the progress lines and logs the rest of the output.
@@ -34677,35 +34678,38 @@ function parseK6Output(data, testRunUrlsMap, totalTestRuns) {
34677
34678
* @param {Buffer} data - The k6 command output data
34678
34679
* @param {TestRunUrlsMap | null} testRunUrlsMap - The map containing the script path and output URL. If null, the function will not extract test run URLs.
34679
34680
* @param {number} totalTestRuns - The total number of test runs. This is used to determine when all test run URLs have been extracted.
34681
+
* @param {boolean} debug - A flag to determine if the k6 progress output should be shown or not.
0 commit comments