Skip to content

Commit c9a5c3b

Browse files
AaronZyLeeKamil Sobolalharris-at
authored
fix: e2e testing (#554)
* ci: test on cli rc * chore: use latest peer dependencies * fix: downgrade jest version for ci * fix: indexer access * fix: add force exit flag * skip flutter related e2e tests * skip most pull test cases * add back tests --------- Co-authored-by: Kamil Sobol <[email protected]> Co-authored-by: Al Harris <[email protected]>
1 parent cbddf45 commit c9a5c3b

File tree

9 files changed

+975
-1096
lines changed

9 files changed

+975
-1096
lines changed

.circleci/config.base.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ install_cli_with_local_codegen: &install_cli
5858
startLocalRegistry "$(pwd)/.circleci/verdaccio.yaml"
5959
setNpmRegistryUrlToLocal
6060
changeNpmGlobalPath
61-
npm install -g @aws-amplify/cli-internal
61+
npm install -g @aws-amplify/cli-internal@11.0.0-rc.e5f00c392.0
6262
amplify -v
6363
npm list --global --depth=1
6464
unsetNpmRegistryUrl
@@ -184,7 +184,7 @@ jobs:
184184
name: Run e2e tests
185185
command: |
186186
cd packages/amplify-codegen-e2e-tests
187-
yarn e2e --maxWorkers=3 $TEST_SUITE
187+
yarn e2e --forceExit --maxWorkers=3 $TEST_SUITE
188188
no_output_timeout: 20m
189189
- store_test_results:
190190
path: packages/amplify-codegen-e2e-tests/
@@ -215,7 +215,7 @@ jobs:
215215
name: Run e2e tests
216216
command: |
217217
cd packages/amplify-codegen-e2e-tests
218-
yarn e2e --maxWorkers=3 $TEST_SUITE
218+
yarn e2e --forceExit --maxWorkers=3 $TEST_SUITE
219219
no_output_timeout: 20m
220220
- store_test_results:
221221
path: packages/amplify-codegen-e2e-tests/
@@ -241,7 +241,7 @@ jobs:
241241
name: Run e2e tests
242242
command: |
243243
cd packages/amplify-codegen-e2e-tests
244-
yarn e2e --maxWorkers=3 $TEST_SUITE
244+
yarn e2e --forceExit --maxWorkers=3 $TEST_SUITE
245245
no_output_timeout: 20m
246246
- store_test_results:
247247
path: packages/amplify-codegen-e2e-tests/

.circleci/config.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ install_cli_with_local_codegen: &ref_3
5454
startLocalRegistry "$(pwd)/.circleci/verdaccio.yaml"
5555
setNpmRegistryUrlToLocal
5656
changeNpmGlobalPath
57-
npm install -g @aws-amplify/cli-internal
57+
npm install -g @aws-amplify/cli-internal@11.0.0-rc.e5f00c392.0
5858
amplify -v
5959
npm list --global --depth=1
6060
unsetNpmRegistryUrl
@@ -197,7 +197,7 @@ jobs:
197197
name: Run e2e tests
198198
command: |
199199
cd packages/amplify-codegen-e2e-tests
200-
yarn e2e --maxWorkers=3 $TEST_SUITE
200+
yarn e2e --forceExit --maxWorkers=3 $TEST_SUITE
201201
no_output_timeout: 20m
202202
- store_test_results:
203203
path: packages/amplify-codegen-e2e-tests/
@@ -228,7 +228,7 @@ jobs:
228228
name: Run e2e tests
229229
command: |
230230
cd packages/amplify-codegen-e2e-tests
231-
yarn e2e --maxWorkers=3 $TEST_SUITE
231+
yarn e2e --forceExit --maxWorkers=3 $TEST_SUITE
232232
no_output_timeout: 20m
233233
- store_test_results:
234234
path: packages/amplify-codegen-e2e-tests/
@@ -254,7 +254,7 @@ jobs:
254254
name: Run e2e tests
255255
command: |
256256
cd packages/amplify-codegen-e2e-tests
257-
yarn e2e --maxWorkers=3 $TEST_SUITE
257+
yarn e2e --forceExit --maxWorkers=3 $TEST_SUITE
258258
no_output_timeout: 20m
259259
- store_test_results:
260260
path: packages/amplify-codegen-e2e-tests/

package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@
6262
"@commitlint/cli": "^17.0.3",
6363
"@commitlint/config-conventional": "^17.0.3",
6464
"@commitlint/config-lerna-scopes": "^17.0.2",
65-
"@types/jest": "^28.1.6",
66-
"@types/js-yaml": "^3.12.3",
65+
"@types/jest": "^27.0.0",
66+
"@types/js-yaml": "^4.0.0",
6767
"@typescript-eslint/eslint-plugin": "^4.0.0",
6868
"@typescript-eslint/parser": "^4.0.0",
6969
"cmd-shim": "^3.0.3",
@@ -84,20 +84,20 @@
8484
"eslint-plugin-spellcheck": "^0.0.17",
8585
"glob": "^7.1.6",
8686
"husky": "^3.0.3",
87-
"jest": "^28.1.3",
88-
"jest-circus": "^28.1.3",
89-
"jest-junit": "^14.0.0",
90-
"js-yaml": "3.13.1",
87+
"jest": "^27.0.0",
88+
"jest-circus": "^27.0.0",
89+
"jest-junit": "^12.0.0",
90+
"js-yaml": "^4.0.0",
9191
"lnk": "1.1.0",
9292
"prettier": "^1.19.1",
9393
"prettier-eslint": "^9.0.1",
9494
"pretty-quick": "^3.1.0",
9595
"rimraf": "^3.0.0",
96-
"ts-jest": "^28.0.7",
96+
"ts-jest": "^27.0.0",
9797
"ts-node": "^8.10.1",
9898
"typescript": "4.7.4",
99-
"amplify-cli-core": "^3.0.0",
100-
"graphql-transformer-core": "^7.2.1",
99+
"amplify-cli-core": "4.0.0-rc.e5f00c392.0",
100+
"graphql-transformer-core": "^8.0.0",
101101
"amplify-headless-interface": "^1.13.1"
102102
},
103103
"resolutions": {

packages/amplify-codegen-e2e-core/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
"uuid": "7.0.1"
3636
},
3737
"peerDependencies": {
38-
"amplify-cli-core": "^3.0.0",
38+
"amplify-cli-core": "4.0.0-rc.e5f00c392.0",
3939
"amplify-headless-interface": "^1.13.1",
40-
"graphql-transformer-core": "^7.6.6"
40+
"graphql-transformer-core": "^8.0.0"
4141
}
4242
}

