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
@@ -223,3 +224,40 @@ to deploy the Lambda Function _and_ then rerun the assertions to ensure that the
223
224
224
225
### Assertions
225
226
...Coming soon...
227
+
228
+
## Running Integration Tests
229
+
230
+
Most of the time you will only need to run integration tests for an individual module (i.e. `aws-lambda`). Other times you may need to run tests across multiple modules.
231
+
In this case I would recommend running from the root directory like below.
232
+
233
+
_Run snapshot tests only_
234
+
```bash
235
+
yarn integ-runner --directory packages/@aws-cdk
236
+
```
237
+
238
+
_Run snapshot tests and then re-run integration tests for failed snapshots_
This will search for integration tests recursively from the current directory and then execute them in parallel across `us-east-1`, `us-east-2`, & `us-west-2`.
73
71
72
+
If you are providing a list of tests to execute, either as CLI arguments or from a file, the name of the test needs to be relative to the `directory`.
73
+
For example, if there is a test `aws-iam/test/integ.policy.js` and the current working directory is `aws-iam` you would provide `integ.policy.js`
74
+
75
+
```bash
76
+
yarn integ integ.policy.js
77
+
```
78
+
74
79
### Common Workflow
75
80
76
81
A common workflow to use when running integration tests is to first run the integration tests to see if there are any snapshot differences.
.option('verbose',{type: 'boolean',default: false,alias: 'v',desc: 'Verbose logs and metrics on integration tests durations'})
21
21
.option('dry-run',{type: 'boolean',default: false,desc: 'do not actually deploy the stack. just update the snapshot (not recommended!)'})
22
22
.option('update-on-failed',{type: 'boolean',default: false,desc: 'rerun integration tests and update snapshots for failed tests.'})
23
23
.option('force',{type: 'boolean',default: false,desc: 'Rerun all integration tests even if tests are passing'})
24
-
.option('parallel',{type: 'boolean',default: false,desc: 'run integration tests in parallel'})
25
-
.option('parallel-regions',{type: 'array',desc: 'if --parallel is used then these regions are used to run tests in parallel',nargs: 1,default: []})
26
-
.options('directory',{type: 'string',default: 'test',desc: 'starting directory to discover integration tests'})
24
+
.option('parallel-regions',{type: 'array',desc: 'Tests are run in parallel across these regions. To prevent tests from running in parallel, provide only a single region',nargs: 1,default: []})
25
+
.options('directory',{type: 'string',default: 'test',desc: 'starting directory to discover integration tests. Tests will be discovered recursively from this directory'})
27
26
.options('profiles',{type: 'array',desc: 'list of AWS profiles to use. Tests will be run in parallel across each profile+regions',nargs: 1,default: []})
28
27
.options('max-workers',{type: 'number',desc: 'The max number of workerpool workers to use when running integration tests in parallel',default: 16})
29
28
.options('exclude',{type: 'boolean',desc: 'All tests should be run, except for the list of tests provided',default: false})
@@ -61,11 +60,11 @@ async function main() {
61
60
if(argv._.length>0&&fromFile){
62
61
thrownewError('A list of tests cannot be provided if "--from-file" is provided');
0 commit comments