# integ-runner --- ![cdk-constructs: Experimental](https://img.shields.io/badge/cdk--constructs-experimental-important.svg?style=for-the-badge) > The APIs of higher level constructs in this module are experimental and under active development. > They are subject to non-backward compatible changes or removal in any future version. These are > not subject to the [Semantic Versioning](https://semver.org/) model and breaking changes will be > announced in the release notes. This means that while you may use them, you may need to update > your source code when upgrading to a newer version of this package. --- ## Overview This tool has been created to be used initially by this repo (aws/aws-cdk). Long term the goal is for this tool to be a general tool that can be used for running CDK integration tests. We are publishing this tool so that it can be used by the community and we would love to receive feedback on use cases that the tool should support, or issues that prevent the tool from being used in your library. This tool is meant to be used with the [integ-tests](https://github.com/aws/aws-cdk/tree/main/packages/%40aws-cdk/integ-tests-alpha) library. ## Usage - Run all integration tests in `test` directory ```bash integ-runner [ARGS] [TEST...] ``` This will look for all files that match the naming convention of `/integ.*.js$/`. Each of these files will be expected to be a self contained CDK app. The runner will execute the following for each file (app): 1. Check if a snapshot file exists (i.e. `/*.snapshot$/`) 2. If the snapshot does not exist 2a. Synth the integ app which will produce the `integ.json` file 3. Read the `integ.json` file which contains instructions on what the runner should do. 4. Execute instructions ### Options - `--update-on-failed` (default=`false`) Rerun integration tests if snapshot fails - `--clean` (default=`true`) Destroy stacks after deploy (use `--no-clean` for debugging) - `--verbose` (default=`false`) verbose logging, including integration test metrics (specify multiple times to increase verbosity) - `--parallel-regions` (default=`us-east-1`,`us-east-2`, `us-west-2`) List of regions to run tests in. If this is provided then all tests will be run in parallel across these regions - `--directory` (default=`test`) Search for integration tests recursively from this starting directory - `--force` (default=`false`) Rerun integration test even if the test passes - `--profiles` List of AWS Profiles to use when running tests in parallel - `--exclude` (default=`false`) If this is set to `true` then the list of tests provided will be excluded - `--from-file` Read the list of tests from this file - `--disable-update-workflow` (default=`false`) If this is set to `true` then the [update workflow](#update-workflow) will be disabled - `--app` 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}". Use together with `--test-regex` to fully customize how tests are run, or use with a single `--language` preset to change the command used for this language. - `--test-regex` Detect integration test files matching this JavaScript regex pattern. If used multiple times, all files matching any one of the patterns are detected. - `--watch` Run a single integration test in watch mode. In watch mode the integ-runner will not save any snapshots. Use together with `--app` to fully customize how tests are run, or use with a single `--language` preset to change which files are detected for this language. - `--language` The language presets to use. You can discover and run tests written in multiple languages by passing this flag multiple times (`--language typescript --language python`). Defaults to all supported languages. Currently supported language presets are: - `javascript`: - File RegExp: `^integ\..*\.js$` - App run command: `node {filePath}` - `typescript`:\ Note that for TypeScript files compiled to JavaScript, the JS tests will take precedence and the TS ones won't be evaluated. - File RegExp: `^integ\..*(?