packages/amplify-codegen-e2e-tests/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@
3737
"yargs": "^15.1.0"
3838
},
3939
"devDependencies": {
40-
"@types/jest": "^28.1.6",
41-
"ts-node": "^8.9.0"
40+
"@types/jest": "^27.0.0",
41+
"ts-node": "^8.10.1"
4242
},
4343
"peerDependencies": {
44-
"amplify-cli-core": "^3.0.0",
45-
"graphql-transformer-core": "^7.6.6"
44+
"amplify-cli-core": "4.0.0-rc.e5f00c392.0",
45+
"graphql-transformer-core": "^8.0.0"
4646
},
4747
"jest": {
4848
"verbose": false,

packages/amplify-codegen-e2e-tests/src/codegen-tests-base/remove-codegen.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@ export async function testRemoveCodegen(config: AmplifyFrontendConfig, projectRo
3434
expect(isNotEmptyDir(path.join(projectRoot, config.graphqlCodegenDir))).toBe(true);
3535
// graphql configuration should be updated to remove previous configuration
3636
const generatedConfig = load(readFileSync(getGraphQLConfigFilePath(projectRoot)).toString());
37-
expect(Object.keys(generatedConfig.projects).length).toEqual(0);
38-
}
37+
expect(Object.keys(generatedConfig['projects']).length).toEqual(0);
38+
}

packages/amplify-codegen-e2e-tests/src/codegen-tests-base/test-setup.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ export async function testValidGraphQLConfig(
4848
expect(existsSync(getGraphQLConfigFilePath(projectRoot))).toBe(true);
4949

5050
const generatedConfig = load(readFileSync(getGraphQLConfigFilePath(projectRoot)).toString());
51-
Object.keys(generatedConfig.projects).forEach(projectName => {
52-
const projectConfig = generatedConfig.projects[projectName];
51+
Object.keys(generatedConfig['projects']).forEach(projectName => {
52+
const projectConfig = generatedConfig['projects'][projectName];
5353
const expectedProjectConfig = constructGraphQLConfig(projectName, config, maxDepth, region, isConfigured);
5454
// check if the graphql codegen configuration is valid
5555
expect(projectConfig).toEqual(expectedProjectConfig);

packages/amplify-codegen/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@
3737
"slash": "^3.0.0"
3838
},
3939
"peerDependencies": {
40-
"amplify-cli-core": "^3.0.0",
41-
"graphql-transformer-core": "^7.2.1"
40+
"amplify-cli-core": "4.0.0-rc.e5f00c392.0",
41+
"graphql-transformer-core": "^8.0.0"
4242
},
4343
"jest": {
4444
"collectCoverage": true,

0 commit comments

Comments
 (0)