Skip to content

Commit

Permalink
test: update circleci to run mock e2e tests for each pr (aws-amplify#…
Browse files Browse the repository at this point in the history
…2341)

Run Amplify Mock e2e tests as part of PR. These tests don't provision any resources in the cloud but generate JWT tokens locally to simulate authz users
  • Loading branch information
yuth authored Sep 24, 2019
1 parent f33c21f commit 496484e
Show file tree
Hide file tree
Showing 12 changed files with 284 additions and 664 deletions.
15 changes: 10 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ jobs:
name: Run Transformer end-to-end tests with mock server
command: cd packages/amplify-util-mock/ && yarn e2e
no_output_timeout: 90m
environment:
JEST_JUNIT_OUTPUT: "reports/junit/js-test-results.xml"
- store_test_results:
path: packages/amplify-util-mock/

amplify_e2e_tests:
<<: *defaults
Expand Down Expand Up @@ -423,12 +427,8 @@ workflows:
requires:
- build
- integration_test_ios
- mock_e2e_tests
- mock_e2e_tests:
filters:
branches:
only:
- master
- beta
requires:
- build
- integration_test:
Expand All @@ -440,6 +440,7 @@ workflows:
requires:
- build
- integration_test_ios
- mock_e2e_tests
- amplify_e2e_tests:
filters:
branches:
Expand All @@ -448,13 +449,15 @@ workflows:
requires:
- build
- integration_test_ios
- mock_e2e_tests
- deploy:
requires:
- build
- test
- integration_test
- graphql_e2e_tests
- amplify_e2e_tests
- mock_e2e_tests
filters:
branches:
only:
Expand All @@ -469,6 +472,7 @@ workflows:
requires:
- build
- test
- mock_e2e_tests
- integration_test_ios:
filters:
branches:
Expand All @@ -477,3 +481,4 @@ workflows:
requires:
- build
- test
- mock_e2e_tests
4 changes: 3 additions & 1 deletion packages/amplify-util-mock/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
lib
lib
coverage
reports
16 changes: 14 additions & 2 deletions packages/amplify-util-mock/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "amplify cli plugin providing local testing",
"main": "lib/index.js",
"scripts": {
"e2e": "jest -w 1 --forceExit src/__e2e__/*.e2e.test.ts",
"e2e": "jest --runInBand --forceExit src/__e2e__/*.e2e.test.ts",
"test-watch": "jest --watch",
"build": "tsc",
"watch": "tsc -w",
Expand Down Expand Up @@ -47,7 +47,9 @@
"ts-jest": "^24.0.2",
"tslint": "^5.18.0",
"typescript": "^3.5.3",
"uuid": "^3.3.3"
"uuid": "^3.3.3",
"jsonwebtoken": "^8.5.1",
"jest-junit": "^8.0.0"
},
"jest": {
"transform": {
Expand All @@ -59,6 +61,10 @@
"!**/node_modules/**",
"!src/__tests__/**"
],
"reporters": [
"default",
"jest-junit"
],
"testEnvironment": "node",
"testURL": "http://localhost/",
"testRegex": "(src/(__tests__|__e2e__)/.*.test.ts)$",
Expand All @@ -70,5 +76,11 @@
"json",
"node"
]
},
"jest-junit": {
"outputDirectory": "reports/junit/",
"outputName": "js-test-results.xml",
"usePathForSuiteName": "true",
"addFileAttribute": "true"
}
}
Loading

0 comments on commit 496484e

Please sign in to comment.