Skip to content

Commit

Permalink
chore: change name of integ test snapshot directories in preparation …
Browse files Browse the repository at this point in the history
…of multi-language integration tests (#22716)

To support multi language integration tests better (see #22521), we need to rename the snapshot directories. Other languages have different naming conventions, so it's not trivial anymore to generate a "nice" name just from a test file. Instead we now use the full filename. This new pattern is inspired by Jest etc that all use the full filename. 

E.g. `my-test-name.integ.snapshot` -> `integ.my-test-name.js.snapshot` 

This PR changes the code generating the snapshot names and then does the rename in one go via the following commits:
* chore: change code for generating the integ test snapshot directory names
* chore: rename test data in `integ-runner`
* chore: update `.gitignore` files with new snapshot patterns
* chore: rename all integ-test snapshots 
* chore: update integ test snapshot paths in docs
* chore: update `.npmignore` files with new snapshot pattern
* chore: update prlinter to detect new snapshot pattern
--- 

Review by commit ([start here](a884681)). The [middle commit](fee824d) contains most of the renames, is HUGE and takes a long time to load in the GitHub UI. However it only contains renames (use `--diff-filter=r` to exclude renames from the diff):
```
> git show --diff-filter=r fee824d
(empty result)
```

----

### 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

* [x] 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*
  • Loading branch information
mrgrain authored Nov 1, 2022
1 parent 6c25e36 commit 129c695
Show file tree
Hide file tree
Showing 5,398 changed files with 1,006 additions and 1,249 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ Work your magic. Here are some guidelines:

Integration tests perform a few functions in the CDK code base -
1. Acts as a regression detector. It does this by running `cdk synth` on the integration test and comparing it against
the `*.integ.snapshot` directory. This highlights how a change affects the synthesized stacks.
the `*.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 over and over again without running through all the integration tests you can do so using `yarn integ integ.test-name.js`
Remember to set up AWS credentials before doing this.
Expand Down
4 changes: 2 additions & 2 deletions INTEGRATION_TESTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,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 Cloud Assembly stored in the snapshot (`*.integ.snapshot/`) directory. This highlights how a change affects the synthesized stacks.
the Cloud Assembly stored in the snapshot (`*.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 @@ -115,7 +115,7 @@ 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 Cloud Assembly to `lambda.integ.snapshot/`
4. Save a snapshot of the Cloud Assembly to `integ.lambda.js.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
6 changes: 3 additions & 3 deletions packages/@aws-cdk/alexa-ask/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ tsconfig.json
!jest.config.js

junit.xml
!**/*.integ.snapshot/**/asset.*/*.js
!**/*.integ.snapshot/**/asset.*/*.d.ts
!**/*.snapshot/**/asset.*/*.js
!**/*.snapshot/**/asset.*/*.d.ts

!**/*.integ.snapshot/**/asset.*/**
!**/*.snapshot/**/asset.*/**
3 changes: 1 addition & 2 deletions packages/@aws-cdk/alexa-ask/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,4 @@ jest.config.js
junit.xml
test/
!*.lit.ts
**/*.integ.snapshot
**/*.integ.snapshot
**/*.snapshot
6 changes: 3 additions & 3 deletions packages/@aws-cdk/app-delivery/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ coverage

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

!**/*.integ.snapshot/**/asset.*/**
!**/*.snapshot/**/asset.*/**
3 changes: 1 addition & 2 deletions packages/@aws-cdk/app-delivery/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,4 @@ junit.xml
test/
!*.lit.ts
jest.config.js
**/*.integ.snapshot
**/*.integ.snapshot
**/*.snapshot
6 changes: 3 additions & 3 deletions packages/@aws-cdk/assert-internal/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ nyc.config.js
!jest.config.js

junit.xml
!**/*.integ.snapshot/**/asset.*/*.js
!**/*.integ.snapshot/**/asset.*/*.d.ts
!**/*.snapshot/**/asset.*/*.js
!**/*.snapshot/**/asset.*/*.d.ts

!**/*.integ.snapshot/**/asset.*/**
!**/*.snapshot/**/asset.*/**
3 changes: 1 addition & 2 deletions packages/@aws-cdk/assert-internal/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,4 @@ jest.config.js
**/cdk.out
junit.xml
test/
**/*.integ.snapshot
**/*.integ.snapshot
**/*.snapshot
6 changes: 3 additions & 3 deletions packages/@aws-cdk/assert/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ junit.xml
README.md
jest.ts

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

!**/*.integ.snapshot/**/asset.*/**
!**/*.snapshot/**/asset.*/**
3 changes: 1 addition & 2 deletions packages/@aws-cdk/assert/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,4 @@ jest.config.js
**/cdk.out
junit.xml
test/
**/*.integ.snapshot
**/*.integ.snapshot
**/*.snapshot
6 changes: 3 additions & 3 deletions packages/@aws-cdk/assertions/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ tsconfig.json
!jest.config.js

junit.xml
!**/*.integ.snapshot/**/asset.*/*.js
!**/*.integ.snapshot/**/asset.*/*.d.ts
!**/*.snapshot/**/asset.*/*.js
!**/*.snapshot/**/asset.*/*.d.ts

!**/*.integ.snapshot/**/asset.*/**
!**/*.snapshot/**/asset.*/**
3 changes: 1 addition & 2 deletions packages/@aws-cdk/assertions/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,4 @@ test/
!.jsii
!*.js
!*.lit.ts
**/*.integ.snapshot
**/*.integ.snapshot
**/*.snapshot
6 changes: 3 additions & 3 deletions packages/@aws-cdk/assets/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ nyc.config.js

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

!**/*.integ.snapshot/**/asset.*/**
!**/*.snapshot/**/asset.*/**
3 changes: 1 addition & 2 deletions packages/@aws-cdk/assets/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,4 @@ junit.xml
test/
!*.lit.ts
jest.config.js
**/*.integ.snapshot
**/*.integ.snapshot
**/*.snapshot
6 changes: 3 additions & 3 deletions packages/@aws-cdk/aws-accessanalyzer/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ tsconfig.json
!jest.config.js

junit.xml
!**/*.integ.snapshot/**/asset.*/*.js
!**/*.integ.snapshot/**/asset.*/*.d.ts
!**/*.snapshot/**/asset.*/*.js
!**/*.snapshot/**/asset.*/*.d.ts

!**/*.integ.snapshot/**/asset.*/**
!**/*.snapshot/**/asset.*/**
3 changes: 1 addition & 2 deletions packages/@aws-cdk/aws-accessanalyzer/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,4 @@ jest.config.js
junit.xml
test/
!*.lit.ts
**/*.integ.snapshot
**/*.integ.snapshot
**/*.snapshot
6 changes: 3 additions & 3 deletions packages/@aws-cdk/aws-acmpca/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ coverage
!jest.config.js

junit.xml
!**/*.integ.snapshot/**/asset.*/*.js
!**/*.integ.snapshot/**/asset.*/*.d.ts
!**/*.snapshot/**/asset.*/*.js
!**/*.snapshot/**/asset.*/*.d.ts

!**/*.integ.snapshot/**/asset.*/**
!**/*.snapshot/**/asset.*/**
3 changes: 1 addition & 2 deletions packages/@aws-cdk/aws-acmpca/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,4 @@ jest.config.js
junit.xml
test/
!*.lit.ts
**/*.integ.snapshot
**/*.integ.snapshot
**/*.snapshot
6 changes: 3 additions & 3 deletions packages/@aws-cdk/aws-amazonmq/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ tsconfig.json
!jest.config.js

junit.xml
!**/*.integ.snapshot/**/asset.*/*.js
!**/*.integ.snapshot/**/asset.*/*.d.ts
!**/*.snapshot/**/asset.*/*.js
!**/*.snapshot/**/asset.*/*.d.ts

!**/*.integ.snapshot/**/asset.*/**
!**/*.snapshot/**/asset.*/**
3 changes: 1 addition & 2 deletions packages/@aws-cdk/aws-amazonmq/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,4 @@ jest.config.js
junit.xml
test/
!*.lit.ts
**/*.integ.snapshot
**/*.integ.snapshot
**/*.snapshot
6 changes: 3 additions & 3 deletions packages/@aws-cdk/aws-amplify/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ tsconfig.json
!jest.config.js

junit.xml
!**/*.integ.snapshot/**/asset.*/*.js
!**/*.integ.snapshot/**/asset.*/*.d.ts
!**/*.snapshot/**/asset.*/*.js
!**/*.snapshot/**/asset.*/*.d.ts

!**/*.integ.snapshot/**/asset.*/**
!**/*.snapshot/**/asset.*/**
3 changes: 1 addition & 2 deletions packages/@aws-cdk/aws-amplify/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,4 @@ jest.config.js
junit.xml
test/
!*.lit.ts
**/*.integ.snapshot
**/*.integ.snapshot
**/*.snapshot
6 changes: 3 additions & 3 deletions packages/@aws-cdk/aws-amplifyuibuilder/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ nyc.config.js
!jest.config.js
junit.xml

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

!**/*.integ.snapshot/**/asset.*/**
!**/*.snapshot/**/asset.*/**
3 changes: 1 addition & 2 deletions packages/@aws-cdk/aws-amplifyuibuilder/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,4 @@ junit.xml
test/
!*.lit.ts

**/*.integ.snapshot
**/*.integ.snapshot
**/*.snapshot
6 changes: 3 additions & 3 deletions packages/@aws-cdk/aws-apigateway/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ nyc.config.js
!jest.config.js

junit.xml
!**/*.integ.snapshot/**/asset.*/*.js
!**/*.integ.snapshot/**/asset.*/*.d.ts
!**/*.snapshot/**/asset.*/*.js
!**/*.snapshot/**/asset.*/*.d.ts

!**/*.integ.snapshot/**/asset.*/**
!**/*.snapshot/**/asset.*/**
3 changes: 1 addition & 2 deletions packages/@aws-cdk/aws-apigateway/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,4 @@ jest.config.js
junit.xml
test/
!*.lit.ts
**/*.integ.snapshot
**/*.integ.snapshot
**/*.snapshot
6 changes: 3 additions & 3 deletions packages/@aws-cdk/aws-apigatewayv2-authorizers/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ tsconfig.json
!jest.config.js

junit.xml
!**/*.integ.snapshot/**/asset.*/*.js
!**/*.integ.snapshot/**/asset.*/*.d.ts
!**/*.snapshot/**/asset.*/*.js
!**/*.snapshot/**/asset.*/*.d.ts

!**/*.integ.snapshot/**/asset.*/**
!**/*.snapshot/**/asset.*/**
3 changes: 1 addition & 2 deletions packages/@aws-cdk/aws-apigatewayv2-authorizers/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,4 @@ jest.config.js
junit.xml
test/
!*.lit.ts
**/*.integ.snapshot
**/*.integ.snapshot
**/*.snapshot
Loading

0 comments on commit 129c695

Please sign in to comment.