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
feat(integ-runner): support custom --test-regex to match integ test files (#22786)
Follow-up to #22761. To support other languages than JavaScript (see #22521) we need to be able to detect test files with any patterns. With this PR, users can specify a number of custom `--test-regex` patterns that will bed used to discover integration test files. Together with `--app` this can already be used to run integ tests in arbitrary languages.
Example usage: `integ-runner --app="python3 {filePath}" --test-regex="^integ_.*\.py$"`
Also contains a minor refactor to make `--app` available via `IntegrationTests.fromFile()`. This is in preparation of an upcoming change to reestablish support for an integration test config file.
----
### All Submissions:
* [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md)
### Adding new Unconventional Dependencies:
* [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies)
### New Features
* [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)?
* [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)?
*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Copy file name to clipboardExpand all lines: packages/@aws-cdk/integ-runner/README.md
+3
Original file line number
Diff line number
Diff line change
@@ -70,6 +70,9 @@ to be a self contained CDK app. The runner will execute the following for each f
70
70
If this is set to `true` then the [update workflow](#update-workflow) will be disabled
71
71
-`--app`
72
72
The custom CLI command that will be used to run the test files. You can include {filePath} to specify where in the command the test file path should be inserted. Example: --app="python3.8 {filePath}".
73
+
-`--test-regex`
74
+
Detect integration test files matching this JavaScript regex pattern. If used multiple times, all files matching any one of the patterns are detected.
.option('list',{type: 'boolean',default: false,desc: 'List tests instead of running them'})
@@ -31,14 +31,16 @@ async function main() {
31
31
.option('inspect-failures',{type: 'boolean',desc: 'Keep the integ test cloud assembly if a failure occurs for inspection',default: false})
32
32
.option('disable-update-workflow',{type: 'boolean',default: false,desc: 'If this is "true" then the stack update workflow will be disabled'})
33
33
.option('app',{type: 'string',default: undefined,desc: 'The custom CLI command that will be used to run the test files. You can include {filePath} to specify where in the command the test file path should be inserted. Example: --app="python3.8 {filePath}".'})
34
+
.option('test-regex',{type: 'array',desc: 'Detect integration test files matching this JavaScript regex pattern. If used multiple times, all files matching any one of the patterns are detected.',default: []})
0 commit comments