Skip to content

Commit

Permalink
chore: write test reports (aws#8989)
Browse files Browse the repository at this point in the history
CodeBuild support configuring `reports` in a build project, which allows viewing the reports generated by functional or integration tests. Instead of digging through the logs to find which test failed you can look at the report produced:
<img width="1029" alt="Screen Shot 2020-07-09 at 6 10 09 PM" src="https://user-images.githubusercontent.com/8578043/87105351-8e8b1900-c20f-11ea-92d0-ea6fd0f7cd73.png">
> See it in action in this [test pipeline](https://console.aws.amazon.com/codesuite/codepipeline/pipelines/cdk-codebuild-test-report-test/view?region=us-east-1) which tracks this very branch!

CodeBuild reports supports `jest` via the `junit-jest` plugin (codebuild [docs](https://docs.aws.amazon.com/codebuild/latest/userguide/test-report-jest.html) for jest support). To enable this in our build and integ tests this PR adds:

* `jest-junit` dependency to `cdk-build-tools` and `cdk-integ-tools` (Apache-2.0 License)
* `reporters` configurations to `jest.config.js ` file to `cdk-build-tools` and `cdk-integ-tools`
*  `reports` configuration to our `buildspec.yaml`
*  adds the generated `junit.xml` files to `.npmignore` and `.gitignore` 

Merging this PR will configure the reports in our build stage, and allows configuring reports in our integ tests, a separate PR to our ops repo is required to add the reports to our integ tests (coming!)


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
NetaNir authored Jul 10, 2020
1 parent a26553a commit 3562ea1
Show file tree
Hide file tree
Showing 338 changed files with 702 additions and 172 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ coverage/
*.sw[a-z]
*~
.idea
junit.xml

# We don't want tsconfig at the root
/tsconfig.json
Expand All @@ -38,3 +39,4 @@ yarn-error.log

# Parcel default cache directory
.parcel-cache

5 changes: 5 additions & 0 deletions buildspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,8 @@ artifacts:
files:
- "**/*"
base-directory: dist
reports:
jest-tests:
files:
- "**/junit.xml"
file-format: JunitXml
2 changes: 2 additions & 0 deletions packages/@aws-cdk/alexa-ask/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ dist
tsconfig.json
!.eslintrc.js
!jest.config.js

junit.xml
3 changes: 2 additions & 1 deletion packages/@aws-cdk/alexa-ask/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ tsconfig.json
jest.config.js

# exclude cdk artifacts
**/cdk.out
**/cdk.out
junit.xml
2 changes: 2 additions & 0 deletions packages/@aws-cdk/app-delivery/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ tsconfig.json
*.snk
coverage
!.eslintrc.js

junit.xml
3 changes: 2 additions & 1 deletion packages/@aws-cdk/app-delivery/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ tsconfig.json
.eslintrc.js

# exclude cdk artifacts
**/cdk.out
**/cdk.out
junit.xml
2 changes: 2 additions & 0 deletions packages/@aws-cdk/assert/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ nyc.config.js
*.snk
!.eslintrc.js
!jest.config.js

junit.xml
3 changes: 2 additions & 1 deletion packages/@aws-cdk/assert/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ tsconfig.json
jest.config.js

# exclude cdk artifacts
**/cdk.out
**/cdk.out
junit.xml
2 changes: 2 additions & 0 deletions packages/@aws-cdk/assets/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ nyc.config.js
.LAST_PACKAGE
*.snk
!.eslintrc.js

junit.xml
3 changes: 2 additions & 1 deletion packages/@aws-cdk/assets/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@ tsconfig.json
.eslintrc.js

# exclude cdk artifacts
**/cdk.out
**/cdk.out
junit.xml
2 changes: 2 additions & 0 deletions packages/@aws-cdk/aws-accessanalyzer/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ dist
tsconfig.json
!.eslintrc.js
!jest.config.js

junit.xml
3 changes: 2 additions & 1 deletion packages/@aws-cdk/aws-accessanalyzer/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ tsconfig.json
jest.config.js

# exclude cdk artifacts
**/cdk.out
**/cdk.out
junit.xml
2 changes: 2 additions & 0 deletions packages/@aws-cdk/aws-acmpca/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ coverage
*.snk
!.eslintrc.js
!jest.config.js

junit.xml
3 changes: 2 additions & 1 deletion packages/@aws-cdk/aws-acmpca/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ tsconfig.json
jest.config.js

# exclude cdk artifacts
**/cdk.out
**/cdk.out
junit.xml
2 changes: 2 additions & 0 deletions packages/@aws-cdk/aws-amazonmq/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ tsconfig.json
*.snk
!.eslintrc.js
!jest.config.js

junit.xml
3 changes: 2 additions & 1 deletion packages/@aws-cdk/aws-amazonmq/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@ tsconfig.json
jest.config.js

# exclude cdk artifacts
**/cdk.out
**/cdk.out
junit.xml
2 changes: 2 additions & 0 deletions packages/@aws-cdk/aws-amplify/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ dist
tsconfig.json
!.eslintrc.js
!jest.config.js

junit.xml
3 changes: 2 additions & 1 deletion packages/@aws-cdk/aws-amplify/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@ tsconfig.json
jest.config.js

# exclude cdk artifacts
**/cdk.out
**/cdk.out
junit.xml
2 changes: 2 additions & 0 deletions packages/@aws-cdk/aws-apigateway/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ nyc.config.js
.LAST_PACKAGE
*.snk
!.eslintrc.js

junit.xml
3 changes: 2 additions & 1 deletion packages/@aws-cdk/aws-apigateway/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@ tsconfig.json
.eslintrc.js

# exclude cdk artifacts
**/cdk.out
**/cdk.out
junit.xml
2 changes: 2 additions & 0 deletions packages/@aws-cdk/aws-apigatewayv2/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ dist
tsconfig.json
!.eslintrc.js
!jest.config.js

junit.xml
3 changes: 2 additions & 1 deletion packages/@aws-cdk/aws-apigatewayv2/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ tsconfig.json
jest.config.js

# exclude cdk artifacts
**/cdk.out
**/cdk.out
junit.xml
2 changes: 2 additions & 0 deletions packages/@aws-cdk/aws-appconfig/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ coverage
nyc.config.js
!.eslintrc.js
!jest.config.js

junit.xml
3 changes: 2 additions & 1 deletion packages/@aws-cdk/aws-appconfig/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ tsconfig.json
jest.config.js

# exclude cdk artifacts
**/cdk.out
**/cdk.out
junit.xml
2 changes: 2 additions & 0 deletions packages/@aws-cdk/aws-applicationautoscaling/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ nyc.config.js
.LAST_PACKAGE
*.snk
!.eslintrc.js

junit.xml
3 changes: 2 additions & 1 deletion packages/@aws-cdk/aws-applicationautoscaling/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@ tsconfig.json
.eslintrc.js

# exclude cdk artifacts
**/cdk.out
**/cdk.out
junit.xml
2 changes: 2 additions & 0 deletions packages/@aws-cdk/aws-appmesh/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ coverage
dist
tsconfig.json
!.eslintrc.js

junit.xml
3 changes: 2 additions & 1 deletion packages/@aws-cdk/aws-appmesh/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ tsconfig.json
.eslintrc.js

# exclude cdk artifacts
**/cdk.out
**/cdk.out
junit.xml
2 changes: 2 additions & 0 deletions packages/@aws-cdk/aws-appstream/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ dist
tsconfig.json
!.eslintrc.js
!jest.config.js

junit.xml
3 changes: 2 additions & 1 deletion packages/@aws-cdk/aws-appstream/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ tsconfig.json
jest.config.js

# exclude cdk artifacts
**/cdk.out
**/cdk.out
junit.xml
2 changes: 2 additions & 0 deletions packages/@aws-cdk/aws-appsync/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ nyc.config.js
*.snk
!.eslintrc.js
!jest.config.js

junit.xml
3 changes: 2 additions & 1 deletion packages/@aws-cdk/aws-appsync/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ tsconfig.json
jest.config.js

# exclude cdk artifacts
**/cdk.out
**/cdk.out
junit.xml
2 changes: 2 additions & 0 deletions packages/@aws-cdk/aws-athena/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ nyc.config.js
*.snk
!.eslintrc.js
!jest.config.js

junit.xml
3 changes: 2 additions & 1 deletion packages/@aws-cdk/aws-athena/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ tsconfig.json
jest.config.js

# exclude cdk artifacts
**/cdk.out
**/cdk.out
junit.xml
2 changes: 2 additions & 0 deletions packages/@aws-cdk/aws-autoscaling-common/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ tsconfig.json

*.snk
!.eslintrc.js

junit.xml
3 changes: 2 additions & 1 deletion packages/@aws-cdk/aws-autoscaling-common/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ tsconfig.json
.eslintrc.js

# exclude cdk artifacts
**/cdk.out
**/cdk.out
junit.xml
2 changes: 2 additions & 0 deletions packages/@aws-cdk/aws-autoscaling-hooktargets/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ nyc.config.js
*.snk
!.eslintrc.js
!jest.config.js

junit.xml
3 changes: 2 additions & 1 deletion packages/@aws-cdk/aws-autoscaling-hooktargets/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ tsconfig.json
jest.config.js

# exclude cdk artifacts
**/cdk.out
**/cdk.out
junit.xml
3 changes: 2 additions & 1 deletion packages/@aws-cdk/aws-autoscaling/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ nyc.config.js
*.snk
!.eslintrc.js

!jest.config.js
!jest.config.js
junit.xml
3 changes: 2 additions & 1 deletion packages/@aws-cdk/aws-autoscaling/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ tsconfig.json

# exclude cdk artifacts
**/cdk.out
jest.config.js
jest.config.js
junit.xml
2 changes: 2 additions & 0 deletions packages/@aws-cdk/aws-autoscalingplans/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ nyc.config.js
*.snk
!.eslintrc.js
!jest.config.js

junit.xml
3 changes: 2 additions & 1 deletion packages/@aws-cdk/aws-autoscalingplans/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ tsconfig.json
jest.config.js

# exclude cdk artifacts
**/cdk.out
**/cdk.out
junit.xml
2 changes: 2 additions & 0 deletions packages/@aws-cdk/aws-backup/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ dist
tsconfig.json
!.eslintrc.js
!jest.config.js

junit.xml
3 changes: 2 additions & 1 deletion packages/@aws-cdk/aws-backup/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ tsconfig.json
jest.config.js

# exclude cdk artifacts
**/cdk.out
**/cdk.out
junit.xml
2 changes: 2 additions & 0 deletions packages/@aws-cdk/aws-batch/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ nyc.config.js
*.snk
!.eslintrc.js
!jest.config.js

junit.xml
3 changes: 2 additions & 1 deletion packages/@aws-cdk/aws-batch/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ tsconfig.json
jest.config.js

# exclude cdk artifacts
**/cdk.out
**/cdk.out
junit.xml
2 changes: 2 additions & 0 deletions packages/@aws-cdk/aws-budgets/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ nyc.config.js
*.snk
!.eslintrc.js
!jest.config.js

junit.xml
3 changes: 2 additions & 1 deletion packages/@aws-cdk/aws-budgets/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ tsconfig.json
jest.config.js

# exclude cdk artifacts
**/cdk.out
**/cdk.out
junit.xml
2 changes: 2 additions & 0 deletions packages/@aws-cdk/aws-cassandra/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ coverage
nyc.config.js
!.eslintrc.js
!jest.config.js

junit.xml
Loading

0 comments on commit 3562ea1

Please sign in to comment.