Skip to content

Commit

Permalink
Merge branch 'master' into iotevents-comparison-operator
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Apr 8, 2022
2 parents 223688a + cfb140e commit a5737a8
Show file tree
Hide file tree
Showing 306 changed files with 34,608 additions and 493 deletions.
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
### New Features

* [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/master/INTEGRATION_TESTS.md)?
* [ ] Did you use `cdk-integ` to deploy the infrastructure and generate the snapshot (i.e. `cdk-integ` without `--dry-run`)?
* [ ] 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*
6 changes: 3 additions & 3 deletions INTEGRATION_TESTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ on what type of changes require integrations tests and how you should write inte
All Construct libraries in the CDK code base have integration tests that serve to -

1. Acts as a regression detector. It does this by running `cdk synth` on the integration test and comparing it against
the `*.expected.json` file. This highlights how a change affects the synthesized stacks.
the Cloud Assembly stored in the snapshot (`*.integ.snapshot/`) directory. This highlights how a change affects the synthesized stacks.
2. Allows for a way to verify if the stacks are still valid CloudFormation templates, as part of an intrusive change.
This is done by running `yarn integ` which will run `cdk deploy` across all of the integration tests in that package.
If you are developing a new integration test or for some other reason want to work on a single integration test
Expand Down Expand Up @@ -102,14 +102,14 @@ To run the test you would run:

*Note - filename must be `*.js`*
```
npm run cdk-integ integ.lambda.js
yarn integ --update-on-failed integ.lambda.js
```

This will:
1. Synthesize the CDK app
2. `cdk deploy` to your AWS account
3. `cdk destroy` to delete the stack
4. Save a snapshot of the synthed CloudFormation template to `integ.lambda.expected.json`
4. Save a snapshot of the Cloud Assembly to `lambda.integ.snapshot/`

Now when you run `npm test` it will synth the integ app and compare the result with the snapshot.
If the snapshot has changed the same process must be followed to update the snapshot.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,8 @@ nyc.config.js

junit.xml

!jest.config.js
!jest.config.js
!**/*.integ.snapshot/**/asset.*/*.js
!**/*.integ.snapshot/**/asset.*/*.d.ts

!**/*.integ.snapshot/**/asset.*/**
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,6 @@ tsconfig.json
junit.xml

test/
jest.config.js
jest.config.js
**/*.integ.snapshot
**/*.integ.snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"watch": "cdk-watch",
"lint": "cdk-lint",
"test": "cdk-test",
"integ": "cdk-integ",
"integ": "integ-runner",
"pkglint": "pkglint -f",
"package": "cdk-package",
"awslint": "cdk-awslint",
Expand All @@ -39,7 +39,7 @@
"devDependencies": {
"@types/jest": "^27.4.1",
"@aws-cdk/cdk-build-tools": "0.0.0",
"@aws-cdk/cdk-integ-tools": "0.0.0",
"@aws-cdk/integ-runner": "0.0.0",
"@aws-cdk/aws-autoscaling": "0.0.0",
"@aws-cdk/cfn2ts": "0.0.0",
"jest": "^27.5.1",
Expand Down
Loading

0 comments on commit a5737a8

Please sign in to comment.