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
| `script_path` | path to the k6 script file. must be a JavaScript file satisfying the pattern `^([.]{0,2}/)?[a-zA-Z0-9-_/]\*[a-zA-Z0-9]\.js$`. | `true` | `N/A` |
73
-
| `output_path` | path to the output file that will be created. directories will be created as necessary. if empty, no output file will be generated. must be a JSON file satisfying the pattern `^([.]{0,2}/)?[a-zA-Z0-9-_/]\*[a-zA-Z0-9]\.json$`. | `false` | `N/A` |
74
-
| `fail_on_threshold_breach` | if `false`, the pipeline step will not fail even if thresholds are breached. | `false` | `true` |
75
-
| `projektor_compat_mode` | if `true`, output will be generated with the `--summary-output` flag instead of the `--out` flag. this is necessary for results uploaded to a [Projektor](https://projektor.dev/) server. | `false` | `false` |
76
-
| `log_progress` | if `true`, k6 progress bar output will print to the Vela pipeline. Not recommended for numerous or long-running tests, as logging becomes excessive. | `false` | `false` |
| `script_path` | path to the k6 script file. must be a JavaScript file satisfying the pattern `^(\./\|(\.\./)+)?[a-zA-Z0-9-_/]*[a-zA-Z0-9]\.js$`. | `true` | `N/A` |
73
+
| `output_path` | path to the output file that will be created. directories will be created as necessary. if empty, no output file will be generated. must be a JSON file satisfying the pattern `^(\./\|(\.\./)+)?[a-zA-Z0-9-_/]*[a-zA-Z0-9]\.json$`. | `false` | `N/A` |
74
+
| `setup_script_path` | path to an optional setup script file to be run before tests. must be a shell script (sh or bash) with execute permissions matching the pattern `^(\./\|(\.\./)+)?[a-zA-Z0-9-_/]*[a-zA-Z0-9]\.sh$`. | `false` | `N/A` |
75
+
| `fail_on_threshold_breach` | if `false`, the pipeline step will not fail even if thresholds are breached. | `false` | `true` |
76
+
| `projektor_compat_mode` | if `true`, output will be generated with the `--summary-output` flag instead of the `--out` flag. this is necessary for results uploaded to a [Projektor](https://projektor.dev/) server. | `false` | `false` |
77
+
| `log_progress` | if `true`, k6 progress bar output will print to the Vela pipeline. Not recommended for numerous or long-running tests, as logging becomes excessive. | `false` | `false` |
returnnil, fmt.Errorf("invalid script file. provide the filepath to a JavaScript file in plugin parameter 'script_path' (e.g. 'script_path: \"/k6-test/script.js\"'). the filepath must follow the regular expression `^[a-zA-Z0-9-_/]*[a-zA-Z0-9]+\\.(json|js)$`")
68
+
returnnil, fmt.Errorf("invalid script file. provide the filepath to a JavaScript file in plugin parameter 'script_path' (e.g. 'script_path: \"/k6-test/script.js\"'). the filepath must follow the regular expression `%s`", validJSFilePattern)
66
69
}
67
70
68
71
returncfg, nil
69
72
}
70
73
71
-
// sanitizeFilePath returns the input string if it satisfies the pattern
72
-
// for a valid filepath, and an empty string otherwise.
73
-
funcsanitizeFilePath(inputstring) string {
74
-
returnvalidFilePattern.FindString(input)
74
+
// sanitizeScriptPath returns the input string if it satisfies the pattern
75
+
// for a valid JS filepath, and an empty string otherwise.
76
+
funcsanitizeScriptPath(inputstring) string {
77
+
returnvalidJSFilePattern.FindString(input)
78
+
}
79
+
80
+
// sanitizeOutputPath returns the input string if it satisfies the pattern
81
+
// for a valid JSON filepath, and an empty string otherwise.
82
+
funcsanitizeOutputPath(inputstring) string {
83
+
returnvalidJSONFilePattern.FindString(input)
84
+
}
85
+
86
+
// sanitizeSetupPath returns the input string if it satisfies the pattern
87
+
// for a valid .sh filepath, and an empty string otherwise.
88
+
funcsanitizeSetupPath(inputstring) string {
89
+
returnvalidShellFilePattern.FindString(input)
75
90
}
76
91
77
92
// buildK6Command returns a shellCommand that will execute K6 tests
0 commit comments