Skip to content

Commit cfb140e

Browse files
authored
chore: switch to using the new integ-runner (#19826)
This PR is a follow up to #19802 which added all of the new integ test snapshots that are used by the new `integ-runner` tool. This PR switches out the old `cdk-integ` tool for the new `integ-runner`. Updates made: 1. Update all `package.json` files to install and use the `integ-runner` 2. Update `cdk-test` to use `integ-runner` 3. Updates snapshots for 2 tests that were changed since #19802 was merged. ---- ### All Submissions: * [ ] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md) ### Adding new Unconventional Dependencies: * [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/master/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/master/INTEGRATION_TESTS.md)? * [ ] Did you use `cdk-integ` to deploy the infrastructure and generate the snapshot (i.e. `cdk-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*
1 parent ab47c1a commit cfb140e

File tree

306 files changed

+34608
-493
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

306 files changed

+34608
-493
lines changed

.github/PULL_REQUEST_TEMPLATE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212
### New Features
1313

1414
* [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/master/INTEGRATION_TESTS.md)?
15-
* [ ] Did you use `cdk-integ` to deploy the infrastructure and generate the snapshot (i.e. `cdk-integ` without `--dry-run`)?
15+
* [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)?
1616

1717
*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*

INTEGRATION_TESTS.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ on what type of changes require integrations tests and how you should write inte
1616
All Construct libraries in the CDK code base have integration tests that serve to -
1717

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

103103
*Note - filename must be `*.js`*
104104
```
105-
npm run cdk-integ integ.lambda.js
105+
yarn integ --update-on-failed integ.lambda.js
106106
```
107107

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

114114
Now when you run `npm test` it will synth the integ app and compare the result with the snapshot.
115115
If the snapshot has changed the same process must be followed to update the snapshot.

packages/@aws-cdk-containers/ecs-service-extensions/.gitignore

+5-1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,8 @@ nyc.config.js
1919

2020
junit.xml
2121

22-
!jest.config.js
22+
!jest.config.js
23+
!**/*.integ.snapshot/**/asset.*/*.js
24+
!**/*.integ.snapshot/**/asset.*/*.d.ts
25+
26+
!**/*.integ.snapshot/**/asset.*/**

packages/@aws-cdk-containers/ecs-service-extensions/.npmignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,6 @@ tsconfig.json
2424
junit.xml
2525

2626
test/
27-
jest.config.js
27+
jest.config.js
28+
**/*.integ.snapshot
29+
**/*.integ.snapshot

packages/@aws-cdk-containers/ecs-service-extensions/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"watch": "cdk-watch",
1515
"lint": "cdk-lint",
1616
"test": "cdk-test",
17-
"integ": "cdk-integ",
17+
"integ": "integ-runner",
1818
"pkglint": "pkglint -f",
1919
"package": "cdk-package",
2020
"awslint": "cdk-awslint",
@@ -39,7 +39,7 @@
3939
"devDependencies": {
4040
"@types/jest": "^27.4.1",
4141
"@aws-cdk/cdk-build-tools": "0.0.0",
42-
"@aws-cdk/cdk-integ-tools": "0.0.0",
42+
"@aws-cdk/integ-runner": "0.0.0",
4343
"@aws-cdk/aws-autoscaling": "0.0.0",
4444
"@aws-cdk/cfn2ts": "0.0.0",
4545
"jest": "^27.5.1",

0 commit comments

Comments
 (0)