From 47091a83448cfefe04fff41027d35208d5fced3c Mon Sep 17 00:00:00 2001 From: amplify-data-ci Date: Mon, 5 Feb 2024 18:44:08 +0000 Subject: [PATCH 01/45] chore: update .jsii assembly --- packages/amplify-graphql-api-construct/.jsii | 32 ++++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/packages/amplify-graphql-api-construct/.jsii b/packages/amplify-graphql-api-construct/.jsii index 9138d053a1..b640b564e8 100644 --- a/packages/amplify-graphql-api-construct/.jsii +++ b/packages/amplify-graphql-api-construct/.jsii @@ -8,19 +8,19 @@ "bundled": { "@aws-amplify/backend-output-schemas": "^0.4.0", "@aws-amplify/backend-output-storage": "^0.2.2", - "@aws-amplify/graphql-auth-transformer": "3.3.5", - "@aws-amplify/graphql-default-value-transformer": "2.2.4", - "@aws-amplify/graphql-function-transformer": "2.1.16", - "@aws-amplify/graphql-http-transformer": "2.1.16", - "@aws-amplify/graphql-index-transformer": "2.3.4", - "@aws-amplify/graphql-maps-to-transformer": "3.4.5", - "@aws-amplify/graphql-model-transformer": "2.4.4", - "@aws-amplify/graphql-predictions-transformer": "2.1.16", - "@aws-amplify/graphql-relational-transformer": "2.3.5", - "@aws-amplify/graphql-searchable-transformer": "2.5.1", - "@aws-amplify/graphql-sql-transformer": "0.2.4", - "@aws-amplify/graphql-transformer": "1.3.9", - "@aws-amplify/graphql-transformer-core": "2.4.4", + "@aws-amplify/graphql-auth-transformer": "3.3.6", + "@aws-amplify/graphql-default-value-transformer": "2.2.5", + "@aws-amplify/graphql-function-transformer": "2.1.17", + "@aws-amplify/graphql-http-transformer": "2.1.17", + "@aws-amplify/graphql-index-transformer": "2.3.5", + "@aws-amplify/graphql-maps-to-transformer": "3.4.6", + "@aws-amplify/graphql-model-transformer": "2.4.5", + "@aws-amplify/graphql-predictions-transformer": "2.1.17", + "@aws-amplify/graphql-relational-transformer": "2.3.6", + "@aws-amplify/graphql-searchable-transformer": "2.5.2", + "@aws-amplify/graphql-sql-transformer": "0.2.5", + "@aws-amplify/graphql-transformer": "1.3.10", + "@aws-amplify/graphql-transformer-core": "2.4.5", "@aws-amplify/graphql-transformer-interfaces": "3.3.3", "@aws-amplify/platform-core": "^0.2.0", "@aws-amplify/plugin-types": "^0.4.1", @@ -30,7 +30,7 @@ "graceful-fs": "^4.2.11", "graphql": "^15.5.0", "graphql-mapping-template": "4.20.14", - "graphql-transformer-common": "4.27.1", + "graphql-transformer-common": "4.28.0", "hjson": "^3.2.2", "immer": "^9.0.12", "is-buffer": "^2.0.5", @@ -7959,6 +7959,6 @@ "symbolId": "src/model-datasource-strategy-types:VpcConfig" } }, - "version": "1.5.5", - "fingerprint": "fdHplvkQ/uSY75bVKQ6OuFY6B1QM19f9G2Tg1PHZUm0=" + "version": "1.5.6", + "fingerprint": "SvOvsJZJtGh48GTfFeDR9pC5pCJAxPM/q1Eq8vtpVK0=" } \ No newline at end of file From 2bd8138266088590388c674a9209e5041a8374bd Mon Sep 17 00:00:00 2001 From: amplify-data-ci Date: Mon, 5 Feb 2024 18:44:20 +0000 Subject: [PATCH 02/45] chore: update .jsii assembly --- packages/amplify-data-construct/.jsii | 34 +++++++++++++-------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/packages/amplify-data-construct/.jsii b/packages/amplify-data-construct/.jsii index 518a78e05e..d98e12c627 100644 --- a/packages/amplify-data-construct/.jsii +++ b/packages/amplify-data-construct/.jsii @@ -8,19 +8,19 @@ "bundled": { "@aws-amplify/backend-output-schemas": "^0.4.0", "@aws-amplify/backend-output-storage": "^0.2.2", - "@aws-amplify/graphql-auth-transformer": "3.3.5", - "@aws-amplify/graphql-default-value-transformer": "2.2.4", - "@aws-amplify/graphql-function-transformer": "2.1.16", - "@aws-amplify/graphql-http-transformer": "2.1.16", - "@aws-amplify/graphql-index-transformer": "2.3.4", - "@aws-amplify/graphql-maps-to-transformer": "3.4.5", - "@aws-amplify/graphql-model-transformer": "2.4.4", - "@aws-amplify/graphql-predictions-transformer": "2.1.16", - "@aws-amplify/graphql-relational-transformer": "2.3.5", - "@aws-amplify/graphql-searchable-transformer": "2.5.1", - "@aws-amplify/graphql-sql-transformer": "0.2.4", - "@aws-amplify/graphql-transformer": "1.3.9", - "@aws-amplify/graphql-transformer-core": "2.4.4", + "@aws-amplify/graphql-auth-transformer": "3.3.6", + "@aws-amplify/graphql-default-value-transformer": "2.2.5", + "@aws-amplify/graphql-function-transformer": "2.1.17", + "@aws-amplify/graphql-http-transformer": "2.1.17", + "@aws-amplify/graphql-index-transformer": "2.3.5", + "@aws-amplify/graphql-maps-to-transformer": "3.4.6", + "@aws-amplify/graphql-model-transformer": "2.4.5", + "@aws-amplify/graphql-predictions-transformer": "2.1.17", + "@aws-amplify/graphql-relational-transformer": "2.3.6", + "@aws-amplify/graphql-searchable-transformer": "2.5.2", + "@aws-amplify/graphql-sql-transformer": "0.2.5", + "@aws-amplify/graphql-transformer": "1.3.10", + "@aws-amplify/graphql-transformer-core": "2.4.5", "@aws-amplify/graphql-transformer-interfaces": "3.3.3", "@aws-amplify/platform-core": "^0.2.0", "@aws-amplify/plugin-types": "^0.4.1", @@ -30,7 +30,7 @@ "graceful-fs": "^4.2.11", "graphql": "^15.5.0", "graphql-mapping-template": "4.20.14", - "graphql-transformer-common": "4.27.1", + "graphql-transformer-common": "4.28.0", "hjson": "^3.2.2", "immer": "^9.0.12", "is-buffer": "^2.0.5", @@ -45,7 +45,7 @@ "zod": "^3.22.3" }, "dependencies": { - "@aws-amplify/graphql-api-construct": "1.5.5", + "@aws-amplify/graphql-api-construct": "1.5.6", "aws-cdk-lib": "^2.80.0", "constructs": "^10.0.5" }, @@ -3533,6 +3533,6 @@ } }, "types": {}, - "version": "1.5.5", - "fingerprint": "pbRHyrUEL9+xAdiNaD3uQ3AejOrLpUbvOF2EiV4VGns=" + "version": "1.5.6", + "fingerprint": "Cs8FBPeMyhdq8Ijsvc8z+r16mapYgWEhRw/1XpE1jLo=" } \ No newline at end of file From 07be19012a0f1d2e6bd67124bab22e4b22559f4b Mon Sep 17 00:00:00 2001 From: Christopher Sundersingh <83315412+sundersc@users.noreply.github.com> Date: Mon, 5 Feb 2024 11:12:24 -0800 Subject: [PATCH 03/45] test(api): await async event handler call in canary (#2242) * test(api): await async event handler call in canary * fixed more async invocations --- .../src/components/CRUDLComponents.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/client-test-apps/js/api-model-relationship-app/src/components/CRUDLComponents.tsx b/client-test-apps/js/api-model-relationship-app/src/components/CRUDLComponents.tsx index c4d69fd032..42025120f4 100644 --- a/client-test-apps/js/api-model-relationship-app/src/components/CRUDLComponents.tsx +++ b/client-test-apps/js/api-model-relationship-app/src/components/CRUDLComponents.tsx @@ -35,7 +35,7 @@ export const createDetailComponent = ({ deleteMutation, recordNam ? : } - + { detailState === 'view' ? @@ -67,7 +67,7 @@ export const createCreateRecordComponent = ({ recordName, createMutation, sentin Create A { capitalizedRecordName } { setId(event.target.value) }}/> - + @@ -102,7 +102,7 @@ export const createGetRecordComponent = ({ getQuery, recordName, Get A { capitalizedRecordName } { setId(event.target.value) }}/> - +
@@ -138,7 +138,7 @@ export const createListComponent = ({ listQuery, recordName, Deta List { capitalizedPluralizedRecordName } - +
@@ -204,7 +204,7 @@ export const createEditComp = ({ updateMutation, fields, recor }} /> ) }) } - + } From b7cd81d763e17eb31d6f4fc0dde8391fe0579d8f Mon Sep 17 00:00:00 2001 From: Christopher Sundersingh <83315412+sundersc@users.noreply.github.com> Date: Mon, 5 Feb 2024 12:45:44 -0800 Subject: [PATCH 04/45] fix(api): clean stale cdk amplify table roles (#2249) --- packages/amplify-e2e-tests/src/cleanup-e2e-resources.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/amplify-e2e-tests/src/cleanup-e2e-resources.ts b/packages/amplify-e2e-tests/src/cleanup-e2e-resources.ts index 7b1b3a139e..29a65d393e 100644 --- a/packages/amplify-e2e-tests/src/cleanup-e2e-resources.ts +++ b/packages/amplify-e2e-tests/src/cleanup-e2e-resources.ts @@ -85,7 +85,7 @@ type AWSAccountInfo = { const BUCKET_TEST_REGEX = /test/; const IAM_TEST_REGEX = - /!RotateE2eAwsToken-e2eTestContextRole|-integtest$|^amplify-|^eu-|^us-|^ap-|^auth-exhaustive-tests|rds-schema-inspector-integtest|^amplify_e2e_tests_lambda|^JsonMockStack-jsonMockApi|^SubscriptionAuthV2Tests/; + /!RotateE2eAwsToken-e2eTestContextRole|-integtest$|^amplify-|^eu-|^us-|^ap-|^auth-exhaustive-tests|rds-schema-inspector-integtest|^amplify_e2e_tests_lambda|^JsonMockStack-jsonMockApi|^SubscriptionAuthV2Tests|^cdkamplifytable-/; const STALE_DURATION_MS = 2 * 60 * 60 * 1000; // 2 hours in milliseconds const isCI = (): boolean => !!(process.env.CI && process.env.CODEBUILD); From cc0f562bcd26b92d105ea395484c9737287d61ef Mon Sep 17 00:00:00 2001 From: Christopher Sundersingh <83315412+sundersc@users.noreply.github.com> Date: Tue, 6 Feb 2024 12:15:41 -0800 Subject: [PATCH 05/45] test(api): increase canary test yarn install timeout (#2255) --- shared-scripts.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shared-scripts.sh b/shared-scripts.sh index 83bffc38c8..7a86f4053b 100755 --- a/shared-scripts.sh +++ b/shared-scripts.sh @@ -243,7 +243,7 @@ function _runCanaryTest { _loadTestAccountCredentials _setShell cd client-test-apps/js/api-model-relationship-app - yarn + yarn --network-timeout 180000 retry yarn test:ci } function _scanArtifacts { @@ -434,4 +434,4 @@ function _emitCanaryMetric { --value $CODEBUILD_BUILD_SUCCEEDING \ --dimensions branch=main \ --region us-west-2 -} \ No newline at end of file +} From cd23fb9a9ad982198c10ebfba07d285871e5d62a Mon Sep 17 00:00:00 2001 From: Dane Pilcher Date: Wed, 7 Feb 2024 08:40:32 -0700 Subject: [PATCH 06/45] test: collect coverage from all source files (#2237) --- packages/amplify-category-api/package.json | 14 ++++++++++---- packages/amplify-data-construct/package.json | 8 +++++++- packages/amplify-dynamodb-simulator/package.json | 8 +++++++- packages/amplify-e2e-tests/package.json | 11 ++++++----- .../package.json | 11 ++++++----- .../amplify-graphql-api-construct/package.json | 10 ++++++++-- .../amplify-graphql-auth-transformer/package.json | 8 +++++++- .../package.json | 8 +++++++- .../package.json | 8 +++++++- .../amplify-graphql-http-transformer/package.json | 8 +++++++- .../amplify-graphql-index-transformer/package.json | 8 +++++++- .../amplify-graphql-migration-tests/package.json | 12 +++++++++--- .../amplify-graphql-model-transformer/package.json | 14 ++++++++++---- .../package.json | 8 +++++--- .../package.json | 8 +++++++- .../package.json | 10 ++++++++-- .../amplify-graphql-schema-generator/package.json | 8 +++++++- .../package.json | 8 +++++++- .../package.json | 8 +++++++- .../amplify-graphql-sql-transformer/package.json | 10 ++++++++-- .../amplify-graphql-transformer-core/package.json | 14 ++++++++++---- .../package.json | 6 ++++++ .../package.json | 8 +++++++- .../package.json | 14 ++++++++++---- packages/amplify-graphql-transformer/package.json | 8 +++++++- packages/amplify-schema-validator/jest.config.js | 1 + packages/amplify-util-mock/package.json | 12 +++++++----- packages/graphql-auth-transformer/package.json | 6 ++++++ .../graphql-connection-transformer/package.json | 6 ++++++ packages/graphql-dynamodb-transformer/package.json | 6 ++++++ .../graphql-elasticsearch-transformer/package.json | 6 ++++++ packages/graphql-function-transformer/package.json | 8 +++++++- packages/graphql-http-transformer/package.json | 8 +++++++- packages/graphql-key-transformer/package.json | 6 ++++++ packages/graphql-mapping-template/package.json | 12 +++++++++--- .../graphql-predictions-transformer/package.json | 8 +++++++- .../package.json | 8 +++++++- packages/graphql-transformer-common/package.json | 12 +++++++++--- packages/graphql-transformer-core/package.json | 10 ++++++++-- .../graphql-transformers-e2e-tests/package.json | 11 ++++++----- .../graphql-versioned-transformer/package.json | 8 +++++++- 41 files changed, 292 insertions(+), 74 deletions(-) diff --git a/packages/amplify-category-api/package.json b/packages/amplify-category-api/package.json index 13724b34bb..a7cdcd7626 100644 --- a/packages/amplify-category-api/package.json +++ b/packages/amplify-category-api/package.json @@ -103,9 +103,9 @@ "coverageProvider": "v8", "coverageThreshold": { "global": { - "branches": 70, - "functions": 45, - "lines": 50 + "branches": 68, + "functions": 42, + "lines": 40 } }, "coverageReporters": [ @@ -115,6 +115,12 @@ "moduleNameMapper": { "^csv-parse/sync": "/../../node_modules/csv-parse/dist/cjs/sync.cjs" }, - "testEnvironment": "../../FixJestEnvironment.js" + "testEnvironment": "../../FixJestEnvironment.js", + "collectCoverageFrom": [ + "src/**/*.ts" + ], + "coveragePathIgnorePatterns": [ + "/__tests__/" + ] } } diff --git a/packages/amplify-data-construct/package.json b/packages/amplify-data-construct/package.json index 84d9d86cc7..d7e9b12297 100644 --- a/packages/amplify-data-construct/package.json +++ b/packages/amplify-data-construct/package.json @@ -167,6 +167,12 @@ "clover", "text" ], - "testEnvironment": "../../FixJestEnvironment.js" + "testEnvironment": "../../FixJestEnvironment.js", + "collectCoverageFrom": [ + "src/**/*.ts" + ], + "coveragePathIgnorePatterns": [ + "/__tests__/" + ] } } diff --git a/packages/amplify-dynamodb-simulator/package.json b/packages/amplify-dynamodb-simulator/package.json index d6361f9bee..4fbaa8d2eb 100644 --- a/packages/amplify-dynamodb-simulator/package.json +++ b/packages/amplify-dynamodb-simulator/package.json @@ -44,6 +44,12 @@ }, "jest": { "testEnvironment": "node", - "collectCoverage": true + "collectCoverage": true, + "collectCoverageFrom": [ + "src/**/*.ts" + ], + "coveragePathIgnorePatterns": [ + "/__tests__/" + ] } } diff --git a/packages/amplify-e2e-tests/package.json b/packages/amplify-e2e-tests/package.json index 7b4bf651c7..189655e808 100644 --- a/packages/amplify-e2e-tests/package.json +++ b/packages/amplify-e2e-tests/package.json @@ -73,10 +73,7 @@ ], "collectCoverage": false, "collectCoverageFrom": [ - "src/**/*.ts", - "!**/node_modules/**", - "!src/__tests__/**", - "!**/*.d.ts" + "src/**/*.ts" ], "reporters": [ "default", @@ -117,7 +114,11 @@ "moduleNameMapper": { "axios": "axios/dist/node/axios.cjs", "^csv-parse/sync": "/../../node_modules/csv-parse/dist/cjs/sync.cjs" - } + }, + "coveragePathIgnorePatterns": [ + "/node_modules/", + "/__tests__/" + ] }, "jest-junit": { "outputDirectory": "reports/junit/", diff --git a/packages/amplify-graphql-api-construct-tests/package.json b/packages/amplify-graphql-api-construct-tests/package.json index e894375f9a..edb9496423 100644 --- a/packages/amplify-graphql-api-construct-tests/package.json +++ b/packages/amplify-graphql-api-construct-tests/package.json @@ -58,10 +58,7 @@ ], "collectCoverage": false, "collectCoverageFrom": [ - "src/**/*.ts", - "!**/node_modules/**", - "!src/__tests__/**", - "!**/*.d.ts" + "src/**/*.ts" ], "reporters": [ "default", @@ -98,7 +95,11 @@ }, "moduleNameMapper": { "axios": "axios/dist/node/axios.cjs" - } + }, + "coveragePathIgnorePatterns": [ + "/__tests__/", + "/node_modules/" + ] }, "jest-junit": { "outputDirectory": "reports/junit/", diff --git a/packages/amplify-graphql-api-construct/package.json b/packages/amplify-graphql-api-construct/package.json index 90f7108a31..f5eb6bccb7 100644 --- a/packages/amplify-graphql-api-construct/package.json +++ b/packages/amplify-graphql-api-construct/package.json @@ -162,13 +162,19 @@ "global": { "branches": 90, "functions": 90, - "lines": 90 + "lines": 60 } }, "coverageReporters": [ "clover", "text" ], - "testEnvironment": "../../FixJestEnvironment.js" + "testEnvironment": "../../FixJestEnvironment.js", + "collectCoverageFrom": [ + "src/**/*.ts" + ], + "coveragePathIgnorePatterns": [ + "/__tests__/" + ] } } diff --git a/packages/amplify-graphql-auth-transformer/package.json b/packages/amplify-graphql-auth-transformer/package.json index 73535f225d..a1d47e7e19 100644 --- a/packages/amplify-graphql-auth-transformer/package.json +++ b/packages/amplify-graphql-auth-transformer/package.json @@ -78,6 +78,12 @@ "clover", "text" ], - "testEnvironment": "../../FixJestEnvironment.js" + "testEnvironment": "../../FixJestEnvironment.js", + "collectCoverageFrom": [ + "src/**/*.ts" + ], + "coveragePathIgnorePatterns": [ + "/__tests__/" + ] } } diff --git a/packages/amplify-graphql-default-value-transformer/package.json b/packages/amplify-graphql-default-value-transformer/package.json index cee2084cb0..4299df9bf9 100644 --- a/packages/amplify-graphql-default-value-transformer/package.json +++ b/packages/amplify-graphql-default-value-transformer/package.json @@ -67,6 +67,12 @@ "clover", "text" ], - "testEnvironment": "../../FixJestEnvironment.js" + "testEnvironment": "../../FixJestEnvironment.js", + "collectCoverageFrom": [ + "src/**/*.ts" + ], + "coveragePathIgnorePatterns": [ + "/__tests__/" + ] } } diff --git a/packages/amplify-graphql-function-transformer/package.json b/packages/amplify-graphql-function-transformer/package.json index 6b0612352a..a947e51791 100644 --- a/packages/amplify-graphql-function-transformer/package.json +++ b/packages/amplify-graphql-function-transformer/package.json @@ -70,6 +70,12 @@ "modulePathIgnorePatterns": [ "overrides" ], - "testEnvironment": "../../FixJestEnvironment.js" + "testEnvironment": "../../FixJestEnvironment.js", + "collectCoverageFrom": [ + "src/**/*.ts" + ], + "coveragePathIgnorePatterns": [ + "/__tests__/" + ] } } diff --git a/packages/amplify-graphql-http-transformer/package.json b/packages/amplify-graphql-http-transformer/package.json index d0136adab1..a1458b3458 100644 --- a/packages/amplify-graphql-http-transformer/package.json +++ b/packages/amplify-graphql-http-transformer/package.json @@ -70,6 +70,12 @@ "modulePathIgnorePatterns": [ "overrides" ], - "testEnvironment": "../../FixJestEnvironment.js" + "testEnvironment": "../../FixJestEnvironment.js", + "collectCoverageFrom": [ + "src/**/*.ts" + ], + "coveragePathIgnorePatterns": [ + "/__tests__/" + ] } } diff --git a/packages/amplify-graphql-index-transformer/package.json b/packages/amplify-graphql-index-transformer/package.json index e587566ab0..ea732a8a7f 100644 --- a/packages/amplify-graphql-index-transformer/package.json +++ b/packages/amplify-graphql-index-transformer/package.json @@ -68,6 +68,12 @@ "clover", "text" ], - "testEnvironment": "../../FixJestEnvironment.js" + "testEnvironment": "../../FixJestEnvironment.js", + "collectCoverageFrom": [ + "src/**/*.ts" + ], + "coveragePathIgnorePatterns": [ + "/__tests__/" + ] } } diff --git a/packages/amplify-graphql-migration-tests/package.json b/packages/amplify-graphql-migration-tests/package.json index 1a64f87743..2cbf61cb28 100644 --- a/packages/amplify-graphql-migration-tests/package.json +++ b/packages/amplify-graphql-migration-tests/package.json @@ -25,8 +25,8 @@ "coverageProvider": "v8", "coverageThreshold": { "global": { - "branches": 81, - "functions": 84, + "branches": 78, + "functions": 78, "lines": 90 } }, @@ -47,7 +47,13 @@ "json", "node" ], - "testEnvironment": "../../FixJestEnvironment.js" + "testEnvironment": "../../FixJestEnvironment.js", + "collectCoverageFrom": [ + "src/**/*.ts" + ], + "coveragePathIgnorePatterns": [ + "/__tests__/" + ] }, "devDependencies": { "@aws-amplify/graphql-auth-transformer": "3.3.6", diff --git a/packages/amplify-graphql-model-transformer/package.json b/packages/amplify-graphql-model-transformer/package.json index fee0b5dbc9..2fe6636db9 100644 --- a/packages/amplify-graphql-model-transformer/package.json +++ b/packages/amplify-graphql-model-transformer/package.json @@ -65,9 +65,9 @@ "coverageProvider": "v8", "coverageThreshold": { "global": { - "branches": 75, - "functions": 80, - "lines": 85 + "branches": 65, + "functions": 77, + "lines": 73 } }, "coverageReporters": [ @@ -77,6 +77,12 @@ "modulePathIgnorePatterns": [ "overrides" ], - "testEnvironment": "../../FixJestEnvironment.js" + "testEnvironment": "../../FixJestEnvironment.js", + "collectCoverageFrom": [ + "src/**/*.ts" + ], + "coveragePathIgnorePatterns": [ + "/__tests__/" + ] } } diff --git a/packages/amplify-graphql-name-mapping-transformer/package.json b/packages/amplify-graphql-name-mapping-transformer/package.json index 26109853f5..f9cce73a33 100644 --- a/packages/amplify-graphql-name-mapping-transformer/package.json +++ b/packages/amplify-graphql-name-mapping-transformer/package.json @@ -63,8 +63,7 @@ "collectCoverage": true, "coverageProvider": "v8", "collectCoverageFrom": [ - "src/**", - "!src/__tests__/**" + "src/**/*.ts" ], "coverageThreshold": { "global": { @@ -77,6 +76,9 @@ "clover", "text" ], - "testEnvironment": "../../FixJestEnvironment.js" + "testEnvironment": "../../FixJestEnvironment.js", + "coveragePathIgnorePatterns": [ + "/__tests__/" + ] } } diff --git a/packages/amplify-graphql-predictions-transformer/package.json b/packages/amplify-graphql-predictions-transformer/package.json index 942d6c39cb..c609a39ad6 100644 --- a/packages/amplify-graphql-predictions-transformer/package.json +++ b/packages/amplify-graphql-predictions-transformer/package.json @@ -71,6 +71,12 @@ "modulePathIgnorePatterns": [ "overrides" ], - "testEnvironment": "../../FixJestEnvironment.js" + "testEnvironment": "../../FixJestEnvironment.js", + "collectCoverageFrom": [ + "src/**/*.ts" + ], + "coveragePathIgnorePatterns": [ + "/__tests__/" + ] } } diff --git a/packages/amplify-graphql-relational-transformer/package.json b/packages/amplify-graphql-relational-transformer/package.json index 9547735395..98c2b34c98 100644 --- a/packages/amplify-graphql-relational-transformer/package.json +++ b/packages/amplify-graphql-relational-transformer/package.json @@ -61,7 +61,7 @@ "coverageProvider": "v8", "coverageThreshold": { "global": { - "branches": 77, + "branches": 76, "functions": 90, "lines": 90 } @@ -70,6 +70,12 @@ "clover", "text" ], - "testEnvironment": "../../FixJestEnvironment.js" + "testEnvironment": "../../FixJestEnvironment.js", + "collectCoverageFrom": [ + "src/**/*.ts" + ], + "coveragePathIgnorePatterns": [ + "/__tests__/" + ] } } diff --git a/packages/amplify-graphql-schema-generator/package.json b/packages/amplify-graphql-schema-generator/package.json index b48d5c359f..04bc3c098f 100644 --- a/packages/amplify-graphql-schema-generator/package.json +++ b/packages/amplify-graphql-schema-generator/package.json @@ -86,6 +86,12 @@ "moduleNameMapper": { "^csv-parse/sync": "/../../node_modules/csv-parse/dist/cjs/sync.cjs" }, - "testEnvironment": "../../FixJestEnvironment.js" + "testEnvironment": "../../FixJestEnvironment.js", + "collectCoverageFrom": [ + "src/**/*.ts" + ], + "coveragePathIgnorePatterns": [ + "/__tests__/" + ] } } diff --git a/packages/amplify-graphql-schema-test-library/package.json b/packages/amplify-graphql-schema-test-library/package.json index 38c4b2e110..675206a0ca 100644 --- a/packages/amplify-graphql-schema-test-library/package.json +++ b/packages/amplify-graphql-schema-test-library/package.json @@ -67,6 +67,12 @@ "clover", "text" ], - "testEnvironment": "../../FixJestEnvironment.js" + "testEnvironment": "../../FixJestEnvironment.js", + "collectCoverageFrom": [ + "src/**/*.ts" + ], + "coveragePathIgnorePatterns": [ + "/__tests__/" + ] } } diff --git a/packages/amplify-graphql-searchable-transformer/package.json b/packages/amplify-graphql-searchable-transformer/package.json index d114a90a79..e9c5d76e58 100644 --- a/packages/amplify-graphql-searchable-transformer/package.json +++ b/packages/amplify-graphql-searchable-transformer/package.json @@ -73,6 +73,12 @@ "modulePathIgnorePatterns": [ "overrides" ], - "testEnvironment": "../../FixJestEnvironment.js" + "testEnvironment": "../../FixJestEnvironment.js", + "collectCoverageFrom": [ + "src/**/*.ts" + ], + "coveragePathIgnorePatterns": [ + "/__tests__/" + ] } } diff --git a/packages/amplify-graphql-sql-transformer/package.json b/packages/amplify-graphql-sql-transformer/package.json index 615c5eb738..fb666f2df8 100644 --- a/packages/amplify-graphql-sql-transformer/package.json +++ b/packages/amplify-graphql-sql-transformer/package.json @@ -59,7 +59,7 @@ "coverageProvider": "v8", "coverageThreshold": { "global": { - "branches": 75, + "branches": 73, "functions": 90, "lines": 90 } @@ -71,6 +71,12 @@ "modulePathIgnorePatterns": [ "overrides" ], - "testEnvironment": "../../FixJestEnvironment.js" + "testEnvironment": "../../FixJestEnvironment.js", + "collectCoverageFrom": [ + "src/**/*.ts" + ], + "coveragePathIgnorePatterns": [ + "/__tests__/" + ] } } diff --git a/packages/amplify-graphql-transformer-core/package.json b/packages/amplify-graphql-transformer-core/package.json index cb7b7f02c7..7a619c1075 100644 --- a/packages/amplify-graphql-transformer-core/package.json +++ b/packages/amplify-graphql-transformer-core/package.json @@ -68,15 +68,21 @@ "coverageProvider": "v8", "coverageThreshold": { "global": { - "branches": 69, - "functions": 31, - "lines": 56 + "branches": 67, + "functions": 30, + "lines": 49 } }, "coverageReporters": [ "clover", "text" ], - "testEnvironment": "../../FixJestEnvironment.js" + "testEnvironment": "../../FixJestEnvironment.js", + "collectCoverageFrom": [ + "src/**/*.ts" + ], + "coveragePathIgnorePatterns": [ + "/__tests__/" + ] } } diff --git a/packages/amplify-graphql-transformer-interfaces/package.json b/packages/amplify-graphql-transformer-interfaces/package.json index a2af7f3765..c1083b29df 100644 --- a/packages/amplify-graphql-transformer-interfaces/package.json +++ b/packages/amplify-graphql-transformer-interfaces/package.json @@ -52,6 +52,12 @@ "coverageReporters": [ "clover", "text" + ], + "collectCoverageFrom": [ + "src/**/*.ts" + ], + "coveragePathIgnorePatterns": [ + "/__tests__/" ] } } diff --git a/packages/amplify-graphql-transformer-migrator/package.json b/packages/amplify-graphql-transformer-migrator/package.json index bc8b5f382e..9c90a47e64 100644 --- a/packages/amplify-graphql-transformer-migrator/package.json +++ b/packages/amplify-graphql-transformer-migrator/package.json @@ -70,6 +70,12 @@ "clover", "text" ], - "testEnvironment": "../../FixJestEnvironment.js" + "testEnvironment": "../../FixJestEnvironment.js", + "collectCoverageFrom": [ + "src/**/*.ts" + ], + "coveragePathIgnorePatterns": [ + "/__tests__/" + ] } } diff --git a/packages/amplify-graphql-transformer-test-utils/package.json b/packages/amplify-graphql-transformer-test-utils/package.json index 8ef629e8d2..c29f0578e1 100644 --- a/packages/amplify-graphql-transformer-test-utils/package.json +++ b/packages/amplify-graphql-transformer-test-utils/package.json @@ -59,15 +59,21 @@ "coverageProvider": "v8", "coverageThreshold": { "global": { - "branches": 64, - "functions": 74, - "lines": 78 + "branches": 58, + "functions": 46, + "lines": 46 } }, "coverageReporters": [ "clover", "text" ], - "testEnvironment": "../../FixJestEnvironment.js" + "testEnvironment": "../../FixJestEnvironment.js", + "collectCoverageFrom": [ + "src/**/*.ts" + ], + "coveragePathIgnorePatterns": [ + "/__tests__/" + ] } } diff --git a/packages/amplify-graphql-transformer/package.json b/packages/amplify-graphql-transformer/package.json index eea9a8e500..da5381102a 100644 --- a/packages/amplify-graphql-transformer/package.json +++ b/packages/amplify-graphql-transformer/package.json @@ -79,6 +79,12 @@ "clover", "text" ], - "testEnvironment": "../../FixJestEnvironment.js" + "testEnvironment": "../../FixJestEnvironment.js", + "collectCoverageFrom": [ + "src/**/*.ts" + ], + "coveragePathIgnorePatterns": [ + "/__tests__/" + ] } } diff --git a/packages/amplify-schema-validator/jest.config.js b/packages/amplify-schema-validator/jest.config.js index 7bd04c28d1..453df6233e 100644 --- a/packages/amplify-schema-validator/jest.config.js +++ b/packages/amplify-schema-validator/jest.config.js @@ -3,6 +3,7 @@ module.exports = { collectCoverage: true, coverageProvider: 'v8', collectCoverageFrom: ['/src/**/*.{ts,js}'], + coveragePathIgnorePatterns: ['/__tests__/'], coverageReporters: ['cobertura', 'lcov', 'text', 'clover'], testPathIgnorePatterns: ['/node_modules/', '/dist/', '/src/__tests__/helpers/'], testEnvironment: 'jsdom', diff --git a/packages/amplify-util-mock/package.json b/packages/amplify-util-mock/package.json index ee97f0b695..3a73c245fb 100644 --- a/packages/amplify-util-mock/package.json +++ b/packages/amplify-util-mock/package.json @@ -96,10 +96,7 @@ "collectCoverage": true, "coverageProvider": "v8", "collectCoverageFrom": [ - "src/**/*.ts", - "!**/node_modules/**", - "!src/__tests__/**", - "!lib/**" + "src/**/*.ts" ], "coverageReporters": [ "clover", @@ -122,7 +119,12 @@ "moduleNameMapper": { "axios": "axios/dist/node/axios.cjs" }, - "testEnvironment": "../../FixJestEnvironment.js" + "testEnvironment": "../../FixJestEnvironment.js", + "coveragePathIgnorePatterns": [ + "/__tests__/", + "/lib/", + "/node_modules" + ] }, "jest-junit": { "outputDirectory": "reports/junit/", diff --git a/packages/graphql-auth-transformer/package.json b/packages/graphql-auth-transformer/package.json index abf2a1a365..593d26bb13 100644 --- a/packages/graphql-auth-transformer/package.json +++ b/packages/graphql-auth-transformer/package.json @@ -64,6 +64,12 @@ "coverageReporters": [ "clover", "text" + ], + "collectCoverageFrom": [ + "src/**/*.ts" + ], + "coveragePathIgnorePatterns": [ + "/__tests__/" ] } } diff --git a/packages/graphql-connection-transformer/package.json b/packages/graphql-connection-transformer/package.json index e9fca2b519..0911f248f6 100644 --- a/packages/graphql-connection-transformer/package.json +++ b/packages/graphql-connection-transformer/package.json @@ -57,6 +57,12 @@ "coverageReporters": [ "clover", "text" + ], + "collectCoverageFrom": [ + "src/**/*.ts" + ], + "coveragePathIgnorePatterns": [ + "/__tests__/" ] } } diff --git a/packages/graphql-dynamodb-transformer/package.json b/packages/graphql-dynamodb-transformer/package.json index df0e930931..3622a16007 100644 --- a/packages/graphql-dynamodb-transformer/package.json +++ b/packages/graphql-dynamodb-transformer/package.json @@ -62,6 +62,12 @@ "coverageReporters": [ "clover", "text" + ], + "collectCoverageFrom": [ + "src/**/*.ts" + ], + "coveragePathIgnorePatterns": [ + "/__tests__/" ] } } diff --git a/packages/graphql-elasticsearch-transformer/package.json b/packages/graphql-elasticsearch-transformer/package.json index 23d8eb3fc3..e962125d3f 100644 --- a/packages/graphql-elasticsearch-transformer/package.json +++ b/packages/graphql-elasticsearch-transformer/package.json @@ -61,6 +61,12 @@ "coverageReporters": [ "clover", "text" + ], + "collectCoverageFrom": [ + "src/**/*.ts" + ], + "coveragePathIgnorePatterns": [ + "/__tests__/" ] } } diff --git a/packages/graphql-function-transformer/package.json b/packages/graphql-function-transformer/package.json index e71351ae65..da41a8af2c 100644 --- a/packages/graphql-function-transformer/package.json +++ b/packages/graphql-function-transformer/package.json @@ -48,7 +48,7 @@ "coverageProvider": "v8", "coverageThreshold": { "global": { - "branches": 89, + "branches": 85, "functions": 90, "lines": 90 } @@ -56,6 +56,12 @@ "coverageReporters": [ "clover", "text" + ], + "collectCoverageFrom": [ + "src/**/*.ts" + ], + "coveragePathIgnorePatterns": [ + "/__tests__/" ] } } diff --git a/packages/graphql-http-transformer/package.json b/packages/graphql-http-transformer/package.json index 9125064812..378e1c34e9 100644 --- a/packages/graphql-http-transformer/package.json +++ b/packages/graphql-http-transformer/package.json @@ -48,13 +48,19 @@ "coverageThreshold": { "global": { "branches": 90, - "functions": 85, + "functions": 80, "lines": 90 } }, "coverageReporters": [ "clover", "text" + ], + "collectCoverageFrom": [ + "src/**/*.ts" + ], + "coveragePathIgnorePatterns": [ + "/__tests__/" ] } } diff --git a/packages/graphql-key-transformer/package.json b/packages/graphql-key-transformer/package.json index b332a0e459..faded99fbf 100644 --- a/packages/graphql-key-transformer/package.json +++ b/packages/graphql-key-transformer/package.json @@ -57,6 +57,12 @@ "coverageReporters": [ "clover", "text" + ], + "collectCoverageFrom": [ + "src/**/*.ts" + ], + "coveragePathIgnorePatterns": [ + "/__tests__/" ] } } diff --git a/packages/graphql-mapping-template/package.json b/packages/graphql-mapping-template/package.json index f2d05614fd..8d0cbf492b 100644 --- a/packages/graphql-mapping-template/package.json +++ b/packages/graphql-mapping-template/package.json @@ -42,14 +42,20 @@ "coverageProvider": "v8", "coverageThreshold": { "global": { - "branches": 63, - "functions": 33, - "lines": 59 + "branches": 60, + "functions": 32, + "lines": 50 } }, "coverageReporters": [ "clover", "text" + ], + "collectCoverageFrom": [ + "src/**/*.ts" + ], + "coveragePathIgnorePatterns": [ + "/__tests__/" ] } } diff --git a/packages/graphql-predictions-transformer/package.json b/packages/graphql-predictions-transformer/package.json index 3d1beff283..63838579de 100644 --- a/packages/graphql-predictions-transformer/package.json +++ b/packages/graphql-predictions-transformer/package.json @@ -51,7 +51,7 @@ "coverageProvider": "v8", "coverageThreshold": { "global": { - "branches": 87, + "branches": 85, "functions": 90, "lines": 90 } @@ -59,6 +59,12 @@ "coverageReporters": [ "clover", "text" + ], + "collectCoverageFrom": [ + "src/**/*.ts" + ], + "coveragePathIgnorePatterns": [ + "/__tests__/" ] } } diff --git a/packages/graphql-relational-schema-transformer/package.json b/packages/graphql-relational-schema-transformer/package.json index 6b083c54a2..68cbb1a05d 100644 --- a/packages/graphql-relational-schema-transformer/package.json +++ b/packages/graphql-relational-schema-transformer/package.json @@ -65,6 +65,12 @@ "ts-jest": { "diagnostics": false } - } + }, + "collectCoverageFrom": [ + "src/**/*.ts" + ], + "coveragePathIgnorePatterns": [ + "/__tests__/" + ] } } diff --git a/packages/graphql-transformer-common/package.json b/packages/graphql-transformer-common/package.json index 04e43180fe..dd4049c5f8 100644 --- a/packages/graphql-transformer-common/package.json +++ b/packages/graphql-transformer-common/package.json @@ -37,9 +37,9 @@ "coverageProvider": "v8", "coverageThreshold": { "global": { - "branches": 63, - "functions": 11, - "lines": 27 + "branches": 35, + "functions": 8, + "lines": 8 } }, "coverageReporters": [ @@ -58,6 +58,12 @@ "jsx", "json", "node" + ], + "collectCoverageFrom": [ + "src/**/*.ts" + ], + "coveragePathIgnorePatterns": [ + "/__tests__/" ] } } diff --git a/packages/graphql-transformer-core/package.json b/packages/graphql-transformer-core/package.json index 7634acf750..1e4e9e961f 100644 --- a/packages/graphql-transformer-core/package.json +++ b/packages/graphql-transformer-core/package.json @@ -57,14 +57,20 @@ "coverageProvider": "v8", "coverageThreshold": { "global": { - "branches": 67, + "branches": 66, "functions": 33, - "lines": 48 + "lines": 47 } }, "coverageReporters": [ "clover", "text" + ], + "collectCoverageFrom": [ + "src/**/*.ts" + ], + "coveragePathIgnorePatterns": [ + "/__tests__/" ] } } diff --git a/packages/graphql-transformers-e2e-tests/package.json b/packages/graphql-transformers-e2e-tests/package.json index a190c49a9f..aac714bc85 100644 --- a/packages/graphql-transformers-e2e-tests/package.json +++ b/packages/graphql-transformers-e2e-tests/package.json @@ -68,10 +68,7 @@ "collectCoverage": true, "coverageProvider": "v8", "collectCoverageFrom": [ - "src/**/*.ts", - "!**/node_modules/**", - "!src/__tests__/**", - "!**/*.d.ts" + "src/**/*.ts" ], "coverageReporters": [ "clover", @@ -112,7 +109,11 @@ "moduleNameMapper": { "axios": "axios/dist/node/axios.cjs" }, - "testEnvironment": "../../FixJestEnvironment.js" + "testEnvironment": "../../FixJestEnvironment.js", + "coveragePathIgnorePatterns": [ + "/node_modules", + "/__tests__/" + ] }, "jest-junit": { "outputDirectory": "reports/junit/", diff --git a/packages/graphql-versioned-transformer/package.json b/packages/graphql-versioned-transformer/package.json index 341ca719a5..4de3005111 100644 --- a/packages/graphql-versioned-transformer/package.json +++ b/packages/graphql-versioned-transformer/package.json @@ -49,7 +49,7 @@ "coverageProvider": "v8", "coverageThreshold": { "global": { - "branches": 88, + "branches": 85, "functions": 90, "lines": 90 } @@ -57,6 +57,12 @@ "coverageReporters": [ "clover", "text" + ], + "collectCoverageFrom": [ + "src/**/*.ts" + ], + "coveragePathIgnorePatterns": [ + "/__tests__/" ] } } From fd7b7c58159b1e45bbc97959c3a108ccdf814f13 Mon Sep 17 00:00:00 2001 From: Tim Schmelter Date: Tue, 13 Feb 2024 08:56:16 -0800 Subject: [PATCH 07/45] test: fix resource cleanup regex for cdkamplifytable roles (#2267) --- packages/amplify-e2e-tests/src/cleanup-e2e-resources.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/amplify-e2e-tests/src/cleanup-e2e-resources.ts b/packages/amplify-e2e-tests/src/cleanup-e2e-resources.ts index 29a65d393e..c56d051089 100644 --- a/packages/amplify-e2e-tests/src/cleanup-e2e-resources.ts +++ b/packages/amplify-e2e-tests/src/cleanup-e2e-resources.ts @@ -85,7 +85,7 @@ type AWSAccountInfo = { const BUCKET_TEST_REGEX = /test/; const IAM_TEST_REGEX = - /!RotateE2eAwsToken-e2eTestContextRole|-integtest$|^amplify-|^eu-|^us-|^ap-|^auth-exhaustive-tests|rds-schema-inspector-integtest|^amplify_e2e_tests_lambda|^JsonMockStack-jsonMockApi|^SubscriptionAuthV2Tests|^cdkamplifytable-/; + /!RotateE2eAwsToken-e2eTestContextRole|-integtest$|^amplify-|^eu-|^us-|^ap-|^auth-exhaustive-tests|rds-schema-inspector-integtest|^amplify_e2e_tests_lambda|^JsonMockStack-jsonMockApi|^SubscriptionAuthV2Tests|^cdkamplifytable[0-9]*-/; const STALE_DURATION_MS = 2 * 60 * 60 * 1000; // 2 hours in milliseconds const isCI = (): boolean => !!(process.env.CI && process.env.CODEBUILD); From fc8eab4b96f3045cf7ebbcaf54f65ce71d4b84eb Mon Sep 17 00:00:00 2001 From: Christopher Sundersingh <83315412+sundersc@users.noreply.github.com> Date: Wed, 14 Feb 2024 10:17:03 -0800 Subject: [PATCH 08/45] test(api): add create api canary codebuild buildspec (#2268) --- codebuild_specs/createapi_canary_workflow.yml | 267 ++++++++++++++++++ 1 file changed, 267 insertions(+) create mode 100644 codebuild_specs/createapi_canary_workflow.yml diff --git a/codebuild_specs/createapi_canary_workflow.yml b/codebuild_specs/createapi_canary_workflow.yml new file mode 100644 index 0000000000..8202bd242a --- /dev/null +++ b/codebuild_specs/createapi_canary_workflow.yml @@ -0,0 +1,267 @@ +version: 0.2 +env: + shell: bash + compute-type: BUILD_GENERAL1_MEDIUM +batch: + fast-fail: false + build-graph: + - identifier: build_linux + buildspec: codebuild_specs/build_linux.yml + env: + compute-type: BUILD_GENERAL1_LARGE + - identifier: build_windows + buildspec: codebuild_specs/build_windows.yml + env: + type: WINDOWS_SERVER_2019_CONTAINER + compute-type: BUILD_GENERAL1_LARGE + image: $WINDOWS_IMAGE_2019 + depend-on: + - build_linux + - identifier: test + buildspec: codebuild_specs/test.yml + env: + compute-type: BUILD_GENERAL1_LARGE + depend-on: + - build_linux + - identifier: mock_e2e_tests + buildspec: codebuild_specs/mock_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_MEDIUM + depend-on: + - build_linux + - identifier: verify_cdk_version + buildspec: codebuild_specs/verify_cdk_version.yml + env: + compute-type: BUILD_GENERAL1_MEDIUM + depend-on: + - build_linux + - identifier: verify_api_extract + buildspec: codebuild_specs/verify_api_extract.yml + env: + compute-type: BUILD_GENERAL1_MEDIUM + depend-on: + - build_linux + - identifier: verify_yarn_lock + buildspec: codebuild_specs/verify_yarn_lock.yml + env: + compute-type: BUILD_GENERAL1_MEDIUM + depend-on: + - build_linux + - identifier: verify_dependency_licenses_extract + buildspec: codebuild_specs/verify_dependency_licenses_extract.yml + env: + compute-type: BUILD_GENERAL1_MEDIUM + depend-on: + - build_linux + - identifier: publish_to_local_registry + buildspec: codebuild_specs/publish_to_local_registry.yml + env: + compute-type: BUILD_GENERAL1_MEDIUM + depend-on: + - build_linux + - identifier: api_test_us_east_1 + buildspec: codebuild_specs/run_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_MEDIUM + variables: + TEST_SUITE: >- + src/__tests__/api_1.test.ts|src/__tests__/resolvers.test.ts + CLI_REGION: us-east-1 + depend-on: + - publish_to_local_registry + - identifier: api_test_ap_northeast_2 + buildspec: codebuild_specs/run_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_MEDIUM + variables: + TEST_SUITE: >- + src/__tests__/api_1.test.ts|src/__tests__/resolvers.test.ts + CLI_REGION: ap-northeast-2 + depend-on: + - publish_to_local_registry + - identifier: api_test_ap_south_1 + buildspec: codebuild_specs/run_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_MEDIUM + variables: + TEST_SUITE: >- + src/__tests__/api_1.test.ts|src/__tests__/resolvers.test.ts + CLI_REGION: ap-south-1 + depend-on: + - publish_to_local_registry + - identifier: api_test_ap_southeast_2 + buildspec: codebuild_specs/run_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_MEDIUM + variables: + TEST_SUITE: >- + src/__tests__/api_1.test.ts|src/__tests__/resolvers.test.ts + CLI_REGION: ap-southeast-2 + depend-on: + - publish_to_local_registry + - identifier: api_test_eu_central_1 + buildspec: codebuild_specs/run_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_MEDIUM + variables: + TEST_SUITE: >- + src/__tests__/api_1.test.ts|src/__tests__/resolvers.test.ts + CLI_REGION: eu-central-1 + depend-on: + - publish_to_local_registry + - identifier: api_test_us_east_2 + buildspec: codebuild_specs/run_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_MEDIUM + variables: + TEST_SUITE: >- + src/__tests__/api_1.test.ts|src/__tests__/resolvers.test.ts + CLI_REGION: us-east-2 + depend-on: + - publish_to_local_registry + - identifier: api_test_ap_southeast_1 + buildspec: codebuild_specs/run_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_MEDIUM + variables: + TEST_SUITE: >- + src/__tests__/api_1.test.ts|src/__tests__/resolvers.test.ts + CLI_REGION: ap-southeast-1 + depend-on: + - publish_to_local_registry + - identifier: api_test_ca_central_1 + buildspec: codebuild_specs/run_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_MEDIUM + variables: + TEST_SUITE: >- + src/__tests__/api_1.test.ts|src/__tests__/resolvers.test.ts + CLI_REGION: ca-central-1 + depend-on: + - publish_to_local_registry + - identifier: api_test_eu_west_2 + buildspec: codebuild_specs/run_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_MEDIUM + variables: + TEST_SUITE: >- + src/__tests__/api_1.test.ts|src/__tests__/resolvers.test.ts + CLI_REGION: eu-west-2 + depend-on: + - publish_to_local_registry + - identifier: api_test_us_west_2 + buildspec: codebuild_specs/run_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_MEDIUM + variables: + TEST_SUITE: >- + src/__tests__/api_1.test.ts|src/__tests__/resolvers.test.ts + CLI_REGION: us-west-2 + depend-on: + - publish_to_local_registry + - identifier: api_test_ap_east_1 + buildspec: codebuild_specs/run_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_MEDIUM + variables: + TEST_SUITE: >- + src/__tests__/api_1.test.ts|src/__tests__/resolvers.test.ts + CLI_REGION: ap-east-1 + depend-on: + - publish_to_local_registry + - identifier: api_test_ap_northeast_1 + buildspec: codebuild_specs/run_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_MEDIUM + variables: + TEST_SUITE: >- + src/__tests__/api_1.test.ts|src/__tests__/resolvers.test.ts + CLI_REGION: ap-northeast-1 + depend-on: + - publish_to_local_registry + - identifier: api_test_ap_northeast_3 + buildspec: codebuild_specs/run_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_MEDIUM + variables: + TEST_SUITE: >- + src/__tests__/api_1.test.ts|src/__tests__/resolvers.test.ts + CLI_REGION: ap-northeast-3 + depend-on: + - publish_to_local_registry + - identifier: api_test_eu_north_1 + buildspec: codebuild_specs/run_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_MEDIUM + variables: + TEST_SUITE: >- + src/__tests__/api_1.test.ts|src/__tests__/resolvers.test.ts + CLI_REGION: eu-north-1 + depend-on: + - publish_to_local_registry + - identifier: api_test_eu_west_1 + buildspec: codebuild_specs/run_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_MEDIUM + variables: + TEST_SUITE: >- + src/__tests__/api_1.test.ts|src/__tests__/resolvers.test.ts + CLI_REGION: eu-west-1 + depend-on: + - publish_to_local_registry + - identifier: api_test_eu_south_1 + buildspec: codebuild_specs/run_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_MEDIUM + variables: + TEST_SUITE: >- + src/__tests__/api_1.test.ts|src/__tests__/resolvers.test.ts + CLI_REGION: eu-south-1 + depend-on: + - publish_to_local_registry + - identifier: api_test_eu_west_3 + buildspec: codebuild_specs/run_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_MEDIUM + variables: + TEST_SUITE: >- + src/__tests__/api_1.test.ts|src/__tests__/resolvers.test.ts + CLI_REGION: eu-west-3 + depend-on: + - publish_to_local_registry + - identifier: api_test_me_south_1 + buildspec: codebuild_specs/run_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_MEDIUM + variables: + TEST_SUITE: >- + src/__tests__/api_1.test.ts|src/__tests__/resolvers.test.ts + CLI_REGION: me-south-1 + depend-on: + - publish_to_local_registry + - identifier: api_test_sa_east_1 + buildspec: codebuild_specs/run_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_MEDIUM + variables: + TEST_SUITE: >- + src/__tests__/api_1.test.ts|src/__tests__/resolvers.test.ts + CLI_REGION: sa-east-1 + depend-on: + - publish_to_local_registry + - identifier: api_test_us_west_1 + buildspec: codebuild_specs/run_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_MEDIUM + variables: + TEST_SUITE: >- + src/__tests__/api_1.test.ts|src/__tests__/resolvers.test.ts + CLI_REGION: us-west-1 + depend-on: + - publish_to_local_registry + - identifier: cleanup_e2e_resources + buildspec: codebuild_specs/cleanup_e2e_resources.yml + env: + compute-type: BUILD_GENERAL1_SMALL + depend-on: + - api_test_us_east_1 From 21cf08450dc08e7113528b504b696b3e237bfce3 Mon Sep 17 00:00:00 2001 From: Christopher Sundersingh <83315412+sundersc@users.noreply.github.com> Date: Wed, 14 Feb 2024 14:40:26 -0800 Subject: [PATCH 09/45] test(api): remove unwanted steps from canary build spec (#2272) --- codebuild_specs/createapi_canary_workflow.yml | 72 ++++++------------- .../src/__tests__/api_canary.ts | 63 ++++++++++++++++ 2 files changed, 83 insertions(+), 52 deletions(-) create mode 100644 packages/amplify-e2e-tests/src/__tests__/api_canary.ts diff --git a/codebuild_specs/createapi_canary_workflow.yml b/codebuild_specs/createapi_canary_workflow.yml index 8202bd242a..72bb546735 100644 --- a/codebuild_specs/createapi_canary_workflow.yml +++ b/codebuild_specs/createapi_canary_workflow.yml @@ -9,14 +9,6 @@ batch: buildspec: codebuild_specs/build_linux.yml env: compute-type: BUILD_GENERAL1_LARGE - - identifier: build_windows - buildspec: codebuild_specs/build_windows.yml - env: - type: WINDOWS_SERVER_2019_CONTAINER - compute-type: BUILD_GENERAL1_LARGE - image: $WINDOWS_IMAGE_2019 - depend-on: - - build_linux - identifier: test buildspec: codebuild_specs/test.yml env: @@ -29,30 +21,6 @@ batch: compute-type: BUILD_GENERAL1_MEDIUM depend-on: - build_linux - - identifier: verify_cdk_version - buildspec: codebuild_specs/verify_cdk_version.yml - env: - compute-type: BUILD_GENERAL1_MEDIUM - depend-on: - - build_linux - - identifier: verify_api_extract - buildspec: codebuild_specs/verify_api_extract.yml - env: - compute-type: BUILD_GENERAL1_MEDIUM - depend-on: - - build_linux - - identifier: verify_yarn_lock - buildspec: codebuild_specs/verify_yarn_lock.yml - env: - compute-type: BUILD_GENERAL1_MEDIUM - depend-on: - - build_linux - - identifier: verify_dependency_licenses_extract - buildspec: codebuild_specs/verify_dependency_licenses_extract.yml - env: - compute-type: BUILD_GENERAL1_MEDIUM - depend-on: - - build_linux - identifier: publish_to_local_registry buildspec: codebuild_specs/publish_to_local_registry.yml env: @@ -65,7 +33,7 @@ batch: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: >- - src/__tests__/api_1.test.ts|src/__tests__/resolvers.test.ts + src/__tests__/api_canary.test.ts CLI_REGION: us-east-1 depend-on: - publish_to_local_registry @@ -75,7 +43,7 @@ batch: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: >- - src/__tests__/api_1.test.ts|src/__tests__/resolvers.test.ts + src/__tests__/api_canary.test.ts CLI_REGION: ap-northeast-2 depend-on: - publish_to_local_registry @@ -85,7 +53,7 @@ batch: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: >- - src/__tests__/api_1.test.ts|src/__tests__/resolvers.test.ts + src/__tests__/api_canary.test.ts CLI_REGION: ap-south-1 depend-on: - publish_to_local_registry @@ -95,7 +63,7 @@ batch: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: >- - src/__tests__/api_1.test.ts|src/__tests__/resolvers.test.ts + src/__tests__/api_canary.test.ts CLI_REGION: ap-southeast-2 depend-on: - publish_to_local_registry @@ -105,7 +73,7 @@ batch: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: >- - src/__tests__/api_1.test.ts|src/__tests__/resolvers.test.ts + src/__tests__/api_canary.test.ts CLI_REGION: eu-central-1 depend-on: - publish_to_local_registry @@ -115,7 +83,7 @@ batch: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: >- - src/__tests__/api_1.test.ts|src/__tests__/resolvers.test.ts + src/__tests__/api_canary.test.ts CLI_REGION: us-east-2 depend-on: - publish_to_local_registry @@ -125,7 +93,7 @@ batch: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: >- - src/__tests__/api_1.test.ts|src/__tests__/resolvers.test.ts + src/__tests__/api_canary.test.ts CLI_REGION: ap-southeast-1 depend-on: - publish_to_local_registry @@ -135,7 +103,7 @@ batch: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: >- - src/__tests__/api_1.test.ts|src/__tests__/resolvers.test.ts + src/__tests__/api_canary.test.ts CLI_REGION: ca-central-1 depend-on: - publish_to_local_registry @@ -145,7 +113,7 @@ batch: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: >- - src/__tests__/api_1.test.ts|src/__tests__/resolvers.test.ts + src/__tests__/api_canary.test.ts CLI_REGION: eu-west-2 depend-on: - publish_to_local_registry @@ -155,7 +123,7 @@ batch: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: >- - src/__tests__/api_1.test.ts|src/__tests__/resolvers.test.ts + src/__tests__/api_canary.test.ts CLI_REGION: us-west-2 depend-on: - publish_to_local_registry @@ -165,7 +133,7 @@ batch: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: >- - src/__tests__/api_1.test.ts|src/__tests__/resolvers.test.ts + src/__tests__/api_canary.test.ts CLI_REGION: ap-east-1 depend-on: - publish_to_local_registry @@ -175,7 +143,7 @@ batch: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: >- - src/__tests__/api_1.test.ts|src/__tests__/resolvers.test.ts + src/__tests__/api_canary.test.ts CLI_REGION: ap-northeast-1 depend-on: - publish_to_local_registry @@ -185,7 +153,7 @@ batch: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: >- - src/__tests__/api_1.test.ts|src/__tests__/resolvers.test.ts + src/__tests__/api_canary.test.ts CLI_REGION: ap-northeast-3 depend-on: - publish_to_local_registry @@ -195,7 +163,7 @@ batch: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: >- - src/__tests__/api_1.test.ts|src/__tests__/resolvers.test.ts + src/__tests__/api_canary.test.ts CLI_REGION: eu-north-1 depend-on: - publish_to_local_registry @@ -205,7 +173,7 @@ batch: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: >- - src/__tests__/api_1.test.ts|src/__tests__/resolvers.test.ts + src/__tests__/api_canary.test.ts CLI_REGION: eu-west-1 depend-on: - publish_to_local_registry @@ -215,7 +183,7 @@ batch: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: >- - src/__tests__/api_1.test.ts|src/__tests__/resolvers.test.ts + src/__tests__/api_canary.test.ts CLI_REGION: eu-south-1 depend-on: - publish_to_local_registry @@ -225,7 +193,7 @@ batch: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: >- - src/__tests__/api_1.test.ts|src/__tests__/resolvers.test.ts + src/__tests__/api_canary.test.ts CLI_REGION: eu-west-3 depend-on: - publish_to_local_registry @@ -235,7 +203,7 @@ batch: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: >- - src/__tests__/api_1.test.ts|src/__tests__/resolvers.test.ts + src/__tests__/api_canary.test.ts CLI_REGION: me-south-1 depend-on: - publish_to_local_registry @@ -245,7 +213,7 @@ batch: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: >- - src/__tests__/api_1.test.ts|src/__tests__/resolvers.test.ts + src/__tests__/api_canary.test.ts CLI_REGION: sa-east-1 depend-on: - publish_to_local_registry @@ -255,7 +223,7 @@ batch: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: >- - src/__tests__/api_1.test.ts|src/__tests__/resolvers.test.ts + src/__tests__/api_canary.test.ts CLI_REGION: us-west-1 depend-on: - publish_to_local_registry diff --git a/packages/amplify-e2e-tests/src/__tests__/api_canary.ts b/packages/amplify-e2e-tests/src/__tests__/api_canary.ts new file mode 100644 index 0000000000..73b82a0e40 --- /dev/null +++ b/packages/amplify-e2e-tests/src/__tests__/api_canary.ts @@ -0,0 +1,63 @@ +import path from 'path'; +import { existsSync } from 'fs'; +import { + amplifyPush, + deleteProject, + initJSProjectWithProfile, + addApiWithoutSchema, + updateApiSchema, + createNewProjectDir, + deleteProjectDir, + getAppSyncApi, + getProjectMeta, + getDDBTable, +} from 'amplify-category-api-e2e-core'; + +describe('amplify add api (GraphQL)', () => { + let projRoot: string; + let projFolderName: string; + beforeEach(async () => { + projFolderName = 'graphqlapi'; + projRoot = await createNewProjectDir(projFolderName); + }); + + afterEach(async () => { + const metaFilePath = path.join(projRoot, 'amplify', '#current-cloud-backend', 'amplify-meta.json'); + if (existsSync(metaFilePath)) { + await deleteProject(projRoot); + } + deleteProjectDir(projRoot); + }); + + it('init a project and add the simple_model api', async () => { + const envName = 'devtest'; + const projName = 'simplemodel'; + await initJSProjectWithProfile(projRoot, { name: projName, envName }); + await addApiWithoutSchema(projRoot, { transformerVersion: 1 }); + await updateApiSchema(projRoot, projName, 'simple_model.graphql'); + await amplifyPush(projRoot); + + const meta = getProjectMeta(projRoot); + const region = meta.providers.awscloudformation.Region; + const { output } = meta.api.simplemodel; + const { GraphQLAPIIdOutput, GraphQLAPIEndpointOutput, GraphQLAPIKeyOutput } = output; + const { graphqlApi } = await getAppSyncApi(GraphQLAPIIdOutput, region); + + expect(GraphQLAPIIdOutput).toBeDefined(); + expect(GraphQLAPIEndpointOutput).toBeDefined(); + expect(GraphQLAPIKeyOutput).toBeDefined(); + + expect(graphqlApi).toBeDefined(); + expect(graphqlApi.apiId).toEqual(GraphQLAPIIdOutput); + const tableName = `AmplifyDataStore-${graphqlApi.apiId}-${envName}`; + const error = { message: null }; + try { + const table = await getDDBTable(tableName, region); + expect(table).toBeUndefined(); + } catch (ex) { + Object.assign(error, ex); + } + expect(error).toBeDefined(); + expect(error.message).toContain(`${tableName} not found`); + }); +}); From d9cd12146a7cab012dd750b12a1ea5a2932a2258 Mon Sep 17 00:00:00 2001 From: Christopher Sundersingh <83315412+sundersc@users.noreply.github.com> Date: Thu, 15 Feb 2024 07:27:21 -0800 Subject: [PATCH 10/45] chore(ci): correct api canary test file extension (#2273) * chore(ci): correct api canary test file extension * chore(ci): correct api canary test file extension --- .../src/__tests__/{api_canary.ts => api_canary.test.ts} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename packages/amplify-e2e-tests/src/__tests__/{api_canary.ts => api_canary.test.ts} (100%) diff --git a/packages/amplify-e2e-tests/src/__tests__/api_canary.ts b/packages/amplify-e2e-tests/src/__tests__/api_canary.test.ts similarity index 100% rename from packages/amplify-e2e-tests/src/__tests__/api_canary.ts rename to packages/amplify-e2e-tests/src/__tests__/api_canary.test.ts From 4e5207cab059eb8e9067f344fc8c8992c2689dd9 Mon Sep 17 00:00:00 2001 From: Christopher Sundersingh <83315412+sundersc@users.noreply.github.com> Date: Thu, 15 Feb 2024 12:27:06 -0800 Subject: [PATCH 11/45] chore(ci): temp disable opt-in regions in canary (#2274) --- codebuild_specs/createapi_canary_workflow.yml | 72 +++++++++---------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/codebuild_specs/createapi_canary_workflow.yml b/codebuild_specs/createapi_canary_workflow.yml index 72bb546735..1971941041 100644 --- a/codebuild_specs/createapi_canary_workflow.yml +++ b/codebuild_specs/createapi_canary_workflow.yml @@ -127,16 +127,16 @@ batch: CLI_REGION: us-west-2 depend-on: - publish_to_local_registry - - identifier: api_test_ap_east_1 - buildspec: codebuild_specs/run_e2e_tests.yml - env: - compute-type: BUILD_GENERAL1_MEDIUM - variables: - TEST_SUITE: >- - src/__tests__/api_canary.test.ts - CLI_REGION: ap-east-1 - depend-on: - - publish_to_local_registry + # - identifier: api_test_ap_east_1 + # buildspec: codebuild_specs/run_e2e_tests.yml + # env: + # compute-type: BUILD_GENERAL1_MEDIUM + # variables: + # TEST_SUITE: >- + # src/__tests__/api_canary.test.ts + # CLI_REGION: ap-east-1 + # depend-on: + # - publish_to_local_registry - identifier: api_test_ap_northeast_1 buildspec: codebuild_specs/run_e2e_tests.yml env: @@ -177,16 +177,16 @@ batch: CLI_REGION: eu-west-1 depend-on: - publish_to_local_registry - - identifier: api_test_eu_south_1 - buildspec: codebuild_specs/run_e2e_tests.yml - env: - compute-type: BUILD_GENERAL1_MEDIUM - variables: - TEST_SUITE: >- - src/__tests__/api_canary.test.ts - CLI_REGION: eu-south-1 - depend-on: - - publish_to_local_registry + # - identifier: api_test_eu_south_1 + # buildspec: codebuild_specs/run_e2e_tests.yml + # env: + # compute-type: BUILD_GENERAL1_MEDIUM + # variables: + # TEST_SUITE: >- + # src/__tests__/api_canary.test.ts + # CLI_REGION: eu-south-1 + # depend-on: + # - publish_to_local_registry - identifier: api_test_eu_west_3 buildspec: codebuild_specs/run_e2e_tests.yml env: @@ -197,16 +197,16 @@ batch: CLI_REGION: eu-west-3 depend-on: - publish_to_local_registry - - identifier: api_test_me_south_1 - buildspec: codebuild_specs/run_e2e_tests.yml - env: - compute-type: BUILD_GENERAL1_MEDIUM - variables: - TEST_SUITE: >- - src/__tests__/api_canary.test.ts - CLI_REGION: me-south-1 - depend-on: - - publish_to_local_registry + # - identifier: api_test_me_south_1 + # buildspec: codebuild_specs/run_e2e_tests.yml + # env: + # compute-type: BUILD_GENERAL1_MEDIUM + # variables: + # TEST_SUITE: >- + # src/__tests__/api_canary.test.ts + # CLI_REGION: me-south-1 + # depend-on: + # - publish_to_local_registry - identifier: api_test_sa_east_1 buildspec: codebuild_specs/run_e2e_tests.yml env: @@ -227,9 +227,9 @@ batch: CLI_REGION: us-west-1 depend-on: - publish_to_local_registry - - identifier: cleanup_e2e_resources - buildspec: codebuild_specs/cleanup_e2e_resources.yml - env: - compute-type: BUILD_GENERAL1_SMALL - depend-on: - - api_test_us_east_1 + # - identifier: cleanup_e2e_resources + # buildspec: codebuild_specs/cleanup_e2e_resources.yml + # env: + # compute-type: BUILD_GENERAL1_SMALL + # depend-on: + # - api_test_us_east_1 From 4340f6e3a9f748769f600207f2d2e84348dbb336 Mon Sep 17 00:00:00 2001 From: Christopher Sundersingh <83315412+sundersc@users.noreply.github.com> Date: Fri, 16 Feb 2024 10:20:45 -0800 Subject: [PATCH 12/45] chore(ci): i (#2276) ncrease npm timeout for cli install --- codebuild_specs/createapi_canary_workflow.yml | 6 ++++++ codebuild_specs/emit_createapi_canary_metric.yml | 15 +++++++++++++++ shared-scripts.sh | 13 +++++++++++++ 3 files changed, 34 insertions(+) create mode 100644 codebuild_specs/emit_createapi_canary_metric.yml diff --git a/codebuild_specs/createapi_canary_workflow.yml b/codebuild_specs/createapi_canary_workflow.yml index 1971941041..aab31b586c 100644 --- a/codebuild_specs/createapi_canary_workflow.yml +++ b/codebuild_specs/createapi_canary_workflow.yml @@ -227,6 +227,12 @@ batch: CLI_REGION: us-west-1 depend-on: - publish_to_local_registry + - identifier: report_status + buildspec: codebuild_specs/emit_createapi_canary_metric.yml + env: + compute-type: BUILD_GENERAL1_SMALL + depend-on: + - api_test_us_east_1 # - identifier: cleanup_e2e_resources # buildspec: codebuild_specs/cleanup_e2e_resources.yml # env: diff --git a/codebuild_specs/emit_createapi_canary_metric.yml b/codebuild_specs/emit_createapi_canary_metric.yml new file mode 100644 index 0000000000..7ea190a414 --- /dev/null +++ b/codebuild_specs/emit_createapi_canary_metric.yml @@ -0,0 +1,15 @@ +version: 0.2 +env: + shell: bash + variables: + AMPLIFY_DIR: /root/.npm-global/lib/node_modules/@aws-amplify/cli-internal/bin + AMPLIFY_PATH: /root/.npm-global/lib/node_modules/@aws-amplify/cli-internal/bin/amplify + CI: true + CODEBUILD: true + NODE_OPTIONS: --max-old-space-size=8096 +phases: + build: + commands: + - source ./shared-scripts.sh && _unassumeTestAccountCredentials + - aws sts get-caller-identity + - source ./shared-scripts.sh && _scanArtifacts && _emitCreateApiCanaryMetric diff --git a/shared-scripts.sh b/shared-scripts.sh index 7a86f4053b..9333979c6f 100755 --- a/shared-scripts.sh +++ b/shared-scripts.sh @@ -179,6 +179,8 @@ function _installCLIFromLocalRegistry { setNpmRegistryUrlToLocal changeNpmGlobalPath # set longer timeout to avoid socket timeout error + npm config set fetch-retries 5 + npm config set fetch-timeout 600000 npm config set fetch-retry-mintimeout 20000 npm config set fetch-retry-maxtimeout 120000 npm install -g @aws-amplify/cli-internal @@ -435,3 +437,14 @@ function _emitCanaryMetric { --dimensions branch=main \ --region us-west-2 } + +function _emitCreateApiCanaryMetric { + aws cloudwatch \ + put-metric-data \ + --metric-name CreateApiCanarySuccessRate \ + --namespace amplify-category-api-e2e-tests \ + --unit Count \ + --value $CODEBUILD_BUILD_SUCCEEDING \ + --dimensions branch=main \ + --region us-west-2 +} From 9b70526bbb6137b2ce014da97f5a9bca9f990815 Mon Sep 17 00:00:00 2001 From: Tim Schmelter Date: Fri, 16 Feb 2024 11:15:03 -0800 Subject: [PATCH 13/45] test: improve E2E test reliability (#2269) * test: Bump CDK Construct tests min tested CDK version to 2.97.0 Fixes deployment errors due to unsupported Node14 Lambda runtime in custom resource provider in CDK v2.80.0 * test: Bump no-output timeout to 10m to account for CDK Bucket deployments * Add noOutputTimeout to gen1 CLI tests * Fix misspelling in timeout message * Regionalize S3 client to handle buckets created in optin regions * Allow overall cleanup job to continue on individual bucket errors --- .../src/__tests__/utils/execUtils.ts | 2 +- .../amplify-e2e-core/src/categories/api.ts | 4 +- .../amplify-e2e-core/src/init/amplifyPush.ts | 2 +- .../src/init/initProjectHelper.ts | 8 ++- .../amplify-e2e-core/src/utils/nexpect.ts | 2 +- .../src/cleanup-e2e-resources.ts | 58 ++++++++++++++++--- .../src/commands.ts | 7 ++- 7 files changed, 66 insertions(+), 17 deletions(-) diff --git a/client-test-apps/js/api-model-relationship-app/src/__tests__/utils/execUtils.ts b/client-test-apps/js/api-model-relationship-app/src/__tests__/utils/execUtils.ts index 00e9734101..3b99c1f4b5 100644 --- a/client-test-apps/js/api-model-relationship-app/src/__tests__/utils/execUtils.ts +++ b/client-test-apps/js/api-model-relationship-app/src/__tests__/utils/execUtils.ts @@ -549,7 +549,7 @@ const chain = (context: Context): ExecutionContext => { .join('\n') : 'No output'; const err = new Error( - `Killed the process as no output receive for ${context.noOutputTimeout / 1000} Sec. The no output timeout is set to ${ + `Killed the process as no output received for ${context.noOutputTimeout / 1000} Sec. The no output timeout is set to ${ context.noOutputTimeout / 1000 } seconds.\n\nLast 10 lines:👇🏽👇🏽👇🏽👇🏽\n\n\n\n\n${lastScreen}\n\n\n👆🏼👆🏼👆🏼👆🏼`, ); diff --git a/packages/amplify-e2e-core/src/categories/api.ts b/packages/amplify-e2e-core/src/categories/api.ts index db94dc33e7..3e796b77a2 100644 --- a/packages/amplify-e2e-core/src/categories/api.ts +++ b/packages/amplify-e2e-core/src/categories/api.ts @@ -808,7 +808,7 @@ export function addV1RDSDataSource(projectDir: string) { .sendCarriageReturn() // This will throw an error 'No properly configured Aurora Serverless clusters found'. .wait('No properly configured Aurora Serverless clusters found') .run((err: Error) => { - if (err && !/Killed the process as no output receive for/.test(err.message)) { + if (err && !/Killed the process as no output received for/.test(err.message)) { reject(err); } else { resolve(); @@ -995,7 +995,7 @@ export function cancelAmplifyMockApi(cwd: string, settings: any = {}): Promise { - if (err && !/Killed the process as no output receive for/.test(err.message)) { + if (err && !/Killed the process as no output received for/.test(err.message)) { reject(err); } else { resolve(); diff --git a/packages/amplify-e2e-core/src/init/amplifyPush.ts b/packages/amplify-e2e-core/src/init/amplifyPush.ts index c68b081963..40cba14763 100644 --- a/packages/amplify-e2e-core/src/init/amplifyPush.ts +++ b/packages/amplify-e2e-core/src/init/amplifyPush.ts @@ -156,7 +156,7 @@ export function cancelIterativeAmplifyPush( if (process.env.CODEBUILD) { // In codebuild the code 130 is not sent but with exit code 2 // This is to catch the error in that scenario so that the test will proceed - if (!/Killed the process as no output receive/.test(err.message)) { + if (!/Killed the process as no output received/.test(err.message)) { reject(err); } } else if (!/Process exited with non zero exit code 130/.test(err.message)) { diff --git a/packages/amplify-e2e-core/src/init/initProjectHelper.ts b/packages/amplify-e2e-core/src/init/initProjectHelper.ts index 4528e0875e..a5bc8afc46 100644 --- a/packages/amplify-e2e-core/src/init/initProjectHelper.ts +++ b/packages/amplify-e2e-core/src/init/initProjectHelper.ts @@ -49,7 +49,13 @@ export function initJSProjectWithProfile(cwd: string, settings?: Partial 20) console.warn('Project names should not be longer than 20 characters. This may cause tests to break.'); return new Promise((resolve, reject) => { - const chain = spawn(getCLIPath(), cliArgs, { cwd, stripColors: true, env, disableCIDetection: s.disableCIDetection }) + const chain = spawn(getCLIPath(), cliArgs, { + cwd, + stripColors: true, + env, + disableCIDetection: s.disableCIDetection, + noOutputTimeout: 10 * 60 * 1000, + }) .wait('Enter a name for the project') .sendLine(s.name) .wait('Initialize the project with the above configuration?') diff --git a/packages/amplify-e2e-core/src/utils/nexpect.ts b/packages/amplify-e2e-core/src/utils/nexpect.ts index 79bf216e49..7bc218fc51 100644 --- a/packages/amplify-e2e-core/src/utils/nexpect.ts +++ b/packages/amplify-e2e-core/src/utils/nexpect.ts @@ -402,7 +402,7 @@ function chain(context: Context): ExecutionContext { .join('\n') : 'No output'; const err = new Error( - `Killed the process as no output receive for ${context.noOutputTimeout / 1000} Sec. The no output timeout is set to ${ + `Killed the process as no output received for ${context.noOutputTimeout / 1000} Sec. The no output timeout is set to ${ context.noOutputTimeout / 1000 } seconds.\n\nLast 10 lines:👇🏽👇🏽👇🏽👇🏽\n\n\n\n\n${lastScreen}\n\n\n👆🏼👆🏼👆🏼👆🏼`, ); diff --git a/packages/amplify-e2e-tests/src/cleanup-e2e-resources.ts b/packages/amplify-e2e-tests/src/cleanup-e2e-resources.ts index c56d051089..8300d446bd 100644 --- a/packages/amplify-e2e-tests/src/cleanup-e2e-resources.ts +++ b/packages/amplify-e2e-tests/src/cleanup-e2e-resources.ts @@ -46,6 +46,7 @@ type AmplifyAppInfo = { type S3BucketInfo = { name: string; jobId?: string; + region: string; cbInfo?: CodeBuild.Build; }; @@ -119,7 +120,17 @@ const getOrphanS3TestBuckets = async (account: AWSAccountInfo): Promise ({ name: it.Name })); + + const bucketInfos = await Promise.all( + staleBuckets.map(async (staleBucket): Promise => { + const region = await getBucketRegion(account, staleBucket.Name); + return { + name: staleBucket.Name, + region, + }; + }), + ); + return bucketInfos; }; /** @@ -277,27 +288,52 @@ const getJobCodeBuildDetails = async (jobIds: string[]): Promise => { + const awsConfig = getAWSConfig(account); + const s3Client = new aws.S3(awsConfig); + const location = await s3Client.getBucketLocation({ Bucket: bucketName }).promise(); + const region = location.LocationConstraint ?? 'us-east-1'; + return region; +}; + const getS3Buckets = async (account: AWSAccountInfo): Promise => { - const s3Client = new aws.S3(getAWSConfig(account)); + const awsConfig = getAWSConfig(account); + const s3Client = new aws.S3(awsConfig); const buckets = await s3Client.listBuckets().promise(); const result: S3BucketInfo[] = []; for (const bucket of buckets.Buckets) { + let region: string | undefined; try { - const bucketDetails = await s3Client.getBucketTagging({ Bucket: bucket.Name }).promise(); + region = await getBucketRegion(account, bucket.Name); + // Operations on buckets created in opt-in regions appear to require region-specific clients + const regionalizedClient = new aws.S3({ + region, + ...(awsConfig as object), + }); + const bucketDetails = await regionalizedClient.getBucketTagging({ Bucket: bucket.Name }).promise(); const jobId = getJobId(bucketDetails.TagSet); if (jobId) { result.push({ name: bucket.Name, jobId, + region, }); } } catch (e) { - if (e.code !== 'NoSuchTagSet' && e.code !== 'NoSuchBucket') { + // TODO: Why do we process the bucket even with these particular errors? + if (e.code === 'NoSuchTagSet' || e.code === 'NoSuchBucket') { + result.push({ + name: bucket.Name, + region: region ?? 'us-east-1', + }); + } else if (e.code === 'InvalidToken') { + // We see some buckets in some accounts that were somehow created in an opt-in region different from the one to which the account is + // actually opted in. We don't quite know how this happened, but for now, we'll make a note of the inconsistency and continue + // processing the rest of the buckets. + console.error(`Skipping processing ${account.accountId}, bucket ${bucket.Name}`, e); + } else { throw e; } - result.push({ - name: bucket.Name, - }); } } return result; @@ -503,8 +539,12 @@ const deleteBucket = async (account: AWSAccountInfo, accountIndex: number, bucke const { name } = bucket; try { console.log(`${generateAccountInfo(account, accountIndex)} Deleting S3 Bucket ${name}`); - const s3 = new aws.S3(getAWSConfig(account)); - await deleteS3Bucket(name, s3); + const awsConfig = getAWSConfig(account); + const regionalizedS3Client = new aws.S3({ + region: bucket.region, + ...(awsConfig as object), + }); + await deleteS3Bucket(name, regionalizedS3Client); } catch (e) { console.log(`${generateAccountInfo(account, accountIndex)} Deleting bucket ${name} failed with error ${e.message}`); if (e.code === 'ExpiredTokenException') { diff --git a/packages/amplify-graphql-api-construct-tests/src/commands.ts b/packages/amplify-graphql-api-construct-tests/src/commands.ts index ad171400ae..c7e671e688 100644 --- a/packages/amplify-graphql-api-construct-tests/src/commands.ts +++ b/packages/amplify-graphql-api-construct-tests/src/commands.ts @@ -52,7 +52,7 @@ export type InitCDKProjectProps = { * @returns a promise which resolves to the stack name */ export const initCDKProject = async (cwd: string, templatePath: string, props?: InitCDKProjectProps): Promise => { - const { cdkVersion = '2.80.0', additionalDependencies = [] } = props ?? {}; + const { cdkVersion = '2.97.0', additionalDependencies = [] } = props ?? {}; await spawn(getNpxPath(), ['cdk', 'init', 'app', '--language', 'typescript'], { cwd, @@ -84,12 +84,15 @@ export type CdkDeployProps = { * @returns the generated outputs file as a JSON object */ export const cdkDeploy = async (cwd: string, option: string, props?: CdkDeployProps): Promise => { + // The CodegenAssets BucketDeployment resource takes a while. Set the timeout to 10m account for that. (Note that this is the "no output + // timeout"--the overall deployment is still allowed to take longer than 10m) + const noOutputTimeout = props?.timeoutMs ?? 10 * 60 * 1000; await spawn(getNpxPath(), ['cdk', 'deploy', '--outputs-file', 'outputs.json', '--require-approval', 'never', option], { cwd, stripColors: true, // npx cdk does not work on verdaccio env: { npm_config_registry: 'https://registry.npmjs.org/' }, - noOutputTimeout: props?.timeoutMs, + noOutputTimeout: noOutputTimeout, }).runAsync(); return JSON.parse(readFileSync(path.join(cwd, 'outputs.json'), 'utf8')); From 1965dd837eb5dcda764d94141c48ce4e4884be58 Mon Sep 17 00:00:00 2001 From: Christopher Sundersingh <83315412+sundersc@users.noreply.github.com> Date: Fri, 16 Feb 2024 14:23:09 -0800 Subject: [PATCH 14/45] chore(api): remove scan artifacts command when reporting metrics (#2278) --- codebuild_specs/emit_createapi_canary_metric.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codebuild_specs/emit_createapi_canary_metric.yml b/codebuild_specs/emit_createapi_canary_metric.yml index 7ea190a414..a6299e727b 100644 --- a/codebuild_specs/emit_createapi_canary_metric.yml +++ b/codebuild_specs/emit_createapi_canary_metric.yml @@ -12,4 +12,4 @@ phases: commands: - source ./shared-scripts.sh && _unassumeTestAccountCredentials - aws sts get-caller-identity - - source ./shared-scripts.sh && _scanArtifacts && _emitCreateApiCanaryMetric + - source ./shared-scripts.sh && _emitCreateApiCanaryMetric From dccacbb3d136bce395b8df2fc5bf6ac68f7e11cf Mon Sep 17 00:00:00 2001 From: phani-srikar Date: Wed, 7 Feb 2024 13:19:08 -0800 Subject: [PATCH 15/45] chore: enable all supported regions in E2E tests --- codebuild_specs/e2e_workflow.yml | 204 +++++++++++++++---------------- scripts/split-e2e-tests.ts | 21 +++- shared-scripts.sh | 17 ++- 3 files changed, 134 insertions(+), 108 deletions(-) diff --git a/codebuild_specs/e2e_workflow.yml b/codebuild_specs/e2e_workflow.yml index 568c550b26..f199f938f1 100644 --- a/codebuild_specs/e2e_workflow.yml +++ b/codebuild_specs/e2e_workflow.yml @@ -67,7 +67,7 @@ batch: variables: TEST_SUITE: >- src/__tests__/auth_2.test.ts|src/__tests__/datastore-modelgen.test.ts|src/__tests__/amplify-app.test.ts|src/__tests__/graphql-v2/custom-transformers.test.ts - CLI_REGION: us-east-1 + CLI_REGION: ap-northeast-2 depend-on: - publish_to_local_registry - identifier: >- @@ -78,7 +78,7 @@ batch: variables: TEST_SUITE: >- src/__tests__/mock-api.test.ts|src/__tests__/graphql-v2/invalid-input-arguments.test.ts|src/__tests__/schema-versioned.test.ts|src/__tests__/schema-data-access-patterns.test.ts - CLI_REGION: us-east-2 + CLI_REGION: ap-south-1 depend-on: - publish_to_local_registry - identifier: predictions_migration_api_10_function_10_schema_predictions @@ -88,7 +88,7 @@ batch: variables: TEST_SUITE: >- src/__tests__/transformer-migrations/predictions-migration.test.ts|src/__tests__/api_10.test.ts|src/__tests__/function_10.test.ts|src/__tests__/schema-predictions.test.ts - CLI_REGION: us-west-2 + CLI_REGION: us-east-2 depend-on: - publish_to_local_registry - identifier: api_7_http_migration_global_sandbox_schema_function_2 @@ -98,7 +98,7 @@ batch: variables: TEST_SUITE: >- src/__tests__/api_7.test.ts|src/__tests__/transformer-migrations/http-migration.test.ts|src/__tests__/global_sandbox.test.ts|src/__tests__/schema-function-2.test.ts - CLI_REGION: eu-central-1 + CLI_REGION: ap-southeast-2 depend-on: - publish_to_local_registry - identifier: api_connection_migration_api_8_schema_iterative_update_3_auth_migration @@ -108,7 +108,7 @@ batch: variables: TEST_SUITE: >- src/__tests__/migration/api.connection.migration.test.ts|src/__tests__/api_8.test.ts|src/__tests__/schema-iterative-update-3.test.ts|src/__tests__/transformer-migrations/auth-migration.test.ts - CLI_REGION: us-east-1 + CLI_REGION: ca-central-1 depend-on: - publish_to_local_registry - identifier: >- @@ -119,7 +119,7 @@ batch: variables: TEST_SUITE: >- src/__tests__/graphql-v2/lambda-conflict-handler.test.ts|src/__tests__/schema-iterative-update-1.test.ts|src/__tests__/schema-iterative-update-locking.test.ts|src/__tests__/graphql-v2/index-with-stack-mappings.test.ts - CLI_REGION: ap-northeast-1 + CLI_REGION: sa-east-1 depend-on: - publish_to_local_registry - identifier: >- @@ -130,7 +130,7 @@ batch: variables: TEST_SUITE: >- src/__tests__/api_4.test.ts|src/__tests__/custom_policies_container.test.ts|src/__tests__/schema-iterative-update-2.test.ts|src/__tests__/migration/api.connection.migration2.test.ts - CLI_REGION: us-east-2 + CLI_REGION: eu-south-1 depend-on: - publish_to_local_registry - identifier: api_5_containers_api_secrets_schema_function_1_api_3 @@ -143,24 +143,24 @@ batch: CLI_REGION: us-east-1 depend-on: - publish_to_local_registry - - identifier: sql_generate_unauth_api_1_resolvers_sync_query_datastore + - identifier: generate_ts_data_schema_sql_generate_unauth_api_1_resolvers buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: >- - src/__tests__/sql-generate-unauth.test.ts|src/__tests__/api_1.test.ts|src/__tests__/resolvers.test.ts|src/__tests__/graphql-v2/sync_query_datastore.test.ts - CLI_REGION: ap-southeast-1 + src/__tests__/generate_ts_data_schema.test.ts|src/__tests__/sql-generate-unauth.test.ts|src/__tests__/api_1.test.ts|src/__tests__/resolvers.test.ts + CLI_REGION: eu-west-3 depend-on: - publish_to_local_registry - - identifier: api_6_api_lambda_auth_api_9 + - identifier: sync_query_datastore_api_6_api_lambda_auth_api_9 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: >- - src/__tests__/api_6.test.ts|src/__tests__/graphql-v2/api_lambda_auth.test.ts|src/__tests__/api_9.test.ts - CLI_REGION: us-east-2 + src/__tests__/graphql-v2/sync_query_datastore.test.ts|src/__tests__/api_6.test.ts|src/__tests__/graphql-v2/api_lambda_auth.test.ts|src/__tests__/api_9.test.ts + CLI_REGION: ca-central-1 depend-on: - publish_to_local_registry - identifier: rds_v2 @@ -169,7 +169,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/rds-v2.test.ts - CLI_REGION: eu-west-2 + CLI_REGION: eu-central-1 depend-on: - publish_to_local_registry - identifier: function_migration @@ -178,7 +178,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/transformer-migrations/function-migration.test.ts - CLI_REGION: ap-northeast-1 + CLI_REGION: eu-west-2 depend-on: - publish_to_local_registry - identifier: api_key_migration3 @@ -187,7 +187,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/migration/api.key.migration3.test.ts - CLI_REGION: ap-southeast-1 + CLI_REGION: us-west-2 USE_PARENT_ACCOUNT: 1 depend-on: - publish_to_local_registry @@ -197,7 +197,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/migration/api.key.migration5.test.ts - CLI_REGION: ap-southeast-2 + CLI_REGION: ap-southeast-1 USE_PARENT_ACCOUNT: 1 depend-on: - publish_to_local_registry @@ -207,7 +207,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/schema-iterative-update-5.test.ts - CLI_REGION: us-east-2 + CLI_REGION: eu-north-1 depend-on: - publish_to_local_registry - identifier: model_migration @@ -216,7 +216,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/transformer-migrations/model-migration.test.ts - CLI_REGION: us-west-2 + CLI_REGION: me-south-1 depend-on: - publish_to_local_registry - identifier: schema_auth_10 @@ -225,7 +225,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/schema-auth-10.test.ts - CLI_REGION: eu-west-2 + CLI_REGION: eu-west-3 depend-on: - publish_to_local_registry - identifier: schema_auth_2 @@ -234,7 +234,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/schema-auth-2.test.ts - CLI_REGION: eu-central-1 + CLI_REGION: eu-west-1 depend-on: - publish_to_local_registry - identifier: schema_auth_1 @@ -243,7 +243,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/schema-auth-1.test.ts - CLI_REGION: ap-southeast-1 + CLI_REGION: us-east-1 depend-on: - publish_to_local_registry - identifier: schema_auth_12 @@ -252,7 +252,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/schema-auth-12.test.ts - CLI_REGION: ap-southeast-2 + CLI_REGION: ap-northeast-1 depend-on: - publish_to_local_registry - identifier: schema_auth_13 @@ -261,7 +261,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/schema-auth-13.test.ts - CLI_REGION: us-east-1 + CLI_REGION: us-west-1 depend-on: - publish_to_local_registry - identifier: schema_auth_15 @@ -270,7 +270,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/schema-auth-15.test.ts - CLI_REGION: us-west-2 + CLI_REGION: ap-east-1 depend-on: - publish_to_local_registry - identifier: schema_auth_3 @@ -279,7 +279,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/schema-auth-3.test.ts - CLI_REGION: eu-west-2 + CLI_REGION: ap-northeast-2 depend-on: - publish_to_local_registry - identifier: api_key_migration4 @@ -288,7 +288,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/migration/api.key.migration4.test.ts - CLI_REGION: eu-central-1 + CLI_REGION: ap-south-1 USE_PARENT_ACCOUNT: 1 depend-on: - publish_to_local_registry @@ -298,7 +298,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/schema-iterative-rollback-1.test.ts - CLI_REGION: ap-northeast-1 + CLI_REGION: us-east-2 depend-on: - publish_to_local_registry - identifier: schema_iterative_rollback_2 @@ -316,7 +316,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/schema-key.test.ts - CLI_REGION: us-east-1 + CLI_REGION: eu-west-2 depend-on: - publish_to_local_registry - identifier: containers_api_1 @@ -334,7 +334,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/schema-auth-4.test.ts - CLI_REGION: us-west-2 + CLI_REGION: ap-southeast-1 depend-on: - publish_to_local_registry - identifier: schema_auth_8 @@ -343,7 +343,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/schema-auth-8.test.ts - CLI_REGION: eu-west-2 + CLI_REGION: ca-central-1 depend-on: - publish_to_local_registry - identifier: api_key_migration2 @@ -352,7 +352,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/migration/api.key.migration2.test.ts - CLI_REGION: eu-central-1 + CLI_REGION: eu-north-1 USE_PARENT_ACCOUNT: 1 depend-on: - publish_to_local_registry @@ -362,7 +362,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/schema-auth-11.test.ts - CLI_REGION: ap-northeast-1 + CLI_REGION: me-south-1 depend-on: - publish_to_local_registry - identifier: api_key_migration1 @@ -371,7 +371,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/migration/api.key.migration1.test.ts - CLI_REGION: ap-southeast-2 + CLI_REGION: eu-west-1 depend-on: - publish_to_local_registry - identifier: api_11 @@ -380,7 +380,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/api_11.test.ts - CLI_REGION: us-east-1 + CLI_REGION: sa-east-1 depend-on: - publish_to_local_registry - identifier: rds_mysql_auth_apikey_lambda @@ -389,7 +389,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/rds-mysql-auth-apikey-lambda.test.ts - CLI_REGION: us-east-2 + CLI_REGION: us-east-1 depend-on: - publish_to_local_registry - identifier: rds_mysql_auth_iam_apikey_lambda_subscription @@ -398,7 +398,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/rds-mysql-auth-iam-apikey-lambda-subscription.test.ts - CLI_REGION: us-west-2 + CLI_REGION: ap-northeast-1 depend-on: - publish_to_local_registry - identifier: rds_mysql_auth_iam @@ -407,7 +407,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/rds-mysql-auth-iam.test.ts - CLI_REGION: eu-west-2 + CLI_REGION: us-west-1 depend-on: - publish_to_local_registry - identifier: rds_mysql_custom_claims_refersto_auth @@ -416,7 +416,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/rds-mysql-custom-claims-refersto-auth.test.ts - CLI_REGION: eu-central-1 + CLI_REGION: eu-south-1 depend-on: - publish_to_local_registry - identifier: rds_mysql_model_v2 @@ -425,7 +425,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/rds-mysql-model-v2.test.ts - CLI_REGION: ap-northeast-1 + CLI_REGION: ap-east-1 depend-on: - publish_to_local_registry - identifier: rds_mysql_multi_auth_1 @@ -434,7 +434,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/rds-mysql-multi-auth-1.test.ts - CLI_REGION: ap-southeast-1 + CLI_REGION: ap-northeast-2 depend-on: - publish_to_local_registry - identifier: rds_mysql_oidc_auth @@ -443,7 +443,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/rds-mysql-oidc-auth.test.ts - CLI_REGION: ap-southeast-2 + CLI_REGION: ap-south-1 depend-on: - publish_to_local_registry - identifier: rds_mysql_refers_to_fields @@ -452,7 +452,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/rds-mysql-refers-to-fields.test.ts - CLI_REGION: us-east-1 + CLI_REGION: us-east-2 depend-on: - publish_to_local_registry - identifier: rds_mysql_refers_to @@ -461,7 +461,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/rds-mysql-refers-to.test.ts - CLI_REGION: us-east-2 + CLI_REGION: eu-central-1 depend-on: - publish_to_local_registry - identifier: rds_mysql_userpool_auth @@ -470,7 +470,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/rds-mysql-userpool-auth.test.ts - CLI_REGION: us-west-2 + CLI_REGION: ap-southeast-2 depend-on: - publish_to_local_registry - identifier: rds_mysql_v2_generate_schema @@ -488,7 +488,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/rds-pg-array-objects.test.ts - CLI_REGION: eu-central-1 + CLI_REGION: us-west-2 depend-on: - publish_to_local_registry - identifier: rds_pg_auth_apikey_lambda @@ -497,7 +497,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/rds-pg-auth-apikey-lambda.test.ts - CLI_REGION: ap-northeast-1 + CLI_REGION: ap-southeast-1 depend-on: - publish_to_local_registry - identifier: rds_pg_auth_iam_apikey_lambda_subscription @@ -506,7 +506,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/rds-pg-auth-iam-apikey-lambda-subscription.test.ts - CLI_REGION: ap-southeast-1 + CLI_REGION: ca-central-1 depend-on: - publish_to_local_registry - identifier: rds_pg_auth_iam @@ -515,7 +515,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/rds-pg-auth-iam.test.ts - CLI_REGION: ap-southeast-2 + CLI_REGION: eu-north-1 depend-on: - publish_to_local_registry - identifier: rds_pg_custom_claims_refersto_auth @@ -524,7 +524,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/rds-pg-custom-claims-refersto-auth.test.ts - CLI_REGION: us-east-1 + CLI_REGION: me-south-1 depend-on: - publish_to_local_registry - identifier: rds_pg_import @@ -533,7 +533,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/rds-pg-import.test.ts - CLI_REGION: us-east-2 + CLI_REGION: eu-west-3 depend-on: - publish_to_local_registry - identifier: rds_pg_model_v2 @@ -542,7 +542,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/rds-pg-model-v2.test.ts - CLI_REGION: us-west-2 + CLI_REGION: eu-west-1 depend-on: - publish_to_local_registry - identifier: rds_pg_oidc_auth @@ -551,7 +551,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/rds-pg-oidc-auth.test.ts - CLI_REGION: eu-west-2 + CLI_REGION: sa-east-1 depend-on: - publish_to_local_registry - identifier: rds_pg_refers_to_fields @@ -560,7 +560,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/rds-pg-refers-to-fields.test.ts - CLI_REGION: eu-central-1 + CLI_REGION: us-east-1 depend-on: - publish_to_local_registry - identifier: rds_pg_refers_to @@ -578,7 +578,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/rds-pg-relational-directives.test.ts - CLI_REGION: ap-southeast-1 + CLI_REGION: us-west-1 depend-on: - publish_to_local_registry - identifier: rds_pg_userpool_auth @@ -587,7 +587,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/rds-pg-userpool-auth.test.ts - CLI_REGION: ap-southeast-2 + CLI_REGION: eu-south-1 depend-on: - publish_to_local_registry - identifier: rds_pg_v2_generate_schema @@ -596,7 +596,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/rds-pg-v2-generate-schema.test.ts - CLI_REGION: us-east-1 + CLI_REGION: ap-east-1 depend-on: - publish_to_local_registry - identifier: rds_relational_directives @@ -605,7 +605,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/rds-relational-directives.test.ts - CLI_REGION: us-east-2 + CLI_REGION: ap-northeast-2 depend-on: - publish_to_local_registry - identifier: rds_v2_test_utils @@ -614,7 +614,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/rds-v2-test-utils.test.ts - CLI_REGION: us-west-2 + CLI_REGION: ap-south-1 depend-on: - publish_to_local_registry - identifier: schema_model @@ -623,7 +623,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/schema-model.test.ts - CLI_REGION: eu-west-2 + CLI_REGION: us-east-2 depend-on: - publish_to_local_registry - identifier: apigw @@ -650,7 +650,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/schema-auth-14.test.ts - CLI_REGION: ap-southeast-1 + CLI_REGION: eu-west-2 depend-on: - publish_to_local_registry - identifier: schema_auth_7 @@ -659,7 +659,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/schema-auth-7.test.ts - CLI_REGION: ap-southeast-2 + CLI_REGION: us-west-2 depend-on: - publish_to_local_registry - identifier: schema_auth_9 @@ -668,7 +668,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/schema-auth-9.test.ts - CLI_REGION: us-east-1 + CLI_REGION: ap-southeast-1 depend-on: - publish_to_local_registry - identifier: schema_auth_5 @@ -677,7 +677,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/schema-auth-5.test.ts - CLI_REGION: us-west-2 + CLI_REGION: eu-north-1 depend-on: - publish_to_local_registry - identifier: searchable_datastore @@ -686,7 +686,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/graphql-v2/searchable-datastore.test.ts - CLI_REGION: eu-west-2 + CLI_REGION: me-south-1 USE_PARENT_ACCOUNT: 1 depend-on: - publish_to_local_registry @@ -696,7 +696,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/schema-iterative-update-4.test.ts - CLI_REGION: eu-central-1 + CLI_REGION: eu-west-3 depend-on: - publish_to_local_registry - identifier: schema_searchable @@ -705,7 +705,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/schema-searchable.test.ts - CLI_REGION: ap-northeast-1 + CLI_REGION: eu-west-1 USE_PARENT_ACCOUNT: 1 depend-on: - publish_to_local_registry @@ -715,7 +715,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/schema-auth-6.test.ts - CLI_REGION: ap-southeast-1 + CLI_REGION: sa-east-1 depend-on: - publish_to_local_registry - identifier: schema_connection @@ -724,7 +724,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/schema-connection.test.ts - CLI_REGION: ap-southeast-2 + CLI_REGION: us-east-1 depend-on: - publish_to_local_registry - identifier: searchable_previous_deployment_had_node_to_node @@ -734,7 +734,7 @@ batch: variables: TEST_SUITE: >- src/__tests__/graphql-v2/searchable-node-to-node-encryption/searchable-previous-deployment-had-node-to-node.test.ts - CLI_REGION: us-east-1 + CLI_REGION: ap-northeast-1 depend-on: - publish_to_local_registry - identifier: searchable_previous_deployment_no_node_to_node @@ -744,7 +744,7 @@ batch: variables: TEST_SUITE: >- src/__tests__/graphql-v2/searchable-node-to-node-encryption/searchable-previous-deployment-no-node-to-node.test.ts - CLI_REGION: us-east-2 + CLI_REGION: us-west-1 depend-on: - publish_to_local_registry - identifier: api_2 @@ -753,7 +753,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/api_2.test.ts - CLI_REGION: us-west-2 + CLI_REGION: ap-east-1 depend-on: - publish_to_local_registry - identifier: searchable_migration @@ -762,7 +762,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/transformer-migrations/searchable-migration.test.ts - CLI_REGION: eu-west-2 + CLI_REGION: ap-northeast-2 USE_PARENT_ACCOUNT: 1 depend-on: - publish_to_local_registry @@ -773,7 +773,7 @@ batch: variables: TEST_SUITE: >- src/__tests__/add-resources.test.ts|src/__tests__/admin-role.test.ts|src/__tests__/all-auth-modes.test.ts|src/__tests__/amplify-table-1.test.ts - CLI_REGION: us-east-1 + CLI_REGION: ap-northeast-2 depend-on: - publish_to_local_registry - identifier: amplify_table_2_base_cdk_custom_logic_data_construct @@ -783,7 +783,7 @@ batch: variables: TEST_SUITE: >- src/__tests__/amplify-table-2.test.ts|src/__tests__/base-cdk.test.ts|src/__tests__/custom-logic.test.ts|src/__tests__/data-construct.test.ts - CLI_REGION: us-east-2 + CLI_REGION: ap-south-1 depend-on: - publish_to_local_registry - identifier: >- @@ -794,7 +794,7 @@ batch: variables: TEST_SUITE: >- src/__tests__/deploy-velocity-temporarily-disabled/3-gsis-10k-records.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/3-gsis-1k-records.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/3-gsis-empty-table.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/3-gsis-single-record.test.ts - CLI_REGION: us-west-2 + CLI_REGION: us-east-2 depend-on: - publish_to_local_registry - identifier: >- @@ -805,7 +805,7 @@ batch: variables: TEST_SUITE: >- src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-10k-records.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-1k-records.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-empty-table.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-single-record.test.ts - CLI_REGION: eu-west-2 + CLI_REGION: eu-central-1 depend-on: - publish_to_local_registry - identifier: >- @@ -816,7 +816,7 @@ batch: variables: TEST_SUITE: >- src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-update-attr-10k-records.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-update-attr-1k-records.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-update-attr-empty-table.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-update-attr-single-record.test.ts - CLI_REGION: eu-central-1 + CLI_REGION: ap-southeast-2 depend-on: - publish_to_local_registry - identifier: >- @@ -827,7 +827,7 @@ batch: variables: TEST_SUITE: >- src/__tests__/deploy-velocity-temporarily-disabled/single-gsi-10k-records.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/single-gsi-1k-records.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/single-gsi-empty-table.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/single-gsi-single-record.test.ts - CLI_REGION: ap-northeast-1 + CLI_REGION: eu-west-2 depend-on: - publish_to_local_registry - identifier: relationships_sql_models @@ -836,7 +836,7 @@ batch: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: src/__tests__/relationships.test.ts|src/__tests__/sql-models.test.ts - CLI_REGION: ap-southeast-1 + CLI_REGION: us-west-2 depend-on: - publish_to_local_registry - identifier: 3_gsis_100k_records @@ -845,7 +845,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/deploy-velocity/3-gsis-100k-records.test.ts - CLI_REGION: ap-southeast-2 + CLI_REGION: ap-southeast-1 depend-on: - publish_to_local_registry - identifier: replace_2_gsis_100k_records @@ -854,7 +854,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/deploy-velocity/replace-2-gsis-100k-records.test.ts - CLI_REGION: us-east-1 + CLI_REGION: ca-central-1 depend-on: - publish_to_local_registry - identifier: replace_2_gsis_update_attr_100k_records @@ -864,7 +864,7 @@ batch: variables: TEST_SUITE: >- src/__tests__/deploy-velocity/replace-2-gsis-update-attr-100k-records.test.ts - CLI_REGION: us-east-2 + CLI_REGION: eu-north-1 depend-on: - publish_to_local_registry - identifier: single_gsi_100k_records @@ -873,7 +873,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/deploy-velocity/single-gsi-100k-records.test.ts - CLI_REGION: us-west-2 + CLI_REGION: me-south-1 depend-on: - publish_to_local_registry - identifier: >- @@ -884,7 +884,7 @@ batch: variables: TEST_SUITE: >- src/__tests__/CustomRoots.e2e.test.ts|src/__tests__/KeyTransformerLocal.e2e.test.ts|src/__tests__/NestedStacksTest.e2e.test.ts|src/__tests__/TestComplexStackMappingsLocal.e2e.test.ts - CLI_REGION: us-east-1 + CLI_REGION: ap-northeast-2 depend-on: - publish_to_local_registry - identifier: >- @@ -895,7 +895,7 @@ batch: variables: TEST_SUITE: >- src/__tests__/NonModelAuthV2Function.e2e.test.ts|src/__tests__/FunctionTransformerTests.e2e.test.ts|src/__tests__/KeyWithAuth.e2e.test.ts|src/__tests__/MutationCondition.e2e.test.ts - CLI_REGION: us-east-2 + CLI_REGION: ap-south-1 depend-on: - publish_to_local_registry - identifier: >- @@ -906,7 +906,7 @@ batch: variables: TEST_SUITE: >- src/__tests__/NoneEnvFunctionTransformer.e2e.test.ts|src/__tests__/NonModelAuthFunction.e2e.test.ts|src/__tests__/PerFieldAuthTests.e2e.test.ts|src/__tests__/PredictionsTransformerTests.e2e.test.ts - CLI_REGION: eu-west-2 + CLI_REGION: eu-central-1 depend-on: - publish_to_local_registry - identifier: >- @@ -917,7 +917,7 @@ batch: variables: TEST_SUITE: >- src/__tests__/PredictionsTransformerV2Tests.e2e.test.ts|src/__tests__/TransformerOptionsV2.e2e.test.ts|src/__tests__/VersionedModelTransformer.e2e.test.ts|src/__tests__/ConnectionsWithAuthTests.e2e.test.ts - CLI_REGION: eu-central-1 + CLI_REGION: ap-southeast-2 depend-on: - publish_to_local_registry - identifier: >- @@ -928,7 +928,7 @@ batch: variables: TEST_SUITE: >- src/__tests__/DefaultValueTransformer.e2e.test.ts|src/__tests__/DynamoDBModelTransformer.e2e.test.ts|src/__tests__/ModelConnectionTransformer.e2e.test.ts|src/__tests__/NewConnectionTransformer.e2e.test.ts - CLI_REGION: ap-northeast-1 + CLI_REGION: eu-west-2 depend-on: - publish_to_local_registry - identifier: >- @@ -939,7 +939,7 @@ batch: variables: TEST_SUITE: >- src/__tests__/NewConnectionWithAuth.e2e.test.ts|src/__tests__/RelationalWithOwnerFieldAsKeySchemaAuth.e2e.test.ts|src/__tests__/BelongsToTransformerV2.e2e.test.ts|src/__tests__/KeyTransformer.e2e.test.ts - CLI_REGION: us-east-1 + CLI_REGION: ca-central-1 depend-on: - publish_to_local_registry - identifier: >- @@ -950,7 +950,7 @@ batch: variables: TEST_SUITE: >- src/__tests__/ModelAuthTransformer.e2e.test.ts|src/__tests__/PerFieldAuthV2Transformer.e2e.test.ts|src/__tests__/PerFieldAuthV2TransformerWithFF.e2e.test.ts|src/__tests__/SubscriptionsWithAuthTest.e2e.test.ts - CLI_REGION: us-east-2 + CLI_REGION: eu-north-1 depend-on: - publish_to_local_registry - identifier: >- @@ -961,7 +961,7 @@ batch: variables: TEST_SUITE: >- src/__tests__/IndexWithAuthV2.e2e.test.ts|src/__tests__/ModelConnectionWithKeyTransformer.e2e.test.ts|src/__tests__/RelationalWithAuthV2WithFF.e2e.test.ts|src/__tests__/IndexWithAuthV2WithFF.e2e.test.ts - CLI_REGION: us-west-2 + CLI_REGION: me-south-1 depend-on: - publish_to_local_registry - identifier: >- @@ -972,7 +972,7 @@ batch: variables: TEST_SUITE: >- src/__tests__/MultiAuthModelAuthTransformer.e2e.test.ts|src/__tests__/IndexWithClaimFieldAsSortKeyAuth.e2e.test.ts|src/__tests__/ModelTransformer.e2e.test.ts|src/__tests__/MultiAuthV2Transformer.e2e.test.ts - CLI_REGION: eu-west-2 + CLI_REGION: eu-west-3 depend-on: - publish_to_local_registry - identifier: >- @@ -983,7 +983,7 @@ batch: variables: TEST_SUITE: >- src/__tests__/SubscriptionsWithAuthV2WithFF.e2e.test.ts|src/__tests__/MapsToTransformer.e2e.test.ts|src/__tests__/RelationalWithAuthV2.e2e.test.ts|src/__tests__/SubscriptionsWithAuthV2.e2e.test.ts - CLI_REGION: eu-central-1 + CLI_REGION: eu-west-1 depend-on: - publish_to_local_registry - identifier: >- @@ -994,7 +994,7 @@ batch: variables: TEST_SUITE: >- src/__tests__/IndexTransformer.e2e.test.ts|src/__tests__/MultiAuthV2TransformerWithFF.e2e.test.ts|src/__tests__/AuthV2Transformer.e2e.test.ts|src/__tests__/AuthV2ExhaustiveT1A.test.ts - CLI_REGION: ap-northeast-1 + CLI_REGION: sa-east-1 depend-on: - publish_to_local_registry - identifier: >- @@ -1005,7 +1005,7 @@ batch: variables: TEST_SUITE: >- src/__tests__/AuthV2ExhaustiveT1B.test.ts|src/__tests__/AuthV2TransformerWithFF.e2e.test.ts|src/__tests__/IndexWithAutoQueryField.e2e.test.ts|src/__tests__/AuthV2ExhaustiveT1C.test.ts - CLI_REGION: ap-southeast-1 + CLI_REGION: us-east-1 depend-on: - publish_to_local_registry - identifier: >- @@ -1016,7 +1016,7 @@ batch: variables: TEST_SUITE: >- src/__tests__/AuthV2ExhaustiveT2A.test.ts|src/__tests__/RelationalTransformers.e2e.test.ts|src/__tests__/SubscriptionsRuntimeFiltering.e2e.test.ts|src/__tests__/AuthV2ExhaustiveT1D.test.ts - CLI_REGION: ap-southeast-2 + CLI_REGION: ap-northeast-1 depend-on: - publish_to_local_registry - identifier: >- @@ -1027,7 +1027,7 @@ batch: variables: TEST_SUITE: >- src/__tests__/AuthV2ExhaustiveT2B.test.ts|src/__tests__/AuthV2ExhaustiveT2D.test.ts|src/__tests__/AuthV2ExhaustiveT2C.test.ts|src/__tests__/SearchableModelTransformerV2.e2e.test.ts - CLI_REGION: us-east-1 + CLI_REGION: us-west-1 depend-on: - publish_to_local_registry - identifier: >- @@ -1038,7 +1038,7 @@ batch: variables: TEST_SUITE: >- src/__tests__/SearchableWithAuthTests.e2e.test.ts|src/__tests__/SearchableModelTransformer.e2e.test.ts|src/__tests__/SearchableWithAuthV2.e2e.test.ts|src/__tests__/SearchableWithAuthV2WithFF.e2e.test.ts - CLI_REGION: us-east-2 + CLI_REGION: eu-south-1 depend-on: - publish_to_local_registry - identifier: FunctionTransformerTestsV2 @@ -1047,7 +1047,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/FunctionTransformerTestsV2.e2e.test.ts - CLI_REGION: us-west-2 + CLI_REGION: us-east-2 USE_PARENT_ACCOUNT: 1 depend-on: - publish_to_local_registry @@ -1057,7 +1057,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/HttpTransformer.e2e.test.ts - CLI_REGION: ap-southeast-1 + CLI_REGION: us-west-2 depend-on: - publish_to_local_registry - identifier: HttpTransformerV2 @@ -1066,7 +1066,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/HttpTransformerV2.e2e.test.ts - CLI_REGION: ap-southeast-2 + CLI_REGION: ap-southeast-1 depend-on: - publish_to_local_registry - identifier: cleanup_e2e_resources diff --git a/scripts/split-e2e-tests.ts b/scripts/split-e2e-tests.ts index 6683232e5d..fc65cd89e9 100644 --- a/scripts/split-e2e-tests.ts +++ b/scripts/split-e2e-tests.ts @@ -45,14 +45,25 @@ type CandidateJob = { // Ensure to update packages/amplify-e2e-tests/src/cleanup-e2e-resources.ts is also updated this gets updated const AWS_REGIONS_TO_RUN_TESTS = [ - 'us-east-1', + 'ap-northeast-2', + 'ap-south-1', 'us-east-2', - 'us-west-2', - 'eu-west-2', 'eu-central-1', - 'ap-northeast-1', - 'ap-southeast-1', 'ap-southeast-2', + 'eu-west-2', + 'us-west-2', + 'ap-southeast-1', + 'ca-central-1', + 'eu-north-1', + 'me-south-1', + 'eu-west-3', + 'eu-west-1', + 'sa-east-1', + 'us-east-1', + 'ap-northeast-1', + 'us-west-1', + 'eu-south-1', + 'ap-east-1', ]; // Some services (eg. amazon lex, containers) are not available in all regions diff --git a/shared-scripts.sh b/shared-scripts.sh index 9333979c6f..c7dcc024c7 100755 --- a/shared-scripts.sh +++ b/shared-scripts.sh @@ -279,7 +279,22 @@ function useChildAccountCredentials { parent_acct=$(aws sts get-caller-identity | jq -cr '.Account') child_accts=$(aws organizations list-accounts | jq -c "[.Accounts[].Id | select(. != \"$parent_acct\")]") org_size=$(echo $child_accts | jq 'length') - pick_acct=$(echo $child_accts | jq -cr ".[$RANDOM % $org_size]") + opt_in_regions="eu-south-1 ap-east-1" + if echo "$opt_in_regions" | grep -qw "$CLI_REGION"; then + child_accts=$(echo $child_accts | jq -c '.[]') + for child_acct in $child_accts; do + child_acct=$(echo $child_acct | tr -d '"') + # Get enabled opt-in regions for the child account + enabled_regions=$(aws account list-regions --account-id $child_acct --region-opt-status-contains ENABLED) + # Check if given opt-in region is enabled for the child account + if echo "$enabled_regions" | jq -e ".Regions[].RegionName == \"$CLI_REGION\""; then + pick_acct=$child_acct + break + fi + done + else + pick_acct=$(echo $child_accts | jq -cr ".[$RANDOM % $org_size]") + fi session_id=$((1 + $RANDOM % 10000)) if [[ -z "$pick_acct" || -z "$session_id" ]]; then echo "Unable to find a child account. Falling back to parent AWS account" From 9ef6662f3b1fb13250c568edf726d578ac3f62a3 Mon Sep 17 00:00:00 2001 From: phani-srikar Date: Wed, 7 Feb 2024 14:33:28 -0800 Subject: [PATCH 16/45] chore: run select tests in all regions --- codebuild_specs/e2e_workflow.yml | 1022 +++++++++++++++++++++++++----- scripts/split-e2e-tests.ts | 33 +- 2 files changed, 877 insertions(+), 178 deletions(-) diff --git a/codebuild_specs/e2e_workflow.yml b/codebuild_specs/e2e_workflow.yml index f199f938f1..f30d1914d5 100644 --- a/codebuild_specs/e2e_workflow.yml +++ b/codebuild_specs/e2e_workflow.yml @@ -81,86 +81,95 @@ batch: CLI_REGION: ap-south-1 depend-on: - publish_to_local_registry - - identifier: predictions_migration_api_10_function_10_schema_predictions + - identifier: predictions_migration_function_10_schema_predictions_api_7 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: >- - src/__tests__/transformer-migrations/predictions-migration.test.ts|src/__tests__/api_10.test.ts|src/__tests__/function_10.test.ts|src/__tests__/schema-predictions.test.ts + src/__tests__/transformer-migrations/predictions-migration.test.ts|src/__tests__/function_10.test.ts|src/__tests__/schema-predictions.test.ts|src/__tests__/api_7.test.ts CLI_REGION: us-east-2 depend-on: - publish_to_local_registry - - identifier: api_7_http_migration_global_sandbox_schema_function_2 + - identifier: http_migration_global_sandbox_schema_function_2_api_connection_migration buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: >- - src/__tests__/api_7.test.ts|src/__tests__/transformer-migrations/http-migration.test.ts|src/__tests__/global_sandbox.test.ts|src/__tests__/schema-function-2.test.ts - CLI_REGION: ap-southeast-2 + src/__tests__/transformer-migrations/http-migration.test.ts|src/__tests__/global_sandbox.test.ts|src/__tests__/schema-function-2.test.ts|src/__tests__/migration/api.connection.migration.test.ts + CLI_REGION: eu-west-2 depend-on: - publish_to_local_registry - - identifier: api_connection_migration_api_8_schema_iterative_update_3_auth_migration + - identifier: api_8_schema_iterative_update_3_auth_migration_lambda_conflict_handler buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: >- - src/__tests__/migration/api.connection.migration.test.ts|src/__tests__/api_8.test.ts|src/__tests__/schema-iterative-update-3.test.ts|src/__tests__/transformer-migrations/auth-migration.test.ts - CLI_REGION: ca-central-1 + src/__tests__/api_8.test.ts|src/__tests__/schema-iterative-update-3.test.ts|src/__tests__/transformer-migrations/auth-migration.test.ts|src/__tests__/graphql-v2/lambda-conflict-handler.test.ts + CLI_REGION: me-south-1 depend-on: - publish_to_local_registry - identifier: >- - lambda_conflict_handler_schema_iterative_update_1_schema_iterative_update_locking_index_with_stack_mappings + schema_iterative_update_1_schema_iterative_update_locking_index_with_stack_mappings_api_4 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: >- - src/__tests__/graphql-v2/lambda-conflict-handler.test.ts|src/__tests__/schema-iterative-update-1.test.ts|src/__tests__/schema-iterative-update-locking.test.ts|src/__tests__/graphql-v2/index-with-stack-mappings.test.ts - CLI_REGION: sa-east-1 + src/__tests__/schema-iterative-update-1.test.ts|src/__tests__/schema-iterative-update-locking.test.ts|src/__tests__/graphql-v2/index-with-stack-mappings.test.ts|src/__tests__/api_4.test.ts + CLI_REGION: ap-northeast-1 depend-on: - publish_to_local_registry - identifier: >- - api_4_custom_policies_container_schema_iterative_update_2_api_connection_migration2 + custom_policies_container_schema_iterative_update_2_api_connection_migration2_api_5 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: >- - src/__tests__/api_4.test.ts|src/__tests__/custom_policies_container.test.ts|src/__tests__/schema-iterative-update-2.test.ts|src/__tests__/migration/api.connection.migration2.test.ts - CLI_REGION: eu-south-1 + src/__tests__/custom_policies_container.test.ts|src/__tests__/schema-iterative-update-2.test.ts|src/__tests__/migration/api.connection.migration2.test.ts|src/__tests__/api_5.test.ts + CLI_REGION: ap-south-1 depend-on: - publish_to_local_registry - - identifier: api_5_containers_api_secrets_schema_function_1_api_3 + - identifier: containers_api_secrets_schema_function_1_api_3_generate_ts_data_schema buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: >- - src/__tests__/api_5.test.ts|src/__tests__/containers-api-secrets.test.ts|src/__tests__/schema-function-1.test.ts|src/__tests__/api_3.test.ts + src/__tests__/containers-api-secrets.test.ts|src/__tests__/schema-function-1.test.ts|src/__tests__/api_3.test.ts|src/__tests__/generate_ts_data_schema.test.ts CLI_REGION: us-east-1 depend-on: - publish_to_local_registry - - identifier: generate_ts_data_schema_sql_generate_unauth_api_1_resolvers + - identifier: sql_generate_unauth_resolvers_sync_query_datastore_api_6 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: >- - src/__tests__/generate_ts_data_schema.test.ts|src/__tests__/sql-generate-unauth.test.ts|src/__tests__/api_1.test.ts|src/__tests__/resolvers.test.ts - CLI_REGION: eu-west-3 + src/__tests__/sql-generate-unauth.test.ts|src/__tests__/resolvers.test.ts|src/__tests__/graphql-v2/sync_query_datastore.test.ts|src/__tests__/api_6.test.ts + CLI_REGION: us-east-1 depend-on: - publish_to_local_registry - - identifier: sync_query_datastore_api_6_api_lambda_auth_api_9 + - identifier: api_lambda_auth_api_9 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: >- - src/__tests__/graphql-v2/sync_query_datastore.test.ts|src/__tests__/api_6.test.ts|src/__tests__/graphql-v2/api_lambda_auth.test.ts|src/__tests__/api_9.test.ts - CLI_REGION: ca-central-1 + src/__tests__/graphql-v2/api_lambda_auth.test.ts|src/__tests__/api_9.test.ts + CLI_REGION: eu-west-3 + depend-on: + - publish_to_local_registry + - identifier: api_10 + buildspec: codebuild_specs/run_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/api_10.test.ts + CLI_REGION: eu-central-1 depend-on: - publish_to_local_registry - identifier: rds_v2 @@ -169,7 +178,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/rds-v2.test.ts - CLI_REGION: eu-central-1 + CLI_REGION: ap-southeast-2 depend-on: - publish_to_local_registry - identifier: function_migration @@ -178,7 +187,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/transformer-migrations/function-migration.test.ts - CLI_REGION: eu-west-2 + CLI_REGION: us-west-2 depend-on: - publish_to_local_registry - identifier: api_key_migration3 @@ -187,7 +196,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/migration/api.key.migration3.test.ts - CLI_REGION: us-west-2 + CLI_REGION: ap-southeast-1 USE_PARENT_ACCOUNT: 1 depend-on: - publish_to_local_registry @@ -197,7 +206,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/migration/api.key.migration5.test.ts - CLI_REGION: ap-southeast-1 + CLI_REGION: ca-central-1 USE_PARENT_ACCOUNT: 1 depend-on: - publish_to_local_registry @@ -216,7 +225,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/transformer-migrations/model-migration.test.ts - CLI_REGION: me-south-1 + CLI_REGION: eu-west-3 depend-on: - publish_to_local_registry - identifier: schema_auth_10 @@ -225,7 +234,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/schema-auth-10.test.ts - CLI_REGION: eu-west-3 + CLI_REGION: eu-west-1 depend-on: - publish_to_local_registry - identifier: schema_auth_2 @@ -234,7 +243,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/schema-auth-2.test.ts - CLI_REGION: eu-west-1 + CLI_REGION: sa-east-1 depend-on: - publish_to_local_registry - identifier: schema_auth_1 @@ -252,7 +261,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/schema-auth-12.test.ts - CLI_REGION: ap-northeast-1 + CLI_REGION: us-west-1 depend-on: - publish_to_local_registry - identifier: schema_auth_13 @@ -261,7 +270,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/schema-auth-13.test.ts - CLI_REGION: us-west-1 + CLI_REGION: eu-south-1 depend-on: - publish_to_local_registry - identifier: schema_auth_15 @@ -288,7 +297,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/migration/api.key.migration4.test.ts - CLI_REGION: ap-south-1 + CLI_REGION: us-east-2 USE_PARENT_ACCOUNT: 1 depend-on: - publish_to_local_registry @@ -298,7 +307,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/schema-iterative-rollback-1.test.ts - CLI_REGION: us-east-2 + CLI_REGION: eu-central-1 depend-on: - publish_to_local_registry - identifier: schema_iterative_rollback_2 @@ -334,7 +343,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/schema-auth-4.test.ts - CLI_REGION: ap-southeast-1 + CLI_REGION: ca-central-1 depend-on: - publish_to_local_registry - identifier: schema_auth_8 @@ -343,7 +352,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/schema-auth-8.test.ts - CLI_REGION: ca-central-1 + CLI_REGION: eu-north-1 depend-on: - publish_to_local_registry - identifier: api_key_migration2 @@ -352,7 +361,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/migration/api.key.migration2.test.ts - CLI_REGION: eu-north-1 + CLI_REGION: me-south-1 USE_PARENT_ACCOUNT: 1 depend-on: - publish_to_local_registry @@ -362,7 +371,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/schema-auth-11.test.ts - CLI_REGION: me-south-1 + CLI_REGION: eu-west-3 depend-on: - publish_to_local_registry - identifier: api_key_migration1 @@ -389,7 +398,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/rds-mysql-auth-apikey-lambda.test.ts - CLI_REGION: us-east-1 + CLI_REGION: ap-northeast-1 depend-on: - publish_to_local_registry - identifier: rds_mysql_auth_iam_apikey_lambda_subscription @@ -398,7 +407,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/rds-mysql-auth-iam-apikey-lambda-subscription.test.ts - CLI_REGION: ap-northeast-1 + CLI_REGION: us-west-1 depend-on: - publish_to_local_registry - identifier: rds_mysql_auth_iam @@ -407,7 +416,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/rds-mysql-auth-iam.test.ts - CLI_REGION: us-west-1 + CLI_REGION: eu-south-1 depend-on: - publish_to_local_registry - identifier: rds_mysql_custom_claims_refersto_auth @@ -416,429 +425,1094 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/rds-mysql-custom-claims-refersto-auth.test.ts - CLI_REGION: eu-south-1 - depend-on: - - publish_to_local_registry - - identifier: rds_mysql_model_v2 - buildspec: codebuild_specs/run_e2e_tests.yml - env: - compute-type: BUILD_GENERAL1_SMALL - variables: - TEST_SUITE: src/__tests__/rds-mysql-model-v2.test.ts CLI_REGION: ap-east-1 depend-on: - publish_to_local_registry - - identifier: rds_mysql_multi_auth_1 + - identifier: rds_mysql_model_v2ap_northeast_2 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-mysql-multi-auth-1.test.ts + TEST_SUITE: src/__tests__/rds-mysql-model-v2.test.ts CLI_REGION: ap-northeast-2 depend-on: - publish_to_local_registry - - identifier: rds_mysql_oidc_auth + - identifier: rds_mysql_model_v2ap_south_1 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-mysql-oidc-auth.test.ts + TEST_SUITE: src/__tests__/rds-mysql-model-v2.test.ts CLI_REGION: ap-south-1 depend-on: - publish_to_local_registry - - identifier: rds_mysql_refers_to_fields + - identifier: rds_mysql_model_v2us_east_2 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-mysql-refers-to-fields.test.ts + TEST_SUITE: src/__tests__/rds-mysql-model-v2.test.ts CLI_REGION: us-east-2 depend-on: - publish_to_local_registry - - identifier: rds_mysql_refers_to + - identifier: rds_mysql_model_v2eu_central_1 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-mysql-refers-to.test.ts + TEST_SUITE: src/__tests__/rds-mysql-model-v2.test.ts CLI_REGION: eu-central-1 depend-on: - publish_to_local_registry - - identifier: rds_mysql_userpool_auth + - identifier: rds_mysql_model_v2ap_southeast_2 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-mysql-userpool-auth.test.ts + TEST_SUITE: src/__tests__/rds-mysql-model-v2.test.ts CLI_REGION: ap-southeast-2 depend-on: - publish_to_local_registry - - identifier: rds_mysql_v2_generate_schema + - identifier: rds_mysql_model_v2eu_west_2 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-mysql-v2-generate-schema.test.ts + TEST_SUITE: src/__tests__/rds-mysql-model-v2.test.ts CLI_REGION: eu-west-2 depend-on: - publish_to_local_registry - - identifier: rds_pg_array_objects + - identifier: rds_mysql_model_v2us_west_2 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-pg-array-objects.test.ts + TEST_SUITE: src/__tests__/rds-mysql-model-v2.test.ts CLI_REGION: us-west-2 depend-on: - publish_to_local_registry - - identifier: rds_pg_auth_apikey_lambda + - identifier: rds_mysql_model_v2ap_southeast_1 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-pg-auth-apikey-lambda.test.ts + TEST_SUITE: src/__tests__/rds-mysql-model-v2.test.ts CLI_REGION: ap-southeast-1 depend-on: - publish_to_local_registry - - identifier: rds_pg_auth_iam_apikey_lambda_subscription + - identifier: rds_mysql_model_v2ca_central_1 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-pg-auth-iam-apikey-lambda-subscription.test.ts + TEST_SUITE: src/__tests__/rds-mysql-model-v2.test.ts CLI_REGION: ca-central-1 depend-on: - publish_to_local_registry - - identifier: rds_pg_auth_iam + - identifier: rds_mysql_model_v2eu_north_1 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-pg-auth-iam.test.ts + TEST_SUITE: src/__tests__/rds-mysql-model-v2.test.ts CLI_REGION: eu-north-1 depend-on: - publish_to_local_registry - - identifier: rds_pg_custom_claims_refersto_auth + - identifier: rds_mysql_model_v2me_south_1 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-pg-custom-claims-refersto-auth.test.ts + TEST_SUITE: src/__tests__/rds-mysql-model-v2.test.ts CLI_REGION: me-south-1 depend-on: - publish_to_local_registry - - identifier: rds_pg_import + - identifier: rds_mysql_model_v2eu_west_3 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-pg-import.test.ts + TEST_SUITE: src/__tests__/rds-mysql-model-v2.test.ts CLI_REGION: eu-west-3 depend-on: - publish_to_local_registry - - identifier: rds_pg_model_v2 + - identifier: rds_mysql_model_v2eu_west_1 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-pg-model-v2.test.ts + TEST_SUITE: src/__tests__/rds-mysql-model-v2.test.ts CLI_REGION: eu-west-1 depend-on: - publish_to_local_registry - - identifier: rds_pg_oidc_auth + - identifier: rds_mysql_model_v2sa_east_1 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-pg-oidc-auth.test.ts + TEST_SUITE: src/__tests__/rds-mysql-model-v2.test.ts CLI_REGION: sa-east-1 depend-on: - publish_to_local_registry - - identifier: rds_pg_refers_to_fields + - identifier: rds_mysql_model_v2us_east_1 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-pg-refers-to-fields.test.ts + TEST_SUITE: src/__tests__/rds-mysql-model-v2.test.ts CLI_REGION: us-east-1 depend-on: - publish_to_local_registry - - identifier: rds_pg_refers_to + - identifier: rds_mysql_model_v2ap_northeast_1 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-pg-refers-to.test.ts + TEST_SUITE: src/__tests__/rds-mysql-model-v2.test.ts CLI_REGION: ap-northeast-1 depend-on: - publish_to_local_registry - - identifier: rds_pg_relational_directives + - identifier: rds_mysql_model_v2us_west_1 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-pg-relational-directives.test.ts + TEST_SUITE: src/__tests__/rds-mysql-model-v2.test.ts CLI_REGION: us-west-1 depend-on: - publish_to_local_registry - - identifier: rds_pg_userpool_auth + - identifier: rds_mysql_model_v2eu_south_1 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-pg-userpool-auth.test.ts + TEST_SUITE: src/__tests__/rds-mysql-model-v2.test.ts CLI_REGION: eu-south-1 depend-on: - publish_to_local_registry - - identifier: rds_pg_v2_generate_schema + - identifier: rds_mysql_model_v2ap_east_1 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-pg-v2-generate-schema.test.ts + TEST_SUITE: src/__tests__/rds-mysql-model-v2.test.ts CLI_REGION: ap-east-1 depend-on: - publish_to_local_registry - - identifier: rds_relational_directives + - identifier: rds_mysql_multi_auth_1 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-relational-directives.test.ts + TEST_SUITE: src/__tests__/rds-mysql-multi-auth-1.test.ts CLI_REGION: ap-northeast-2 depend-on: - publish_to_local_registry - - identifier: rds_v2_test_utils + - identifier: rds_mysql_oidc_auth buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-v2-test-utils.test.ts + TEST_SUITE: src/__tests__/rds-mysql-oidc-auth.test.ts CLI_REGION: ap-south-1 depend-on: - publish_to_local_registry - - identifier: schema_model + - identifier: rds_mysql_refers_to_fields buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/schema-model.test.ts + TEST_SUITE: src/__tests__/rds-mysql-refers-to-fields.test.ts CLI_REGION: us-east-2 depend-on: - publish_to_local_registry - - identifier: apigw + - identifier: rds_mysql_refers_to buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/apigw.test.ts + TEST_SUITE: src/__tests__/rds-mysql-refers-to.test.ts CLI_REGION: eu-central-1 depend-on: - publish_to_local_registry - - identifier: containers_api_2 + - identifier: rds_mysql_userpool_auth buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/containers-api-2.test.ts - CLI_REGION: us-east-1 + TEST_SUITE: src/__tests__/rds-mysql-userpool-auth.test.ts + CLI_REGION: ap-southeast-2 depend-on: - publish_to_local_registry - - identifier: schema_auth_14 + - identifier: rds_mysql_v2_generate_schema buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/schema-auth-14.test.ts + TEST_SUITE: src/__tests__/rds-mysql-v2-generate-schema.test.ts CLI_REGION: eu-west-2 depend-on: - publish_to_local_registry - - identifier: schema_auth_7 + - identifier: rds_pg_array_objects buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/schema-auth-7.test.ts + TEST_SUITE: src/__tests__/rds-pg-array-objects.test.ts CLI_REGION: us-west-2 depend-on: - publish_to_local_registry - - identifier: schema_auth_9 + - identifier: rds_pg_auth_apikey_lambda buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/schema-auth-9.test.ts + TEST_SUITE: src/__tests__/rds-pg-auth-apikey-lambda.test.ts CLI_REGION: ap-southeast-1 depend-on: - publish_to_local_registry - - identifier: schema_auth_5 + - identifier: rds_pg_auth_iam_apikey_lambda_subscription buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/schema-auth-5.test.ts + TEST_SUITE: src/__tests__/rds-pg-auth-iam-apikey-lambda-subscription.test.ts + CLI_REGION: ca-central-1 + depend-on: + - publish_to_local_registry + - identifier: rds_pg_auth_iam + buildspec: codebuild_specs/run_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/rds-pg-auth-iam.test.ts CLI_REGION: eu-north-1 depend-on: - publish_to_local_registry - - identifier: searchable_datastore + - identifier: rds_pg_custom_claims_refersto_auth buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/graphql-v2/searchable-datastore.test.ts + TEST_SUITE: src/__tests__/rds-pg-custom-claims-refersto-auth.test.ts CLI_REGION: me-south-1 - USE_PARENT_ACCOUNT: 1 depend-on: - publish_to_local_registry - - identifier: schema_iterative_update_4 + - identifier: rds_pg_import buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/schema-iterative-update-4.test.ts + TEST_SUITE: src/__tests__/rds-pg-import.test.ts CLI_REGION: eu-west-3 depend-on: - publish_to_local_registry - - identifier: schema_searchable + - identifier: rds_pg_model_v2ap_northeast_2 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/schema-searchable.test.ts - CLI_REGION: eu-west-1 - USE_PARENT_ACCOUNT: 1 + TEST_SUITE: src/__tests__/rds-pg-model-v2.test.ts + CLI_REGION: ap-northeast-2 depend-on: - publish_to_local_registry - - identifier: schema_auth_6 + - identifier: rds_pg_model_v2ap_south_1 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/schema-auth-6.test.ts - CLI_REGION: sa-east-1 + TEST_SUITE: src/__tests__/rds-pg-model-v2.test.ts + CLI_REGION: ap-south-1 depend-on: - publish_to_local_registry - - identifier: schema_connection + - identifier: rds_pg_model_v2us_east_2 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/schema-connection.test.ts - CLI_REGION: us-east-1 + TEST_SUITE: src/__tests__/rds-pg-model-v2.test.ts + CLI_REGION: us-east-2 depend-on: - publish_to_local_registry - - identifier: searchable_previous_deployment_had_node_to_node + - identifier: rds_pg_model_v2eu_central_1 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: >- - src/__tests__/graphql-v2/searchable-node-to-node-encryption/searchable-previous-deployment-had-node-to-node.test.ts - CLI_REGION: ap-northeast-1 + TEST_SUITE: src/__tests__/rds-pg-model-v2.test.ts + CLI_REGION: eu-central-1 depend-on: - publish_to_local_registry - - identifier: searchable_previous_deployment_no_node_to_node + - identifier: rds_pg_model_v2ap_southeast_2 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: >- - src/__tests__/graphql-v2/searchable-node-to-node-encryption/searchable-previous-deployment-no-node-to-node.test.ts - CLI_REGION: us-west-1 + TEST_SUITE: src/__tests__/rds-pg-model-v2.test.ts + CLI_REGION: ap-southeast-2 depend-on: - publish_to_local_registry - - identifier: api_2 + - identifier: rds_pg_model_v2eu_west_2 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/api_2.test.ts - CLI_REGION: ap-east-1 + TEST_SUITE: src/__tests__/rds-pg-model-v2.test.ts + CLI_REGION: eu-west-2 depend-on: - publish_to_local_registry - - identifier: searchable_migration + - identifier: rds_pg_model_v2us_west_2 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/transformer-migrations/searchable-migration.test.ts - CLI_REGION: ap-northeast-2 - USE_PARENT_ACCOUNT: 1 + TEST_SUITE: src/__tests__/rds-pg-model-v2.test.ts + CLI_REGION: us-west-2 depend-on: - publish_to_local_registry - - identifier: add_resources_admin_role_all_auth_modes_amplify_table_1 - buildspec: codebuild_specs/run_cdk_tests.yml + - identifier: rds_pg_model_v2ap_southeast_1 + buildspec: codebuild_specs/run_e2e_tests.yml env: - compute-type: BUILD_GENERAL1_MEDIUM + compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: >- - src/__tests__/add-resources.test.ts|src/__tests__/admin-role.test.ts|src/__tests__/all-auth-modes.test.ts|src/__tests__/amplify-table-1.test.ts - CLI_REGION: ap-northeast-2 + TEST_SUITE: src/__tests__/rds-pg-model-v2.test.ts + CLI_REGION: ap-southeast-1 depend-on: - publish_to_local_registry - - identifier: amplify_table_2_base_cdk_custom_logic_data_construct - buildspec: codebuild_specs/run_cdk_tests.yml + - identifier: rds_pg_model_v2ca_central_1 + buildspec: codebuild_specs/run_e2e_tests.yml env: - compute-type: BUILD_GENERAL1_MEDIUM + compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: >- - src/__tests__/amplify-table-2.test.ts|src/__tests__/base-cdk.test.ts|src/__tests__/custom-logic.test.ts|src/__tests__/data-construct.test.ts - CLI_REGION: ap-south-1 + TEST_SUITE: src/__tests__/rds-pg-model-v2.test.ts + CLI_REGION: ca-central-1 depend-on: - publish_to_local_registry - - identifier: >- - 3_gsis_10k_records_3_gsis_1k_records_3_gsis_empty_table_3_gsis_single_record - buildspec: codebuild_specs/run_cdk_tests.yml + - identifier: rds_pg_model_v2eu_north_1 + buildspec: codebuild_specs/run_e2e_tests.yml env: - compute-type: BUILD_GENERAL1_MEDIUM + compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: >- - src/__tests__/deploy-velocity-temporarily-disabled/3-gsis-10k-records.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/3-gsis-1k-records.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/3-gsis-empty-table.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/3-gsis-single-record.test.ts - CLI_REGION: us-east-2 + TEST_SUITE: src/__tests__/rds-pg-model-v2.test.ts + CLI_REGION: eu-north-1 depend-on: - publish_to_local_registry - - identifier: >- - replace_2_gsis_10k_records_replace_2_gsis_1k_records_replace_2_gsis_empty_table_replace_2_gsis_single_record - buildspec: codebuild_specs/run_cdk_tests.yml + - identifier: rds_pg_model_v2me_south_1 + buildspec: codebuild_specs/run_e2e_tests.yml env: - compute-type: BUILD_GENERAL1_MEDIUM + compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: >- - src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-10k-records.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-1k-records.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-empty-table.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-single-record.test.ts - CLI_REGION: eu-central-1 + TEST_SUITE: src/__tests__/rds-pg-model-v2.test.ts + CLI_REGION: me-south-1 depend-on: - publish_to_local_registry - - identifier: >- - replace_2_gsis_update_attr_10k_records_replace_2_gsis_update_attr_1k_records_replace_2_gsis_update_attr_empty_table_replace_2_g - buildspec: codebuild_specs/run_cdk_tests.yml + - identifier: rds_pg_model_v2eu_west_3 + buildspec: codebuild_specs/run_e2e_tests.yml env: - compute-type: BUILD_GENERAL1_MEDIUM + compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: >- - src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-update-attr-10k-records.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-update-attr-1k-records.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-update-attr-empty-table.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-update-attr-single-record.test.ts - CLI_REGION: ap-southeast-2 - depend-on: + TEST_SUITE: src/__tests__/rds-pg-model-v2.test.ts + CLI_REGION: eu-west-3 + depend-on: + - publish_to_local_registry + - identifier: rds_pg_model_v2eu_west_1 + buildspec: codebuild_specs/run_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/rds-pg-model-v2.test.ts + CLI_REGION: eu-west-1 + depend-on: + - publish_to_local_registry + - identifier: rds_pg_model_v2sa_east_1 + buildspec: codebuild_specs/run_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/rds-pg-model-v2.test.ts + CLI_REGION: sa-east-1 + depend-on: + - publish_to_local_registry + - identifier: rds_pg_model_v2us_east_1 + buildspec: codebuild_specs/run_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/rds-pg-model-v2.test.ts + CLI_REGION: us-east-1 + depend-on: + - publish_to_local_registry + - identifier: rds_pg_model_v2ap_northeast_1 + buildspec: codebuild_specs/run_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/rds-pg-model-v2.test.ts + CLI_REGION: ap-northeast-1 + depend-on: + - publish_to_local_registry + - identifier: rds_pg_model_v2us_west_1 + buildspec: codebuild_specs/run_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/rds-pg-model-v2.test.ts + CLI_REGION: us-west-1 + depend-on: + - publish_to_local_registry + - identifier: rds_pg_model_v2eu_south_1 + buildspec: codebuild_specs/run_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/rds-pg-model-v2.test.ts + CLI_REGION: eu-south-1 + depend-on: + - publish_to_local_registry + - identifier: rds_pg_model_v2ap_east_1 + buildspec: codebuild_specs/run_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/rds-pg-model-v2.test.ts + CLI_REGION: ap-east-1 + depend-on: + - publish_to_local_registry + - identifier: rds_pg_oidc_auth + buildspec: codebuild_specs/run_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/rds-pg-oidc-auth.test.ts + CLI_REGION: eu-west-1 + depend-on: + - publish_to_local_registry + - identifier: rds_pg_refers_to_fields + buildspec: codebuild_specs/run_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/rds-pg-refers-to-fields.test.ts + CLI_REGION: sa-east-1 + depend-on: + - publish_to_local_registry + - identifier: rds_pg_refers_to + buildspec: codebuild_specs/run_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/rds-pg-refers-to.test.ts + CLI_REGION: us-east-1 + depend-on: + - publish_to_local_registry + - identifier: rds_pg_relational_directives + buildspec: codebuild_specs/run_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/rds-pg-relational-directives.test.ts + CLI_REGION: ap-northeast-1 + depend-on: + - publish_to_local_registry + - identifier: rds_pg_userpool_auth + buildspec: codebuild_specs/run_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/rds-pg-userpool-auth.test.ts + CLI_REGION: us-west-1 + depend-on: + - publish_to_local_registry + - identifier: rds_pg_v2_generate_schema + buildspec: codebuild_specs/run_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/rds-pg-v2-generate-schema.test.ts + CLI_REGION: eu-south-1 + depend-on: + - publish_to_local_registry + - identifier: rds_relational_directives + buildspec: codebuild_specs/run_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/rds-relational-directives.test.ts + CLI_REGION: ap-east-1 + depend-on: + - publish_to_local_registry + - identifier: rds_v2_test_utils + buildspec: codebuild_specs/run_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/rds-v2-test-utils.test.ts + CLI_REGION: ap-northeast-2 + depend-on: + - publish_to_local_registry + - identifier: schema_model + buildspec: codebuild_specs/run_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/schema-model.test.ts + CLI_REGION: ap-south-1 + depend-on: + - publish_to_local_registry + - identifier: apigw + buildspec: codebuild_specs/run_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/apigw.test.ts + CLI_REGION: us-east-2 + depend-on: + - publish_to_local_registry + - identifier: containers_api_2 + buildspec: codebuild_specs/run_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/containers-api-2.test.ts + CLI_REGION: us-east-1 + depend-on: + - publish_to_local_registry + - identifier: schema_auth_14 + buildspec: codebuild_specs/run_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/schema-auth-14.test.ts + CLI_REGION: ap-southeast-2 + depend-on: + - publish_to_local_registry + - identifier: schema_auth_7 + buildspec: codebuild_specs/run_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/schema-auth-7.test.ts + CLI_REGION: eu-west-2 + depend-on: + - publish_to_local_registry + - identifier: schema_auth_9 + buildspec: codebuild_specs/run_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/schema-auth-9.test.ts + CLI_REGION: us-west-2 + depend-on: + - publish_to_local_registry + - identifier: api_1ap_northeast_2 + buildspec: codebuild_specs/run_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/api_1.test.ts + CLI_REGION: ap-northeast-2 + depend-on: + - publish_to_local_registry + - identifier: api_1ap_south_1 + buildspec: codebuild_specs/run_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/api_1.test.ts + CLI_REGION: ap-south-1 + depend-on: + - publish_to_local_registry + - identifier: api_1us_east_2 + buildspec: codebuild_specs/run_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/api_1.test.ts + CLI_REGION: us-east-2 + depend-on: + - publish_to_local_registry + - identifier: api_1eu_central_1 + buildspec: codebuild_specs/run_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/api_1.test.ts + CLI_REGION: eu-central-1 + depend-on: + - publish_to_local_registry + - identifier: api_1ap_southeast_2 + buildspec: codebuild_specs/run_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/api_1.test.ts + CLI_REGION: ap-southeast-2 + depend-on: + - publish_to_local_registry + - identifier: api_1eu_west_2 + buildspec: codebuild_specs/run_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/api_1.test.ts + CLI_REGION: eu-west-2 + depend-on: + - publish_to_local_registry + - identifier: api_1us_west_2 + buildspec: codebuild_specs/run_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/api_1.test.ts + CLI_REGION: us-west-2 + depend-on: + - publish_to_local_registry + - identifier: api_1ap_southeast_1 + buildspec: codebuild_specs/run_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/api_1.test.ts + CLI_REGION: ap-southeast-1 + depend-on: + - publish_to_local_registry + - identifier: api_1ca_central_1 + buildspec: codebuild_specs/run_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/api_1.test.ts + CLI_REGION: ca-central-1 + depend-on: + - publish_to_local_registry + - identifier: api_1eu_north_1 + buildspec: codebuild_specs/run_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/api_1.test.ts + CLI_REGION: eu-north-1 + depend-on: + - publish_to_local_registry + - identifier: api_1me_south_1 + buildspec: codebuild_specs/run_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/api_1.test.ts + CLI_REGION: me-south-1 + depend-on: + - publish_to_local_registry + - identifier: api_1eu_west_3 + buildspec: codebuild_specs/run_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/api_1.test.ts + CLI_REGION: eu-west-3 + depend-on: + - publish_to_local_registry + - identifier: api_1eu_west_1 + buildspec: codebuild_specs/run_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/api_1.test.ts + CLI_REGION: eu-west-1 + depend-on: + - publish_to_local_registry + - identifier: api_1sa_east_1 + buildspec: codebuild_specs/run_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/api_1.test.ts + CLI_REGION: sa-east-1 + depend-on: + - publish_to_local_registry + - identifier: api_1us_east_1 + buildspec: codebuild_specs/run_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/api_1.test.ts + CLI_REGION: us-east-1 + depend-on: + - publish_to_local_registry + - identifier: api_1ap_northeast_1 + buildspec: codebuild_specs/run_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/api_1.test.ts + CLI_REGION: ap-northeast-1 + depend-on: + - publish_to_local_registry + - identifier: api_1us_west_1 + buildspec: codebuild_specs/run_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/api_1.test.ts + CLI_REGION: us-west-1 + depend-on: + - publish_to_local_registry + - identifier: api_1eu_south_1 + buildspec: codebuild_specs/run_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/api_1.test.ts + CLI_REGION: eu-south-1 + depend-on: + - publish_to_local_registry + - identifier: api_1ap_east_1 + buildspec: codebuild_specs/run_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/api_1.test.ts + CLI_REGION: ap-east-1 + depend-on: + - publish_to_local_registry + - identifier: schema_auth_5 + buildspec: codebuild_specs/run_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/schema-auth-5.test.ts + CLI_REGION: ap-southeast-1 + depend-on: + - publish_to_local_registry + - identifier: searchable_datastore + buildspec: codebuild_specs/run_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/graphql-v2/searchable-datastore.test.ts + CLI_REGION: ca-central-1 + USE_PARENT_ACCOUNT: 1 + depend-on: + - publish_to_local_registry + - identifier: schema_iterative_update_4 + buildspec: codebuild_specs/run_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/schema-iterative-update-4.test.ts + CLI_REGION: eu-north-1 + depend-on: + - publish_to_local_registry + - identifier: schema_searchable + buildspec: codebuild_specs/run_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/schema-searchable.test.ts + CLI_REGION: me-south-1 + USE_PARENT_ACCOUNT: 1 + depend-on: + - publish_to_local_registry + - identifier: schema_auth_6 + buildspec: codebuild_specs/run_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/schema-auth-6.test.ts + CLI_REGION: eu-west-1 + depend-on: + - publish_to_local_registry + - identifier: schema_connection + buildspec: codebuild_specs/run_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/schema-connection.test.ts + CLI_REGION: sa-east-1 + depend-on: + - publish_to_local_registry + - identifier: searchable_previous_deployment_had_node_to_node + buildspec: codebuild_specs/run_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: >- + src/__tests__/graphql-v2/searchable-node-to-node-encryption/searchable-previous-deployment-had-node-to-node.test.ts + CLI_REGION: us-east-1 + depend-on: + - publish_to_local_registry + - identifier: searchable_previous_deployment_no_node_to_node + buildspec: codebuild_specs/run_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: >- + src/__tests__/graphql-v2/searchable-node-to-node-encryption/searchable-previous-deployment-no-node-to-node.test.ts + CLI_REGION: ap-northeast-1 + depend-on: + - publish_to_local_registry + - identifier: api_2 + buildspec: codebuild_specs/run_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/api_2.test.ts + CLI_REGION: us-west-1 + depend-on: + - publish_to_local_registry + - identifier: searchable_migration + buildspec: codebuild_specs/run_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/transformer-migrations/searchable-migration.test.ts + CLI_REGION: eu-south-1 + USE_PARENT_ACCOUNT: 1 + depend-on: + - publish_to_local_registry + - identifier: add_resources_admin_role_all_auth_modes_amplify_table_2 + buildspec: codebuild_specs/run_cdk_tests.yml + env: + compute-type: BUILD_GENERAL1_MEDIUM + variables: + TEST_SUITE: >- + src/__tests__/add-resources.test.ts|src/__tests__/admin-role.test.ts|src/__tests__/all-auth-modes.test.ts|src/__tests__/amplify-table-2.test.ts + CLI_REGION: ap-northeast-2 + depend-on: + - publish_to_local_registry + - identifier: custom_logic_data_construct_3_gsis_10k_records_3_gsis_1k_records + buildspec: codebuild_specs/run_cdk_tests.yml + env: + compute-type: BUILD_GENERAL1_MEDIUM + variables: + TEST_SUITE: >- + src/__tests__/custom-logic.test.ts|src/__tests__/data-construct.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/3-gsis-10k-records.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/3-gsis-1k-records.test.ts + CLI_REGION: us-east-2 + depend-on: + - publish_to_local_registry + - identifier: >- + 3_gsis_empty_table_3_gsis_single_record_replace_2_gsis_10k_records_replace_2_gsis_1k_records + buildspec: codebuild_specs/run_cdk_tests.yml + env: + compute-type: BUILD_GENERAL1_MEDIUM + variables: + TEST_SUITE: >- + src/__tests__/deploy-velocity-temporarily-disabled/3-gsis-empty-table.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/3-gsis-single-record.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-10k-records.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-1k-records.test.ts + CLI_REGION: eu-central-1 + depend-on: + - publish_to_local_registry + - identifier: >- + replace_2_gsis_empty_table_replace_2_gsis_single_record_replace_2_gsis_update_attr_10k_records_replace_2_gsis_update_attr_1k_re + buildspec: codebuild_specs/run_cdk_tests.yml + env: + compute-type: BUILD_GENERAL1_MEDIUM + variables: + TEST_SUITE: >- + src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-empty-table.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-single-record.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-update-attr-10k-records.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-update-attr-1k-records.test.ts + CLI_REGION: ap-southeast-2 + depend-on: - publish_to_local_registry - identifier: >- - single_gsi_10k_records_single_gsi_1k_records_single_gsi_empty_table_single_gsi_single_record + replace_2_gsis_update_attr_empty_table_replace_2_gsis_update_attr_single_record_single_gsi_10k_records_single_gsi_1k_records buildspec: codebuild_specs/run_cdk_tests.yml env: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: >- - src/__tests__/deploy-velocity-temporarily-disabled/single-gsi-10k-records.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/single-gsi-1k-records.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/single-gsi-empty-table.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/single-gsi-single-record.test.ts + src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-update-attr-empty-table.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-update-attr-single-record.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/single-gsi-10k-records.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/single-gsi-1k-records.test.ts CLI_REGION: eu-west-2 depend-on: - publish_to_local_registry - - identifier: relationships_sql_models + - identifier: single_gsi_empty_table_single_gsi_single_record_relationships_sql_models buildspec: codebuild_specs/run_cdk_tests.yml env: compute-type: BUILD_GENERAL1_MEDIUM variables: - TEST_SUITE: src/__tests__/relationships.test.ts|src/__tests__/sql-models.test.ts + TEST_SUITE: >- + src/__tests__/deploy-velocity-temporarily-disabled/single-gsi-empty-table.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/single-gsi-single-record.test.ts|src/__tests__/relationships.test.ts|src/__tests__/sql-models.test.ts + CLI_REGION: us-west-2 + depend-on: + - publish_to_local_registry + - identifier: amplify_table_1 + buildspec: codebuild_specs/run_cdk_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/amplify-table-1.test.ts + CLI_REGION: ap-south-1 + depend-on: + - publish_to_local_registry + - identifier: base_cdkap_northeast_2 + buildspec: codebuild_specs/run_cdk_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/base-cdk.test.ts + CLI_REGION: ap-northeast-2 + depend-on: + - publish_to_local_registry + - identifier: base_cdkap_south_1 + buildspec: codebuild_specs/run_cdk_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/base-cdk.test.ts + CLI_REGION: ap-south-1 + depend-on: + - publish_to_local_registry + - identifier: base_cdkus_east_2 + buildspec: codebuild_specs/run_cdk_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/base-cdk.test.ts + CLI_REGION: us-east-2 + depend-on: + - publish_to_local_registry + - identifier: base_cdkeu_central_1 + buildspec: codebuild_specs/run_cdk_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/base-cdk.test.ts + CLI_REGION: eu-central-1 + depend-on: + - publish_to_local_registry + - identifier: base_cdkap_southeast_2 + buildspec: codebuild_specs/run_cdk_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/base-cdk.test.ts + CLI_REGION: ap-southeast-2 + depend-on: + - publish_to_local_registry + - identifier: base_cdkeu_west_2 + buildspec: codebuild_specs/run_cdk_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/base-cdk.test.ts + CLI_REGION: eu-west-2 + depend-on: + - publish_to_local_registry + - identifier: base_cdkus_west_2 + buildspec: codebuild_specs/run_cdk_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/base-cdk.test.ts CLI_REGION: us-west-2 depend-on: - publish_to_local_registry + - identifier: base_cdkap_southeast_1 + buildspec: codebuild_specs/run_cdk_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/base-cdk.test.ts + CLI_REGION: ap-southeast-1 + depend-on: + - publish_to_local_registry + - identifier: base_cdkca_central_1 + buildspec: codebuild_specs/run_cdk_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/base-cdk.test.ts + CLI_REGION: ca-central-1 + depend-on: + - publish_to_local_registry + - identifier: base_cdkeu_north_1 + buildspec: codebuild_specs/run_cdk_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/base-cdk.test.ts + CLI_REGION: eu-north-1 + depend-on: + - publish_to_local_registry + - identifier: base_cdkme_south_1 + buildspec: codebuild_specs/run_cdk_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/base-cdk.test.ts + CLI_REGION: me-south-1 + depend-on: + - publish_to_local_registry + - identifier: base_cdkeu_west_3 + buildspec: codebuild_specs/run_cdk_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/base-cdk.test.ts + CLI_REGION: eu-west-3 + depend-on: + - publish_to_local_registry + - identifier: base_cdkeu_west_1 + buildspec: codebuild_specs/run_cdk_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/base-cdk.test.ts + CLI_REGION: eu-west-1 + depend-on: + - publish_to_local_registry + - identifier: base_cdksa_east_1 + buildspec: codebuild_specs/run_cdk_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/base-cdk.test.ts + CLI_REGION: sa-east-1 + depend-on: + - publish_to_local_registry + - identifier: base_cdkus_east_1 + buildspec: codebuild_specs/run_cdk_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/base-cdk.test.ts + CLI_REGION: us-east-1 + depend-on: + - publish_to_local_registry + - identifier: base_cdkap_northeast_1 + buildspec: codebuild_specs/run_cdk_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/base-cdk.test.ts + CLI_REGION: ap-northeast-1 + depend-on: + - publish_to_local_registry + - identifier: base_cdkus_west_1 + buildspec: codebuild_specs/run_cdk_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/base-cdk.test.ts + CLI_REGION: us-west-1 + depend-on: + - publish_to_local_registry + - identifier: base_cdkeu_south_1 + buildspec: codebuild_specs/run_cdk_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/base-cdk.test.ts + CLI_REGION: eu-south-1 + depend-on: + - publish_to_local_registry + - identifier: base_cdkap_east_1 + buildspec: codebuild_specs/run_cdk_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/base-cdk.test.ts + CLI_REGION: ap-east-1 + depend-on: + - publish_to_local_registry - identifier: 3_gsis_100k_records buildspec: codebuild_specs/run_cdk_tests.yml env: diff --git a/scripts/split-e2e-tests.ts b/scripts/split-e2e-tests.ts index fc65cd89e9..663af0c579 100644 --- a/scripts/split-e2e-tests.ts +++ b/scripts/split-e2e-tests.ts @@ -129,14 +129,27 @@ const RUN_SOLO: (string | RegExp)[] = [ 'src/__tests__/transformer-migrations/model-migration.test.ts', 'src/__tests__/graphql-v2/searchable-node-to-node-encryption/searchable-previous-deployment-no-node-to-node.test.ts', 'src/__tests__/graphql-v2/searchable-node-to-node-encryption/searchable-previous-deployment-had-node-to-node.test.ts', + /src\/__tests__\/api_1.*\.test\.ts/, // GraphQL E2E tests 'src/__tests__/FunctionTransformerTestsV2.e2e.test.ts', 'src/__tests__/HttpTransformer.e2e.test.ts', 'src/__tests__/HttpTransformerV2.e2e.test.ts', // Deploy Velocity tests /src\/__tests__\/deploy-velocity\/.*\.test\.ts/, - // RDS tests + // SQL tests /src\/__tests__\/rds-.*\.test\.ts/, + // CDK tests + /src\/__tests__\/base-cdk.*\.test\.ts/, + 'src/__tests__/amplify-table-1.test.ts', +]; + +const RUN_IN_ALL_REGIONS = [ + // SQL tests one per supported engines + /src\/__tests__\/rds-.*-model-v2\.test\.ts/, + // DDB tests + 'src/__tests__/api_1.test.ts', + // CDK tests + 'src/__tests__/base-cdk.test.ts', ]; const DEBUG_FLAG = '--debug'; @@ -165,10 +178,12 @@ const createJob = (os: OSType, jobIdx: number, runSolo = false): CandidateJob => runSolo, }); -const getTestNameFromPath = (testSuitePath: string): string => { +const getTestNameFromPath = (testSuitePath: string, region?: string): string => { const startIndex = testSuitePath.lastIndexOf('/') + 1; const endIndex = testSuitePath.lastIndexOf('.test'); - return testSuitePath.substring(startIndex, endIndex).split('.e2e').join('').split('.').join('-'); + const regionSuffix = + RUN_IN_ALL_REGIONS.find((allRegions) => testSuitePath === allRegions || testSuitePath.match(allRegions)) && region ? region : ''; + return testSuitePath.substring(startIndex, endIndex).split('.e2e').join('').split('.').join('-').concat(regionSuffix); }; const splitTests = (baseJobLinux: any, testDirectory: string, pickTests?: (testSuites: string[]) => string[]): BatchBuildJob[] => { @@ -203,6 +218,16 @@ const splitTests = (baseJobLinux: any, testDirectory: string, pickTests?: (testS const USE_PARENT = USE_PARENT_ACCOUNT.some((usesParent) => test.startsWith(usesParent)); if (RUN_SOLO.find((solo) => test === solo || test.match(solo))) { + if (RUN_IN_ALL_REGIONS.find((allRegions) => test === allRegions || test.match(allRegions))) { + AWS_REGIONS_TO_RUN_TESTS.forEach((region) => { + const newSoloJob = createJob(os, jobIdx, true); + jobIdx++; + newSoloJob.tests.push(test); + newSoloJob.region = region; + soloJobs.push(newSoloJob); + }); + continue; + } const newSoloJob = createJob(os, jobIdx, true); jobIdx++; newSoloJob.tests.push(test); @@ -238,7 +263,7 @@ const splitTests = (baseJobLinux: any, testDirectory: string, pickTests?: (testS const result: any[] = []; linuxJobs.forEach((j) => { if (j.tests.length !== 0) { - const names = j.tests.map((tn) => getTestNameFromPath(tn)).join('_'); + const names = j.tests.map((tn) => getTestNameFromPath(tn, j.region)).join('_'); const tmp = { ...JSON.parse(JSON.stringify(baseJobLinux)), // deep clone base job identifier: getIdentifier(names), From 8255eebfee40c176f3a228f89f11ea7e41128178 Mon Sep 17 00:00:00 2001 From: phani-srikar Date: Wed, 7 Feb 2024 16:20:56 -0800 Subject: [PATCH 17/45] chore: check bootstrap before cdk deploy --- .../src/commands.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/amplify-graphql-api-construct-tests/src/commands.ts b/packages/amplify-graphql-api-construct-tests/src/commands.ts index c7e671e688..f75d99cb27 100644 --- a/packages/amplify-graphql-api-construct-tests/src/commands.ts +++ b/packages/amplify-graphql-api-construct-tests/src/commands.ts @@ -87,13 +87,18 @@ export const cdkDeploy = async (cwd: string, option: string, props?: CdkDeployPr // The CodegenAssets BucketDeployment resource takes a while. Set the timeout to 10m account for that. (Note that this is the "no output // timeout"--the overall deployment is still allowed to take longer than 10m) const noOutputTimeout = props?.timeoutMs ?? 10 * 60 * 1000; - await spawn(getNpxPath(), ['cdk', 'deploy', '--outputs-file', 'outputs.json', '--require-approval', 'never', option], { + const commandOptions = { cwd, stripColors: true, // npx cdk does not work on verdaccio env: { npm_config_registry: 'https://registry.npmjs.org/' }, - noOutputTimeout: noOutputTimeout, - }).runAsync(); + noOutputTimeout, + }; + // This prevents us from maintaining a separate CDK account bootstrap process as we add support for new accounts, regions. + // Checks and succeeds early (a no-op) if the account-region combination is already bootstrapped. + await spawn(getNpxPath(), ['cdk', 'bootstrap'], commandOptions).runAsync(); + + await spawn(getNpxPath(), ['cdk', 'deploy', '--outputs-file', 'outputs.json', '--require-approval', 'never', option], commandOptions).runAsync(); return JSON.parse(readFileSync(path.join(cwd, 'outputs.json'), 'utf8')); }; From 1a04aa70dec5c105d0801e74ba6ad3061ca63006 Mon Sep 17 00:00:00 2001 From: phani-srikar Date: Thu, 8 Feb 2024 16:40:41 -0800 Subject: [PATCH 18/45] fix: cleanup script to run in all regions --- .../src/cleanup-e2e-resources.ts | 20 ++++------------ packages/amplify-e2e-tests/tsconfig.json | 3 ++- scripts/e2e-test-regions.json | 21 ++++++++++++++++ scripts/split-e2e-tests.ts | 24 +------------------ 4 files changed, 29 insertions(+), 39 deletions(-) create mode 100644 scripts/e2e-test-regions.json diff --git a/packages/amplify-e2e-tests/src/cleanup-e2e-resources.ts b/packages/amplify-e2e-tests/src/cleanup-e2e-resources.ts index 8300d446bd..4c427c5bf6 100644 --- a/packages/amplify-e2e-tests/src/cleanup-e2e-resources.ts +++ b/packages/amplify-e2e-tests/src/cleanup-e2e-resources.ts @@ -7,18 +7,7 @@ import * as aws from 'aws-sdk'; import _ from 'lodash'; import fs from 'fs-extra'; import { deleteS3Bucket, sleep } from 'amplify-category-api-e2e-core'; - -// Ensure to update scripts/split-e2e-tests.ts is also updated this gets updated -const AWS_REGIONS_TO_RUN_TESTS = [ - 'us-east-1', - 'us-east-2', - 'us-west-2', - 'eu-west-2', - 'eu-central-1', - 'ap-northeast-1', - 'ap-southeast-1', - 'ap-southeast-2', -]; +import AWS_REGIONS_TO_RUN_TESTS from '../../../scripts/e2e-test-regions.json'; const reportPathDir = path.normalize(path.join(__dirname, '..', 'amplify-e2e-reports')); @@ -164,7 +153,8 @@ const getAWSConfig = ({ accessKeyId, secretAccessKey, sessionToken }: AWSAccount * @returns Promise a list of Amplify Apps in the region with build info */ const getAmplifyApps = async (account: AWSAccountInfo, region: string): Promise => { - const amplifyClient = new aws.Amplify(getAWSConfig(account, region)); + const config = getAWSConfig(account, region); + const amplifyClient = new aws.Amplify(config); const amplifyApps = await amplifyClient.listApps({ maxResults: 50 }).promise(); // keeping it to 50 as max supported is 50 const result: AmplifyAppInfo[] = []; for (const app of amplifyApps.apps) { @@ -640,7 +630,7 @@ const getAccountsToCleanup = async (): Promise => { }); const assumeRoleResForE2EParent = await stsClient .assumeRole({ - RoleArn: process.env.TEST_ACCOUNT_ROLE, + RoleArn: 'arn:aws:iam::182702232950:role/TestAccountRole-amplify-category-api', RoleSessionName: `testSession${Math.floor(Math.random() * 100000)}`, // One hour DurationSeconds: 1 * 60 * 60, @@ -703,7 +693,7 @@ const getAccountsToCleanup = async (): Promise => { }; const cleanupAccount = async (account: AWSAccountInfo, accountIndex: number, filterPredicate: JobFilterPredicate): Promise => { - const appPromises = AWS_REGIONS_TO_RUN_TESTS.map((region) => getAmplifyApps(account, region)); + const appPromises = AWS_REGIONS_TO_RUN_TESTS.filter((x) => x !== 'ap-east-1').map((region) => getAmplifyApps(account, region)); const stackPromises = AWS_REGIONS_TO_RUN_TESTS.map((region) => getStacks(account, region)); const bucketPromise = getS3Buckets(account); const orphanBucketPromise = getOrphanS3TestBuckets(account); diff --git a/packages/amplify-e2e-tests/tsconfig.json b/packages/amplify-e2e-tests/tsconfig.json index 6807354862..07f245ef39 100644 --- a/packages/amplify-e2e-tests/tsconfig.json +++ b/packages/amplify-e2e-tests/tsconfig.json @@ -10,7 +10,8 @@ "outDir": "lib", "lib": ["es2015", "es2016.array.include", "esnext.asynciterable", "dom"], "declaration": true, - "typeRoots": ["../../node_modules/@types", "node_modules/@types", "./typings"] + "typeRoots": ["../../node_modules/@types", "node_modules/@types", "./typings"], + "resolveJsonModule": true }, "references": [{ "path": "../amplify-e2e-core" }], "exclude": ["node_modules", "lib", "__tests__", "custom-resources", "overrides"] diff --git a/scripts/e2e-test-regions.json b/scripts/e2e-test-regions.json new file mode 100644 index 0000000000..338071f1bc --- /dev/null +++ b/scripts/e2e-test-regions.json @@ -0,0 +1,21 @@ +[ + "ap-northeast-2", + "ap-south-1", + "us-east-2", + "eu-central-1", + "ap-southeast-2", + "eu-west-2", + "us-west-2", + "ap-southeast-1", + "ca-central-1", + "eu-north-1", + "me-south-1", + "eu-west-3", + "eu-west-1", + "sa-east-1", + "us-east-1", + "ap-northeast-1", + "us-west-1", + "eu-south-1", + "ap-east-1" +] diff --git a/scripts/split-e2e-tests.ts b/scripts/split-e2e-tests.ts index 663af0c579..ec58595b29 100644 --- a/scripts/split-e2e-tests.ts +++ b/scripts/split-e2e-tests.ts @@ -2,6 +2,7 @@ import { join } from 'path'; import * as glob from 'glob'; import * as fs from 'fs-extra'; import * as yaml from 'js-yaml'; +import AWS_REGIONS_TO_RUN_TESTS from './e2e-test-regions.json'; type ForceTests = 'interactions' | 'containers'; @@ -43,29 +44,6 @@ type CandidateJob = { runSolo: boolean; }; -// Ensure to update packages/amplify-e2e-tests/src/cleanup-e2e-resources.ts is also updated this gets updated -const AWS_REGIONS_TO_RUN_TESTS = [ - 'ap-northeast-2', - 'ap-south-1', - 'us-east-2', - 'eu-central-1', - 'ap-southeast-2', - 'eu-west-2', - 'us-west-2', - 'ap-southeast-1', - 'ca-central-1', - 'eu-north-1', - 'me-south-1', - 'eu-west-3', - 'eu-west-1', - 'sa-east-1', - 'us-east-1', - 'ap-northeast-1', - 'us-west-1', - 'eu-south-1', - 'ap-east-1', -]; - // Some services (eg. amazon lex, containers) are not available in all regions // Tests added to this list will always run in the specified region const FORCE_REGION_MAP = { From f312336be1c62ddfb4de70d47871ad7cee46cc77 Mon Sep 17 00:00:00 2001 From: phani-srikar Date: Thu, 8 Feb 2024 16:42:57 -0800 Subject: [PATCH 19/45] chore: update role arn --- packages/amplify-e2e-tests/src/cleanup-e2e-resources.ts | 2 +- scripts/split-e2e-tests.ts | 5 +++-- scripts/tsconfig.json | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/amplify-e2e-tests/src/cleanup-e2e-resources.ts b/packages/amplify-e2e-tests/src/cleanup-e2e-resources.ts index 4c427c5bf6..a80f1bfd4d 100644 --- a/packages/amplify-e2e-tests/src/cleanup-e2e-resources.ts +++ b/packages/amplify-e2e-tests/src/cleanup-e2e-resources.ts @@ -630,7 +630,7 @@ const getAccountsToCleanup = async (): Promise => { }); const assumeRoleResForE2EParent = await stsClient .assumeRole({ - RoleArn: 'arn:aws:iam::182702232950:role/TestAccountRole-amplify-category-api', + RoleArn: process.env.TEST_ACCOUNT_ROLE, RoleSessionName: `testSession${Math.floor(Math.random() * 100000)}`, // One hour DurationSeconds: 1 * 60 * 60, diff --git a/scripts/split-e2e-tests.ts b/scripts/split-e2e-tests.ts index ec58595b29..14ee922084 100644 --- a/scripts/split-e2e-tests.ts +++ b/scripts/split-e2e-tests.ts @@ -2,8 +2,10 @@ import { join } from 'path'; import * as glob from 'glob'; import * as fs from 'fs-extra'; import * as yaml from 'js-yaml'; -import AWS_REGIONS_TO_RUN_TESTS from './e2e-test-regions.json'; +const REPO_ROOT = join(__dirname, '..'); +const SUPPORTED_REGIONS_PATH = join(REPO_ROOT, 'scripts', 'e2e-test-regions.json'); +const AWS_REGIONS_TO_RUN_TESTS: string[] = JSON.parse(fs.readFileSync(SUPPORTED_REGIONS_PATH, 'utf-8')); type ForceTests = 'interactions' | 'containers'; type TestTiming = { @@ -62,7 +64,6 @@ const USE_PARENT_ACCOUNT = [ 'src/__tests__/migration/api.key.migration5.test.ts', 'src/__tests__/FunctionTransformerTestsV2.e2e.test.ts', ]; -const REPO_ROOT = join(__dirname, '..'); const TEST_TIMINGS_PATH = join(REPO_ROOT, 'scripts', 'test-timings.data.json'); const CODEBUILD_CONFIG_BASE_PATH = join(REPO_ROOT, 'codebuild_specs', 'e2e_workflow_base.yml'); const CODEBUILD_GENERATE_CONFIG_PATH = join(REPO_ROOT, 'codebuild_specs', 'e2e_workflow.yml'); diff --git a/scripts/tsconfig.json b/scripts/tsconfig.json index 10bacd0fd2..beed314504 100644 --- a/scripts/tsconfig.json +++ b/scripts/tsconfig.json @@ -1,6 +1,7 @@ { "extends": "../tsconfig.base.json", "compilerOptions": { - "esModuleInterop": true + "esModuleInterop": true, + "resolveJsonModule": true } } From d9db4cdc937fe6bb42d90085d9dd4c7b0d4c19bc Mon Sep 17 00:00:00 2001 From: phani-srikar Date: Thu, 8 Feb 2024 16:54:34 -0800 Subject: [PATCH 20/45] chore: read supported regions from a common file --- packages/amplify-e2e-tests/src/cleanup-e2e-resources.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/amplify-e2e-tests/src/cleanup-e2e-resources.ts b/packages/amplify-e2e-tests/src/cleanup-e2e-resources.ts index a80f1bfd4d..d80b291373 100644 --- a/packages/amplify-e2e-tests/src/cleanup-e2e-resources.ts +++ b/packages/amplify-e2e-tests/src/cleanup-e2e-resources.ts @@ -7,7 +7,10 @@ import * as aws from 'aws-sdk'; import _ from 'lodash'; import fs from 'fs-extra'; import { deleteS3Bucket, sleep } from 'amplify-category-api-e2e-core'; -import AWS_REGIONS_TO_RUN_TESTS from '../../../scripts/e2e-test-regions.json'; + +const REPO_ROOT = path.join(__dirname, '..', '..', '..'); +const SUPPORTED_REGIONS_PATH = path.join(REPO_ROOT, 'scripts', 'e2e-test-regions.json'); +const AWS_REGIONS_TO_RUN_TESTS: string[] = JSON.parse(fs.readFileSync(SUPPORTED_REGIONS_PATH, 'utf-8')); const reportPathDir = path.normalize(path.join(__dirname, '..', 'amplify-e2e-reports')); From e97446379f5ff67708f5a416cd8133e8dc05c087 Mon Sep 17 00:00:00 2001 From: phani-srikar Date: Thu, 8 Feb 2024 17:13:30 -0800 Subject: [PATCH 21/45] chore: debug invalid client error --- packages/amplify-e2e-tests/src/cleanup-e2e-resources.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/amplify-e2e-tests/src/cleanup-e2e-resources.ts b/packages/amplify-e2e-tests/src/cleanup-e2e-resources.ts index d80b291373..b3ed1c3900 100644 --- a/packages/amplify-e2e-tests/src/cleanup-e2e-resources.ts +++ b/packages/amplify-e2e-tests/src/cleanup-e2e-resources.ts @@ -697,14 +697,19 @@ const getAccountsToCleanup = async (): Promise => { const cleanupAccount = async (account: AWSAccountInfo, accountIndex: number, filterPredicate: JobFilterPredicate): Promise => { const appPromises = AWS_REGIONS_TO_RUN_TESTS.filter((x) => x !== 'ap-east-1').map((region) => getAmplifyApps(account, region)); - const stackPromises = AWS_REGIONS_TO_RUN_TESTS.map((region) => getStacks(account, region)); + console.log('before stack promises'); + const stackPromises = ['us-east-1'].map((region) => getStacks(account, region)); + console.log('before bucket promises'); const bucketPromise = getS3Buckets(account); const orphanBucketPromise = getOrphanS3TestBuckets(account); const orphanIamRolesPromise = getOrphanTestIamRoles(account); const apps = (await Promise.all(appPromises)).flat(); + console.log(`${generateAccountInfo(account, accountIndex)} Amplify Apps: ${apps.length}`); const stacks = (await Promise.all(stackPromises)).flat(); + console.log(`${generateAccountInfo(account, accountIndex)} CloudFormation Stacks: ${stacks.length}`); const buckets = await bucketPromise; + console.log(`${generateAccountInfo(account, accountIndex)} S3 Buckets: ${buckets.length}`); const orphanBuckets = await orphanBucketPromise; const orphanIamRoles = await orphanIamRolesPromise; From dc1e04fc65c1fcc0d12ffabec3147cc8a811d46f Mon Sep 17 00:00:00 2001 From: phani-srikar Date: Thu, 8 Feb 2024 17:29:54 -0800 Subject: [PATCH 22/45] chore: limit the regions in cleanup --- .../src/cleanup-e2e-resources.ts | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/packages/amplify-e2e-tests/src/cleanup-e2e-resources.ts b/packages/amplify-e2e-tests/src/cleanup-e2e-resources.ts index b3ed1c3900..5786743fe4 100644 --- a/packages/amplify-e2e-tests/src/cleanup-e2e-resources.ts +++ b/packages/amplify-e2e-tests/src/cleanup-e2e-resources.ts @@ -10,8 +10,18 @@ import { deleteS3Bucket, sleep } from 'amplify-category-api-e2e-core'; const REPO_ROOT = path.join(__dirname, '..', '..', '..'); const SUPPORTED_REGIONS_PATH = path.join(REPO_ROOT, 'scripts', 'e2e-test-regions.json'); -const AWS_REGIONS_TO_RUN_TESTS: string[] = JSON.parse(fs.readFileSync(SUPPORTED_REGIONS_PATH, 'utf-8')); - +// const AWS_REGIONS_TO_RUN_TESTS: string[] = JSON.parse(fs.readFileSync(SUPPORTED_REGIONS_PATH, 'utf-8')); + +const AWS_REGIONS_TO_RUN_TESTS = [ + 'us-east-1', + 'us-east-2', + 'us-west-2', + 'eu-west-2', + 'eu-central-1', + 'ap-northeast-1', + 'ap-southeast-1', + 'ap-southeast-2', +]; const reportPathDir = path.normalize(path.join(__dirname, '..', 'amplify-e2e-reports')); const MULTI_JOB_APP = ''; @@ -696,9 +706,9 @@ const getAccountsToCleanup = async (): Promise => { }; const cleanupAccount = async (account: AWSAccountInfo, accountIndex: number, filterPredicate: JobFilterPredicate): Promise => { - const appPromises = AWS_REGIONS_TO_RUN_TESTS.filter((x) => x !== 'ap-east-1').map((region) => getAmplifyApps(account, region)); + const appPromises = AWS_REGIONS_TO_RUN_TESTS.map((region) => getAmplifyApps(account, region)); console.log('before stack promises'); - const stackPromises = ['us-east-1'].map((region) => getStacks(account, region)); + const stackPromises = AWS_REGIONS_TO_RUN_TESTS.map((region) => getStacks(account, region)); console.log('before bucket promises'); const bucketPromise = getS3Buckets(account); const orphanBucketPromise = getOrphanS3TestBuckets(account); From f55db14003a7cdb050a01f2d2eba39ee9bc706c9 Mon Sep 17 00:00:00 2001 From: phani-srikar Date: Thu, 8 Feb 2024 19:43:11 -0800 Subject: [PATCH 23/45] chore: run all regions serially --- .../src/cleanup-e2e-resources.ts | 54 +++++++++---------- 1 file changed, 24 insertions(+), 30 deletions(-) diff --git a/packages/amplify-e2e-tests/src/cleanup-e2e-resources.ts b/packages/amplify-e2e-tests/src/cleanup-e2e-resources.ts index 5786743fe4..c70ac90e69 100644 --- a/packages/amplify-e2e-tests/src/cleanup-e2e-resources.ts +++ b/packages/amplify-e2e-tests/src/cleanup-e2e-resources.ts @@ -10,18 +10,9 @@ import { deleteS3Bucket, sleep } from 'amplify-category-api-e2e-core'; const REPO_ROOT = path.join(__dirname, '..', '..', '..'); const SUPPORTED_REGIONS_PATH = path.join(REPO_ROOT, 'scripts', 'e2e-test-regions.json'); -// const AWS_REGIONS_TO_RUN_TESTS: string[] = JSON.parse(fs.readFileSync(SUPPORTED_REGIONS_PATH, 'utf-8')); - -const AWS_REGIONS_TO_RUN_TESTS = [ - 'us-east-1', - 'us-east-2', - 'us-west-2', - 'eu-west-2', - 'eu-central-1', - 'ap-northeast-1', - 'ap-southeast-1', - 'ap-southeast-2', -]; +const AWS_REGIONS_TO_RUN_TESTS_READ: string[] = JSON.parse(fs.readFileSync(SUPPORTED_REGIONS_PATH, 'utf-8')); + +const AWS_REGIONS_TO_RUN_TESTS = AWS_REGIONS_TO_RUN_TESTS_READ; const reportPathDir = path.normalize(path.join(__dirname, '..', 'amplify-e2e-reports')); const MULTI_JOB_APP = ''; @@ -706,24 +697,27 @@ const getAccountsToCleanup = async (): Promise => { }; const cleanupAccount = async (account: AWSAccountInfo, accountIndex: number, filterPredicate: JobFilterPredicate): Promise => { - const appPromises = AWS_REGIONS_TO_RUN_TESTS.map((region) => getAmplifyApps(account, region)); - console.log('before stack promises'); - const stackPromises = AWS_REGIONS_TO_RUN_TESTS.map((region) => getStacks(account, region)); - console.log('before bucket promises'); - const bucketPromise = getS3Buckets(account); - const orphanBucketPromise = getOrphanS3TestBuckets(account); - const orphanIamRolesPromise = getOrphanTestIamRoles(account); - - const apps = (await Promise.all(appPromises)).flat(); - console.log(`${generateAccountInfo(account, accountIndex)} Amplify Apps: ${apps.length}`); - const stacks = (await Promise.all(stackPromises)).flat(); - console.log(`${generateAccountInfo(account, accountIndex)} CloudFormation Stacks: ${stacks.length}`); - const buckets = await bucketPromise; - console.log(`${generateAccountInfo(account, accountIndex)} S3 Buckets: ${buckets.length}`); - const orphanBuckets = await orphanBucketPromise; - const orphanIamRoles = await orphanIamRolesPromise; - - const allResources = await mergeResourcesByCCIJob(apps, stacks, buckets, orphanBuckets, orphanIamRoles); + const apps_a = []; + const stacks_a = []; + const buckets_a = []; + const orphanBuckets_a = []; + const orphanIamRoles_a = []; + + AWS_REGIONS_TO_RUN_TESTS.forEach(async (region) => { + console.log(`${generateAccountInfo(account, accountIndex)} is under cleanup in ${region}`); + const apps = await getAmplifyApps(account, region); + console.log(`${generateAccountInfo(account, accountIndex)} Amplify Apps: ${apps.length}`); + apps_a.push(...apps); + const stacks = await getStacks(account, region); + console.log(`${generateAccountInfo(account, accountIndex)} CloudFormation Stacks: ${stacks.length}`); + stacks_a.push(...stacks); + const buckets = await getS3Buckets(account); + console.log(`${generateAccountInfo(account, accountIndex)} S3 Buckets: ${buckets.length}`); + buckets_a.push(...buckets); + const orphanBucketPromise = await getOrphanS3TestBuckets(account); + const orphanIamRolesPromise = await getOrphanTestIamRoles(account); + }); + const allResources = await mergeResourcesByCCIJob(apps_a, stacks_a, buckets_a, orphanBuckets_a, orphanIamRoles_a); const staleResources = _.pickBy(allResources, filterPredicate); generateReport(staleResources, accountIndex); From 760afba2872191da17f2f023d7b569676b6203be Mon Sep 17 00:00:00 2001 From: phani-srikar Date: Thu, 8 Feb 2024 19:46:33 -0800 Subject: [PATCH 24/45] chore: run all regions serially --- packages/amplify-e2e-tests/src/cleanup-e2e-resources.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/amplify-e2e-tests/src/cleanup-e2e-resources.ts b/packages/amplify-e2e-tests/src/cleanup-e2e-resources.ts index c70ac90e69..f46d583fcf 100644 --- a/packages/amplify-e2e-tests/src/cleanup-e2e-resources.ts +++ b/packages/amplify-e2e-tests/src/cleanup-e2e-resources.ts @@ -760,7 +760,7 @@ const cleanup = async (): Promise => { accounts.map((account, i) => { console.log(`${generateAccountInfo(account, i)} is under cleanup`); }); - await Promise.all(accounts.map((account, i) => cleanupAccount(account, i, filterPredicate))); + accounts.map(async (account, i) => await cleanupAccount(account, i, filterPredicate)); console.log('Done cleaning all accounts!'); }; From fdd88907f3ed2ea4422e64ff338e327468cff4e9 Mon Sep 17 00:00:00 2001 From: phani-srikar Date: Thu, 8 Feb 2024 19:48:10 -0800 Subject: [PATCH 25/45] chore: disable actual deletion to debug --- packages/amplify-e2e-tests/src/cleanup-e2e-resources.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/amplify-e2e-tests/src/cleanup-e2e-resources.ts b/packages/amplify-e2e-tests/src/cleanup-e2e-resources.ts index f46d583fcf..f5fd9f2125 100644 --- a/packages/amplify-e2e-tests/src/cleanup-e2e-resources.ts +++ b/packages/amplify-e2e-tests/src/cleanup-e2e-resources.ts @@ -721,7 +721,7 @@ const cleanupAccount = async (account: AWSAccountInfo, accountIndex: number, fil const staleResources = _.pickBy(allResources, filterPredicate); generateReport(staleResources, accountIndex); - await deleteResources(account, accountIndex, staleResources); + // await deleteResources(account, accountIndex, staleResources); console.log(`${generateAccountInfo(account, accountIndex)} Cleanup done!`); }; From 1c351badb58d0771c3ea23d970279a56ed7add32 Mon Sep 17 00:00:00 2001 From: phani-srikar Date: Thu, 8 Feb 2024 20:11:17 -0800 Subject: [PATCH 26/45] chore: test with one account and all regions --- packages/amplify-e2e-tests/src/cleanup-e2e-resources.ts | 4 +++- shared-scripts.sh | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/amplify-e2e-tests/src/cleanup-e2e-resources.ts b/packages/amplify-e2e-tests/src/cleanup-e2e-resources.ts index f5fd9f2125..e2b626abc1 100644 --- a/packages/amplify-e2e-tests/src/cleanup-e2e-resources.ts +++ b/packages/amplify-e2e-tests/src/cleanup-e2e-resources.ts @@ -760,7 +760,9 @@ const cleanup = async (): Promise => { accounts.map((account, i) => { console.log(`${generateAccountInfo(account, i)} is under cleanup`); }); - accounts.map(async (account, i) => await cleanupAccount(account, i, filterPredicate)); + const oneAccount = accounts[0]; + await cleanupAccount(oneAccount, 0, filterPredicate); + // accounts.map(async (account, i) => await cleanupAccount(account, i, filterPredicate)); console.log('Done cleaning all accounts!'); }; diff --git a/shared-scripts.sh b/shared-scripts.sh index c7dcc024c7..a99d8dd787 100755 --- a/shared-scripts.sh +++ b/shared-scripts.sh @@ -276,6 +276,7 @@ function _unassumeTestAccountCredentials { function useChildAccountCredentials { if [ -z "$USE_PARENT_ACCOUNT" ]; then export AWS_PAGER="" + export AWS_MAX_ATTEMPTS=5 parent_acct=$(aws sts get-caller-identity | jq -cr '.Account') child_accts=$(aws organizations list-accounts | jq -c "[.Accounts[].Id | select(. != \"$parent_acct\")]") org_size=$(echo $child_accts | jq 'length') From 54aaf4c1df02746c65c4215c33074856a97c7b18 Mon Sep 17 00:00:00 2001 From: phani-srikar Date: Fri, 9 Feb 2024 09:00:40 -0800 Subject: [PATCH 27/45] chore: run with AWS_STS_REGIONAL_ENDPOINTS=regional --- codebuild_specs/e2e_workflow.yml | 2 +- .../src/cleanup-e2e-resources.ts | 147 +++++++++--------- scripts/split-e2e-tests.ts | 14 +- shared-scripts.sh | 1 + 4 files changed, 87 insertions(+), 77 deletions(-) diff --git a/codebuild_specs/e2e_workflow.yml b/codebuild_specs/e2e_workflow.yml index f30d1914d5..9ddb04f954 100644 --- a/codebuild_specs/e2e_workflow.yml +++ b/codebuild_specs/e2e_workflow.yml @@ -1266,7 +1266,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/transformer-migrations/searchable-migration.test.ts - CLI_REGION: eu-south-1 + CLI_REGION: sa-east-1 USE_PARENT_ACCOUNT: 1 depend-on: - publish_to_local_registry diff --git a/packages/amplify-e2e-tests/src/cleanup-e2e-resources.ts b/packages/amplify-e2e-tests/src/cleanup-e2e-resources.ts index e2b626abc1..db8546b41e 100644 --- a/packages/amplify-e2e-tests/src/cleanup-e2e-resources.ts +++ b/packages/amplify-e2e-tests/src/cleanup-e2e-resources.ts @@ -10,9 +10,8 @@ import { deleteS3Bucket, sleep } from 'amplify-category-api-e2e-core'; const REPO_ROOT = path.join(__dirname, '..', '..', '..'); const SUPPORTED_REGIONS_PATH = path.join(REPO_ROOT, 'scripts', 'e2e-test-regions.json'); -const AWS_REGIONS_TO_RUN_TESTS_READ: string[] = JSON.parse(fs.readFileSync(SUPPORTED_REGIONS_PATH, 'utf-8')); +const AWS_REGIONS_TO_RUN_TESTS: string[] = JSON.parse(fs.readFileSync(SUPPORTED_REGIONS_PATH, 'utf-8')); -const AWS_REGIONS_TO_RUN_TESTS = AWS_REGIONS_TO_RUN_TESTS_READ; const reportPathDir = path.normalize(path.join(__dirname, '..', 'amplify-e2e-reports')); const MULTI_JOB_APP = ''; @@ -157,31 +156,35 @@ const getAWSConfig = ({ accessKeyId, secretAccessKey, sessionToken }: AWSAccount * @returns Promise a list of Amplify Apps in the region with build info */ const getAmplifyApps = async (account: AWSAccountInfo, region: string): Promise => { - const config = getAWSConfig(account, region); - const amplifyClient = new aws.Amplify(config); - const amplifyApps = await amplifyClient.listApps({ maxResults: 50 }).promise(); // keeping it to 50 as max supported is 50 - const result: AmplifyAppInfo[] = []; - for (const app of amplifyApps.apps) { - const backends: Record = {}; - try { - const backendEnvironments = await amplifyClient.listBackendEnvironments({ appId: app.appId, maxResults: 50 }).promise(); - for (const backendEnv of backendEnvironments.backendEnvironments) { - const buildInfo = await getStackDetails(backendEnv.stackName, account, region); - if (buildInfo) { - backends[backendEnv.environmentName] = buildInfo; + try { + const config = getAWSConfig(account, region); + const amplifyClient = new aws.Amplify(config); + const amplifyApps = await amplifyClient.listApps({ maxResults: 50 }).promise(); // keeping it to 50 as max supported is 50 + const result: AmplifyAppInfo[] = []; + for (const app of amplifyApps.apps) { + const backends: Record = {}; + try { + const backendEnvironments = await amplifyClient.listBackendEnvironments({ appId: app.appId, maxResults: 50 }).promise(); + for (const backendEnv of backendEnvironments.backendEnvironments) { + const buildInfo = await getStackDetails(backendEnv.stackName, account, region); + if (buildInfo) { + backends[backendEnv.environmentName] = buildInfo; + } } + } catch (e) { + console.log(e); } - } catch (e) { - console.log(e); + result.push({ + appId: app.appId, + name: app.name, + region, + backends, + }); } - result.push({ - appId: app.appId, - name: app.name, - region, - backends, - }); + return result; + } catch (e) { + console.log(e); } - return result; }; /** @@ -229,37 +232,41 @@ const getStackDetails = async (stackName: string, account: AWSAccountInfo, regio }; const getStacks = async (account: AWSAccountInfo, region: string): Promise => { - const cfnClient = new aws.CloudFormation(getAWSConfig(account, region)); - const stacks = await cfnClient - .listStacks({ - StackStatusFilter: [ - 'CREATE_COMPLETE', - 'ROLLBACK_FAILED', - 'DELETE_FAILED', - 'UPDATE_COMPLETE', - 'UPDATE_ROLLBACK_FAILED', - 'UPDATE_ROLLBACK_COMPLETE', - 'IMPORT_COMPLETE', - 'IMPORT_ROLLBACK_FAILED', - 'IMPORT_ROLLBACK_COMPLETE', - ], - }) - .promise(); - - // We are interested in only the root stacks that are deployed by amplify-cli - const rootStacks = stacks.StackSummaries.filter((stack) => !stack.RootId); - const results: StackInfo[] = []; - for (const stack of rootStacks) { - try { - const details = await getStackDetails(stack.StackName, account, region); - if (details) { - results.push(details); + try { + const cfnClient = new aws.CloudFormation(getAWSConfig(account, region)); + const stacks = await cfnClient + .listStacks({ + StackStatusFilter: [ + 'CREATE_COMPLETE', + 'ROLLBACK_FAILED', + 'DELETE_FAILED', + 'UPDATE_COMPLETE', + 'UPDATE_ROLLBACK_FAILED', + 'UPDATE_ROLLBACK_COMPLETE', + 'IMPORT_COMPLETE', + 'IMPORT_ROLLBACK_FAILED', + 'IMPORT_ROLLBACK_COMPLETE', + ], + }) + .promise(); + + // We are interested in only the root stacks that are deployed by amplify-cli + const rootStacks = stacks.StackSummaries.filter((stack) => !stack.RootId); + const results: StackInfo[] = []; + for (const stack of rootStacks) { + try { + const details = await getStackDetails(stack.StackName, account, region); + if (details) { + results.push(details); + } + } catch { + // don't want to barf and fail e2e tests } - } catch { - // don't want to barf and fail e2e tests } + return results; + } catch (e) { + console.log(e); } - return results; }; const getCodeBuildClient = (): CodeBuild => { @@ -697,27 +704,19 @@ const getAccountsToCleanup = async (): Promise => { }; const cleanupAccount = async (account: AWSAccountInfo, accountIndex: number, filterPredicate: JobFilterPredicate): Promise => { - const apps_a = []; - const stacks_a = []; - const buckets_a = []; - const orphanBuckets_a = []; - const orphanIamRoles_a = []; - - AWS_REGIONS_TO_RUN_TESTS.forEach(async (region) => { - console.log(`${generateAccountInfo(account, accountIndex)} is under cleanup in ${region}`); - const apps = await getAmplifyApps(account, region); - console.log(`${generateAccountInfo(account, accountIndex)} Amplify Apps: ${apps.length}`); - apps_a.push(...apps); - const stacks = await getStacks(account, region); - console.log(`${generateAccountInfo(account, accountIndex)} CloudFormation Stacks: ${stacks.length}`); - stacks_a.push(...stacks); - const buckets = await getS3Buckets(account); - console.log(`${generateAccountInfo(account, accountIndex)} S3 Buckets: ${buckets.length}`); - buckets_a.push(...buckets); - const orphanBucketPromise = await getOrphanS3TestBuckets(account); - const orphanIamRolesPromise = await getOrphanTestIamRoles(account); - }); - const allResources = await mergeResourcesByCCIJob(apps_a, stacks_a, buckets_a, orphanBuckets_a, orphanIamRoles_a); + const appPromises = AWS_REGIONS_TO_RUN_TESTS.map((region) => getAmplifyApps(account, region)); + const stackPromises = AWS_REGIONS_TO_RUN_TESTS.map((region) => getStacks(account, region)); + const bucketPromise = getS3Buckets(account); + const orphanBucketPromise = getOrphanS3TestBuckets(account); + const orphanIamRolesPromise = getOrphanTestIamRoles(account); + + const apps = (await Promise.all(appPromises)).flat(); + const stacks = (await Promise.all(stackPromises)).flat(); + const buckets = await bucketPromise; + const orphanBuckets = await orphanBucketPromise; + const orphanIamRoles = await orphanIamRolesPromise; + + const allResources = await mergeResourcesByCCIJob(apps, stacks, buckets, orphanBuckets, orphanIamRoles); const staleResources = _.pickBy(allResources, filterPredicate); generateReport(staleResources, accountIndex); @@ -760,9 +759,7 @@ const cleanup = async (): Promise => { accounts.map((account, i) => { console.log(`${generateAccountInfo(account, i)} is under cleanup`); }); - const oneAccount = accounts[0]; - await cleanupAccount(oneAccount, 0, filterPredicate); - // accounts.map(async (account, i) => await cleanupAccount(account, i, filterPredicate)); + await Promise.all(accounts.map((account, i) => cleanupAccount(account, i, filterPredicate))); console.log('Done cleaning all accounts!'); }; diff --git a/scripts/split-e2e-tests.ts b/scripts/split-e2e-tests.ts index 14ee922084..252d33ba67 100644 --- a/scripts/split-e2e-tests.ts +++ b/scripts/split-e2e-tests.ts @@ -5,7 +5,10 @@ import * as yaml from 'js-yaml'; const REPO_ROOT = join(__dirname, '..'); const SUPPORTED_REGIONS_PATH = join(REPO_ROOT, 'scripts', 'e2e-test-regions.json'); -const AWS_REGIONS_TO_RUN_TESTS: string[] = JSON.parse(fs.readFileSync(SUPPORTED_REGIONS_PATH, 'utf-8')); +const AMPLIFY_SUPPORTED_REGIONS: string[] = JSON.parse(fs.readFileSync(SUPPORTED_REGIONS_PATH, 'utf-8')); +// const AWS_REGIONS_TO_RUN_TESTS = AMPLIFY_SUPPORTED_REGIONS.filter((region) => !['me-south-1', 'eu-south-1'].includes(region)); +const AWS_REGIONS_TO_RUN_TESTS = AMPLIFY_SUPPORTED_REGIONS; +const SUPPORTED_OPT_IN_REGIONS = ['eu-south-1', 'ap-east-1']; type ForceTests = 'interactions' | 'containers'; type TestTiming = { @@ -195,6 +198,7 @@ const splitTests = (baseJobLinux: any, testDirectory: string, pickTests?: (testS }); const USE_PARENT = USE_PARENT_ACCOUNT.some((usesParent) => test.startsWith(usesParent)); + const nonOptInRegions = AWS_REGIONS_TO_RUN_TESTS.filter((region) => !SUPPORTED_OPT_IN_REGIONS.includes(region)); if (RUN_SOLO.find((solo) => test === solo || test.match(solo))) { if (RUN_IN_ALL_REGIONS.find((allRegions) => test === allRegions || test.match(allRegions))) { @@ -215,6 +219,10 @@ const splitTests = (baseJobLinux: any, testDirectory: string, pickTests?: (testS } if (USE_PARENT) { newSoloJob.useParentAccount = true; + // parent E2E account does not have opt-in regions. Choose non-opt-in region. + if (SUPPORTED_OPT_IN_REGIONS.includes(newSoloJob.region)) { + newSoloJob.region = nonOptInRegions[jobIdx % nonOptInRegions.length]; + } } soloJobs.push(newSoloJob); continue; @@ -227,6 +235,10 @@ const splitTests = (baseJobLinux: any, testDirectory: string, pickTests?: (testS } if (USE_PARENT) { currentJob.useParentAccount = true; + // parent E2E account does not have opt-in regions. Choose non-opt-in region. + if (SUPPORTED_OPT_IN_REGIONS.includes(currentJob.region)) { + currentJob.region = nonOptInRegions[jobIdx % nonOptInRegions.length]; + } } // create a new job once the current job is full; diff --git a/shared-scripts.sh b/shared-scripts.sh index a99d8dd787..737d9b20d1 100755 --- a/shared-scripts.sh +++ b/shared-scripts.sh @@ -277,6 +277,7 @@ function useChildAccountCredentials { if [ -z "$USE_PARENT_ACCOUNT" ]; then export AWS_PAGER="" export AWS_MAX_ATTEMPTS=5 + export AWS_STS_REGIONAL_ENDPOINTS=regional parent_acct=$(aws sts get-caller-identity | jq -cr '.Account') child_accts=$(aws organizations list-accounts | jq -c "[.Accounts[].Id | select(. != \"$parent_acct\")]") org_size=$(echo $child_accts | jq 'length') From 824bffdee4492075d4627462577ee2b5125d0577 Mon Sep 17 00:00:00 2001 From: phani-srikar Date: Fri, 9 Feb 2024 22:04:07 -0800 Subject: [PATCH 28/45] chore: me-south-1 is opt-in region --- codebuild_specs/e2e_workflow.yml | 6 +++--- scripts/split-e2e-tests.ts | 2 +- shared-scripts.sh | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/codebuild_specs/e2e_workflow.yml b/codebuild_specs/e2e_workflow.yml index 9ddb04f954..d5a83342a0 100644 --- a/codebuild_specs/e2e_workflow.yml +++ b/codebuild_specs/e2e_workflow.yml @@ -361,7 +361,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/migration/api.key.migration2.test.ts - CLI_REGION: me-south-1 + CLI_REGION: ap-northeast-1 USE_PARENT_ACCOUNT: 1 depend-on: - publish_to_local_registry @@ -1209,7 +1209,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/schema-searchable.test.ts - CLI_REGION: me-south-1 + CLI_REGION: us-east-1 USE_PARENT_ACCOUNT: 1 depend-on: - publish_to_local_registry @@ -1266,7 +1266,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/transformer-migrations/searchable-migration.test.ts - CLI_REGION: sa-east-1 + CLI_REGION: ap-southeast-2 USE_PARENT_ACCOUNT: 1 depend-on: - publish_to_local_registry diff --git a/scripts/split-e2e-tests.ts b/scripts/split-e2e-tests.ts index 252d33ba67..1aaf1fe9e9 100644 --- a/scripts/split-e2e-tests.ts +++ b/scripts/split-e2e-tests.ts @@ -8,7 +8,7 @@ const SUPPORTED_REGIONS_PATH = join(REPO_ROOT, 'scripts', 'e2e-test-regions.json const AMPLIFY_SUPPORTED_REGIONS: string[] = JSON.parse(fs.readFileSync(SUPPORTED_REGIONS_PATH, 'utf-8')); // const AWS_REGIONS_TO_RUN_TESTS = AMPLIFY_SUPPORTED_REGIONS.filter((region) => !['me-south-1', 'eu-south-1'].includes(region)); const AWS_REGIONS_TO_RUN_TESTS = AMPLIFY_SUPPORTED_REGIONS; -const SUPPORTED_OPT_IN_REGIONS = ['eu-south-1', 'ap-east-1']; +const SUPPORTED_OPT_IN_REGIONS = ['eu-south-1', 'ap-east-1', 'me-south-1']; type ForceTests = 'interactions' | 'containers'; type TestTiming = { diff --git a/shared-scripts.sh b/shared-scripts.sh index 737d9b20d1..d084293cc8 100755 --- a/shared-scripts.sh +++ b/shared-scripts.sh @@ -281,7 +281,7 @@ function useChildAccountCredentials { parent_acct=$(aws sts get-caller-identity | jq -cr '.Account') child_accts=$(aws organizations list-accounts | jq -c "[.Accounts[].Id | select(. != \"$parent_acct\")]") org_size=$(echo $child_accts | jq 'length') - opt_in_regions="eu-south-1 ap-east-1" + opt_in_regions="eu-south-1 ap-east-1 me-south-1" if echo "$opt_in_regions" | grep -qw "$CLI_REGION"; then child_accts=$(echo $child_accts | jq -c '.[]') for child_acct in $child_accts; do From 45171752d6a3527097018e14cde8c0d752a1cf7c Mon Sep 17 00:00:00 2001 From: phani-srikar Date: Sat, 10 Feb 2024 18:32:14 -0800 Subject: [PATCH 29/45] chore: fix cleanup script to skip incompatible account-region combinations --- .../src/cleanup-e2e-resources.ts | 89 ++++++++++--------- 1 file changed, 48 insertions(+), 41 deletions(-) diff --git a/packages/amplify-e2e-tests/src/cleanup-e2e-resources.ts b/packages/amplify-e2e-tests/src/cleanup-e2e-resources.ts index db8546b41e..87844d0b83 100644 --- a/packages/amplify-e2e-tests/src/cleanup-e2e-resources.ts +++ b/packages/amplify-e2e-tests/src/cleanup-e2e-resources.ts @@ -156,35 +156,39 @@ const getAWSConfig = ({ accessKeyId, secretAccessKey, sessionToken }: AWSAccount * @returns Promise a list of Amplify Apps in the region with build info */ const getAmplifyApps = async (account: AWSAccountInfo, region: string): Promise => { + const config = getAWSConfig(account, region); + const amplifyClient = new aws.Amplify(config); + const result: AmplifyAppInfo[] = []; + let amplifyApps = { apps: [] }; try { - const config = getAWSConfig(account, region); - const amplifyClient = new aws.Amplify(config); - const amplifyApps = await amplifyClient.listApps({ maxResults: 50 }).promise(); // keeping it to 50 as max supported is 50 - const result: AmplifyAppInfo[] = []; - for (const app of amplifyApps.apps) { - const backends: Record = {}; - try { - const backendEnvironments = await amplifyClient.listBackendEnvironments({ appId: app.appId, maxResults: 50 }).promise(); - for (const backendEnv of backendEnvironments.backendEnvironments) { - const buildInfo = await getStackDetails(backendEnv.stackName, account, region); - if (buildInfo) { - backends[backendEnv.environmentName] = buildInfo; - } + amplifyApps = await amplifyClient.listApps({ maxResults: 50 }).promise(); // keeping it to 50 as max supported is 50 + } catch (e) { + // Do not fail the cleanup and continue + console.log(`Listing apps for account ${account}-${region} failed with error with code ${e?.code}. Skipping.`); + return result; + } + + for (const app of amplifyApps?.apps) { + const backends: Record = {}; + try { + const backendEnvironments = await amplifyClient.listBackendEnvironments({ appId: app.appId, maxResults: 50 }).promise(); + for (const backendEnv of backendEnvironments.backendEnvironments) { + const buildInfo = await getStackDetails(backendEnv.stackName, account, region); + if (buildInfo) { + backends[backendEnv.environmentName] = buildInfo; } - } catch (e) { - console.log(e); } - result.push({ - appId: app.appId, - name: app.name, - region, - backends, - }); + } catch (e) { + console.log(e); } - return result; - } catch (e) { - console.log(e); + result.push({ + appId: app.appId, + name: app.name, + region, + backends, + }); } + return result; }; /** @@ -232,9 +236,11 @@ const getStackDetails = async (stackName: string, account: AWSAccountInfo, regio }; const getStacks = async (account: AWSAccountInfo, region: string): Promise => { + const cfnClient = new aws.CloudFormation(getAWSConfig(account, region)); + const results: StackInfo[] = []; + let stacks; try { - const cfnClient = new aws.CloudFormation(getAWSConfig(account, region)); - const stacks = await cfnClient + stacks = await cfnClient .listStacks({ StackStatusFilter: [ 'CREATE_COMPLETE', @@ -249,24 +255,25 @@ const getStacks = async (account: AWSAccountInfo, region: string): Promise !stack.RootId); - const results: StackInfo[] = []; - for (const stack of rootStacks) { - try { - const details = await getStackDetails(stack.StackName, account, region); - if (details) { - results.push(details); - } - } catch { - // don't want to barf and fail e2e tests + // We are interested in only the root stacks that are deployed by amplify-cli + const rootStacks = stacks.StackSummaries.filter((stack) => !stack.RootId); + for (const stack of rootStacks) { + try { + const details = await getStackDetails(stack.StackName, account, region); + if (details) { + results.push(details); } + } catch { + // don't want to barf and fail e2e tests } - return results; - } catch (e) { - console.log(e); } + return results; }; const getCodeBuildClient = (): CodeBuild => { @@ -720,7 +727,7 @@ const cleanupAccount = async (account: AWSAccountInfo, accountIndex: number, fil const staleResources = _.pickBy(allResources, filterPredicate); generateReport(staleResources, accountIndex); - // await deleteResources(account, accountIndex, staleResources); + await deleteResources(account, accountIndex, staleResources); console.log(`${generateAccountInfo(account, accountIndex)} Cleanup done!`); }; From 606e8166c21f313068d133f1b7a591e54697a3a4 Mon Sep 17 00:00:00 2001 From: phani-srikar Date: Mon, 19 Feb 2024 16:58:36 -0800 Subject: [PATCH 30/45] chore: disable running SQL tests in opt-in regions --- codebuild_specs/e2e_workflow.yml | 581 ++++++++----------------------- scripts/split-e2e-tests.ts | 20 +- 2 files changed, 157 insertions(+), 444 deletions(-) diff --git a/codebuild_specs/e2e_workflow.yml b/codebuild_specs/e2e_workflow.yml index d5a83342a0..7dfec42a49 100644 --- a/codebuild_specs/e2e_workflow.yml +++ b/codebuild_specs/e2e_workflow.yml @@ -160,7 +160,7 @@ batch: variables: TEST_SUITE: >- src/__tests__/graphql-v2/api_lambda_auth.test.ts|src/__tests__/api_9.test.ts - CLI_REGION: eu-west-3 + CLI_REGION: us-east-1 depend-on: - publish_to_local_registry - identifier: api_10 @@ -392,439 +392,331 @@ batch: CLI_REGION: sa-east-1 depend-on: - publish_to_local_registry - - identifier: rds_mysql_auth_apikey_lambda + - identifier: api_canaryap_northeast_2 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-mysql-auth-apikey-lambda.test.ts - CLI_REGION: ap-northeast-1 - depend-on: - - publish_to_local_registry - - identifier: rds_mysql_auth_iam_apikey_lambda_subscription - buildspec: codebuild_specs/run_e2e_tests.yml - env: - compute-type: BUILD_GENERAL1_SMALL - variables: - TEST_SUITE: src/__tests__/rds-mysql-auth-iam-apikey-lambda-subscription.test.ts - CLI_REGION: us-west-1 - depend-on: - - publish_to_local_registry - - identifier: rds_mysql_auth_iam - buildspec: codebuild_specs/run_e2e_tests.yml - env: - compute-type: BUILD_GENERAL1_SMALL - variables: - TEST_SUITE: src/__tests__/rds-mysql-auth-iam.test.ts - CLI_REGION: eu-south-1 - depend-on: - - publish_to_local_registry - - identifier: rds_mysql_custom_claims_refersto_auth - buildspec: codebuild_specs/run_e2e_tests.yml - env: - compute-type: BUILD_GENERAL1_SMALL - variables: - TEST_SUITE: src/__tests__/rds-mysql-custom-claims-refersto-auth.test.ts - CLI_REGION: ap-east-1 - depend-on: - - publish_to_local_registry - - identifier: rds_mysql_model_v2ap_northeast_2 - buildspec: codebuild_specs/run_e2e_tests.yml - env: - compute-type: BUILD_GENERAL1_SMALL - variables: - TEST_SUITE: src/__tests__/rds-mysql-model-v2.test.ts + TEST_SUITE: src/__tests__/api_canary.test.ts CLI_REGION: ap-northeast-2 depend-on: - publish_to_local_registry - - identifier: rds_mysql_model_v2ap_south_1 + - identifier: api_canaryap_south_1 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-mysql-model-v2.test.ts + TEST_SUITE: src/__tests__/api_canary.test.ts CLI_REGION: ap-south-1 depend-on: - publish_to_local_registry - - identifier: rds_mysql_model_v2us_east_2 + - identifier: api_canaryus_east_2 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-mysql-model-v2.test.ts + TEST_SUITE: src/__tests__/api_canary.test.ts CLI_REGION: us-east-2 depend-on: - publish_to_local_registry - - identifier: rds_mysql_model_v2eu_central_1 + - identifier: api_canaryeu_central_1 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-mysql-model-v2.test.ts + TEST_SUITE: src/__tests__/api_canary.test.ts CLI_REGION: eu-central-1 depend-on: - publish_to_local_registry - - identifier: rds_mysql_model_v2ap_southeast_2 + - identifier: api_canaryap_southeast_2 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-mysql-model-v2.test.ts + TEST_SUITE: src/__tests__/api_canary.test.ts CLI_REGION: ap-southeast-2 depend-on: - publish_to_local_registry - - identifier: rds_mysql_model_v2eu_west_2 + - identifier: api_canaryeu_west_2 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-mysql-model-v2.test.ts + TEST_SUITE: src/__tests__/api_canary.test.ts CLI_REGION: eu-west-2 depend-on: - publish_to_local_registry - - identifier: rds_mysql_model_v2us_west_2 + - identifier: api_canaryus_west_2 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-mysql-model-v2.test.ts + TEST_SUITE: src/__tests__/api_canary.test.ts CLI_REGION: us-west-2 depend-on: - publish_to_local_registry - - identifier: rds_mysql_model_v2ap_southeast_1 + - identifier: api_canaryap_southeast_1 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-mysql-model-v2.test.ts + TEST_SUITE: src/__tests__/api_canary.test.ts CLI_REGION: ap-southeast-1 depend-on: - publish_to_local_registry - - identifier: rds_mysql_model_v2ca_central_1 + - identifier: api_canaryca_central_1 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-mysql-model-v2.test.ts + TEST_SUITE: src/__tests__/api_canary.test.ts CLI_REGION: ca-central-1 depend-on: - publish_to_local_registry - - identifier: rds_mysql_model_v2eu_north_1 + - identifier: api_canaryeu_north_1 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-mysql-model-v2.test.ts + TEST_SUITE: src/__tests__/api_canary.test.ts CLI_REGION: eu-north-1 depend-on: - publish_to_local_registry - - identifier: rds_mysql_model_v2me_south_1 + - identifier: api_canaryme_south_1 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-mysql-model-v2.test.ts + TEST_SUITE: src/__tests__/api_canary.test.ts CLI_REGION: me-south-1 depend-on: - publish_to_local_registry - - identifier: rds_mysql_model_v2eu_west_3 + - identifier: api_canaryeu_west_3 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-mysql-model-v2.test.ts + TEST_SUITE: src/__tests__/api_canary.test.ts CLI_REGION: eu-west-3 depend-on: - publish_to_local_registry - - identifier: rds_mysql_model_v2eu_west_1 + - identifier: api_canaryeu_west_1 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-mysql-model-v2.test.ts + TEST_SUITE: src/__tests__/api_canary.test.ts CLI_REGION: eu-west-1 depend-on: - publish_to_local_registry - - identifier: rds_mysql_model_v2sa_east_1 + - identifier: api_canarysa_east_1 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-mysql-model-v2.test.ts + TEST_SUITE: src/__tests__/api_canary.test.ts CLI_REGION: sa-east-1 depend-on: - publish_to_local_registry - - identifier: rds_mysql_model_v2us_east_1 + - identifier: api_canaryus_east_1 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-mysql-model-v2.test.ts + TEST_SUITE: src/__tests__/api_canary.test.ts CLI_REGION: us-east-1 depend-on: - publish_to_local_registry - - identifier: rds_mysql_model_v2ap_northeast_1 + - identifier: api_canaryap_northeast_1 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-mysql-model-v2.test.ts + TEST_SUITE: src/__tests__/api_canary.test.ts CLI_REGION: ap-northeast-1 depend-on: - publish_to_local_registry - - identifier: rds_mysql_model_v2us_west_1 + - identifier: api_canaryus_west_1 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-mysql-model-v2.test.ts + TEST_SUITE: src/__tests__/api_canary.test.ts CLI_REGION: us-west-1 depend-on: - publish_to_local_registry - - identifier: rds_mysql_model_v2eu_south_1 + - identifier: api_canaryeu_south_1 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-mysql-model-v2.test.ts + TEST_SUITE: src/__tests__/api_canary.test.ts CLI_REGION: eu-south-1 depend-on: - publish_to_local_registry - - identifier: rds_mysql_model_v2ap_east_1 + - identifier: api_canaryap_east_1 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-mysql-model-v2.test.ts + TEST_SUITE: src/__tests__/api_canary.test.ts CLI_REGION: ap-east-1 depend-on: - publish_to_local_registry - - identifier: rds_mysql_multi_auth_1 - buildspec: codebuild_specs/run_e2e_tests.yml - env: - compute-type: BUILD_GENERAL1_SMALL - variables: - TEST_SUITE: src/__tests__/rds-mysql-multi-auth-1.test.ts - CLI_REGION: ap-northeast-2 - depend-on: - - publish_to_local_registry - - identifier: rds_mysql_oidc_auth - buildspec: codebuild_specs/run_e2e_tests.yml - env: - compute-type: BUILD_GENERAL1_SMALL - variables: - TEST_SUITE: src/__tests__/rds-mysql-oidc-auth.test.ts - CLI_REGION: ap-south-1 - depend-on: - - publish_to_local_registry - - identifier: rds_mysql_refers_to_fields - buildspec: codebuild_specs/run_e2e_tests.yml - env: - compute-type: BUILD_GENERAL1_SMALL - variables: - TEST_SUITE: src/__tests__/rds-mysql-refers-to-fields.test.ts - CLI_REGION: us-east-2 - depend-on: - - publish_to_local_registry - - identifier: rds_mysql_refers_to - buildspec: codebuild_specs/run_e2e_tests.yml - env: - compute-type: BUILD_GENERAL1_SMALL - variables: - TEST_SUITE: src/__tests__/rds-mysql-refers-to.test.ts - CLI_REGION: eu-central-1 - depend-on: - - publish_to_local_registry - - identifier: rds_mysql_userpool_auth - buildspec: codebuild_specs/run_e2e_tests.yml - env: - compute-type: BUILD_GENERAL1_SMALL - variables: - TEST_SUITE: src/__tests__/rds-mysql-userpool-auth.test.ts - CLI_REGION: ap-southeast-2 - depend-on: - - publish_to_local_registry - - identifier: rds_mysql_v2_generate_schema - buildspec: codebuild_specs/run_e2e_tests.yml - env: - compute-type: BUILD_GENERAL1_SMALL - variables: - TEST_SUITE: src/__tests__/rds-mysql-v2-generate-schema.test.ts - CLI_REGION: eu-west-2 - depend-on: - - publish_to_local_registry - - identifier: rds_pg_array_objects + - identifier: rds_mysql_auth_apikey_lambda buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-pg-array-objects.test.ts - CLI_REGION: us-west-2 + TEST_SUITE: src/__tests__/rds-mysql-auth-apikey-lambda.test.ts + CLI_REGION: ap-northeast-1 depend-on: - publish_to_local_registry - - identifier: rds_pg_auth_apikey_lambda + - identifier: rds_mysql_auth_iam_apikey_lambda_subscription buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-pg-auth-apikey-lambda.test.ts - CLI_REGION: ap-southeast-1 + TEST_SUITE: src/__tests__/rds-mysql-auth-iam-apikey-lambda-subscription.test.ts + CLI_REGION: us-west-1 depend-on: - publish_to_local_registry - - identifier: rds_pg_auth_iam_apikey_lambda_subscription + - identifier: rds_mysql_auth_iam buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-pg-auth-iam-apikey-lambda-subscription.test.ts + TEST_SUITE: src/__tests__/rds-mysql-auth-iam.test.ts CLI_REGION: ca-central-1 depend-on: - publish_to_local_registry - - identifier: rds_pg_auth_iam + - identifier: rds_mysql_custom_claims_refersto_auth buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-pg-auth-iam.test.ts + TEST_SUITE: src/__tests__/rds-mysql-custom-claims-refersto-auth.test.ts CLI_REGION: eu-north-1 depend-on: - publish_to_local_registry - - identifier: rds_pg_custom_claims_refersto_auth - buildspec: codebuild_specs/run_e2e_tests.yml - env: - compute-type: BUILD_GENERAL1_SMALL - variables: - TEST_SUITE: src/__tests__/rds-pg-custom-claims-refersto-auth.test.ts - CLI_REGION: me-south-1 - depend-on: - - publish_to_local_registry - - identifier: rds_pg_import + - identifier: rds_mysql_model_v2 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-pg-import.test.ts - CLI_REGION: eu-west-3 - depend-on: - - publish_to_local_registry - - identifier: rds_pg_model_v2ap_northeast_2 - buildspec: codebuild_specs/run_e2e_tests.yml - env: - compute-type: BUILD_GENERAL1_SMALL - variables: - TEST_SUITE: src/__tests__/rds-pg-model-v2.test.ts + TEST_SUITE: src/__tests__/rds-mysql-model-v2.test.ts CLI_REGION: ap-northeast-2 depend-on: - publish_to_local_registry - - identifier: rds_pg_model_v2ap_south_1 + - identifier: rds_mysql_multi_auth_1 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-pg-model-v2.test.ts + TEST_SUITE: src/__tests__/rds-mysql-multi-auth-1.test.ts CLI_REGION: ap-south-1 depend-on: - publish_to_local_registry - - identifier: rds_pg_model_v2us_east_2 + - identifier: rds_mysql_oidc_auth buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-pg-model-v2.test.ts + TEST_SUITE: src/__tests__/rds-mysql-oidc-auth.test.ts CLI_REGION: us-east-2 depend-on: - publish_to_local_registry - - identifier: rds_pg_model_v2eu_central_1 + - identifier: rds_mysql_refers_to_fields buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-pg-model-v2.test.ts + TEST_SUITE: src/__tests__/rds-mysql-refers-to-fields.test.ts CLI_REGION: eu-central-1 depend-on: - publish_to_local_registry - - identifier: rds_pg_model_v2ap_southeast_2 + - identifier: rds_mysql_refers_to buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-pg-model-v2.test.ts + TEST_SUITE: src/__tests__/rds-mysql-refers-to.test.ts CLI_REGION: ap-southeast-2 depend-on: - publish_to_local_registry - - identifier: rds_pg_model_v2eu_west_2 + - identifier: rds_mysql_userpool_auth buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-pg-model-v2.test.ts + TEST_SUITE: src/__tests__/rds-mysql-userpool-auth.test.ts CLI_REGION: eu-west-2 depend-on: - publish_to_local_registry - - identifier: rds_pg_model_v2us_west_2 + - identifier: rds_mysql_v2_generate_schema buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-pg-model-v2.test.ts + TEST_SUITE: src/__tests__/rds-mysql-v2-generate-schema.test.ts CLI_REGION: us-west-2 depend-on: - publish_to_local_registry - - identifier: rds_pg_model_v2ap_southeast_1 + - identifier: rds_pg_array_objects buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-pg-model-v2.test.ts + TEST_SUITE: src/__tests__/rds-pg-array-objects.test.ts CLI_REGION: ap-southeast-1 depend-on: - publish_to_local_registry - - identifier: rds_pg_model_v2ca_central_1 + - identifier: rds_pg_auth_apikey_lambda buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-pg-model-v2.test.ts + TEST_SUITE: src/__tests__/rds-pg-auth-apikey-lambda.test.ts CLI_REGION: ca-central-1 depend-on: - publish_to_local_registry - - identifier: rds_pg_model_v2eu_north_1 + - identifier: rds_pg_auth_iam_apikey_lambda_subscription buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-pg-model-v2.test.ts + TEST_SUITE: src/__tests__/rds-pg-auth-iam-apikey-lambda-subscription.test.ts CLI_REGION: eu-north-1 depend-on: - publish_to_local_registry - - identifier: rds_pg_model_v2me_south_1 + - identifier: rds_pg_auth_iam buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-pg-model-v2.test.ts - CLI_REGION: me-south-1 + TEST_SUITE: src/__tests__/rds-pg-auth-iam.test.ts + CLI_REGION: ap-southeast-2 depend-on: - publish_to_local_registry - - identifier: rds_pg_model_v2eu_west_3 + - identifier: rds_pg_custom_claims_refersto_auth buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-pg-model-v2.test.ts + TEST_SUITE: src/__tests__/rds-pg-custom-claims-refersto-auth.test.ts CLI_REGION: eu-west-3 depend-on: - publish_to_local_registry - - identifier: rds_pg_model_v2eu_west_1 + - identifier: rds_pg_import buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-pg-model-v2.test.ts + TEST_SUITE: src/__tests__/rds-pg-import.test.ts CLI_REGION: eu-west-1 depend-on: - publish_to_local_registry - - identifier: rds_pg_model_v2sa_east_1 + - identifier: rds_pg_model_v2 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL @@ -833,58 +725,13 @@ batch: CLI_REGION: sa-east-1 depend-on: - publish_to_local_registry - - identifier: rds_pg_model_v2us_east_1 - buildspec: codebuild_specs/run_e2e_tests.yml - env: - compute-type: BUILD_GENERAL1_SMALL - variables: - TEST_SUITE: src/__tests__/rds-pg-model-v2.test.ts - CLI_REGION: us-east-1 - depend-on: - - publish_to_local_registry - - identifier: rds_pg_model_v2ap_northeast_1 - buildspec: codebuild_specs/run_e2e_tests.yml - env: - compute-type: BUILD_GENERAL1_SMALL - variables: - TEST_SUITE: src/__tests__/rds-pg-model-v2.test.ts - CLI_REGION: ap-northeast-1 - depend-on: - - publish_to_local_registry - - identifier: rds_pg_model_v2us_west_1 - buildspec: codebuild_specs/run_e2e_tests.yml - env: - compute-type: BUILD_GENERAL1_SMALL - variables: - TEST_SUITE: src/__tests__/rds-pg-model-v2.test.ts - CLI_REGION: us-west-1 - depend-on: - - publish_to_local_registry - - identifier: rds_pg_model_v2eu_south_1 - buildspec: codebuild_specs/run_e2e_tests.yml - env: - compute-type: BUILD_GENERAL1_SMALL - variables: - TEST_SUITE: src/__tests__/rds-pg-model-v2.test.ts - CLI_REGION: eu-south-1 - depend-on: - - publish_to_local_registry - - identifier: rds_pg_model_v2ap_east_1 - buildspec: codebuild_specs/run_e2e_tests.yml - env: - compute-type: BUILD_GENERAL1_SMALL - variables: - TEST_SUITE: src/__tests__/rds-pg-model-v2.test.ts - CLI_REGION: ap-east-1 - depend-on: - - publish_to_local_registry - identifier: rds_pg_oidc_auth buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/rds-pg-oidc-auth.test.ts - CLI_REGION: eu-west-1 + CLI_REGION: us-east-1 depend-on: - publish_to_local_registry - identifier: rds_pg_refers_to_fields @@ -893,7 +740,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/rds-pg-refers-to-fields.test.ts - CLI_REGION: sa-east-1 + CLI_REGION: ap-northeast-1 depend-on: - publish_to_local_registry - identifier: rds_pg_refers_to @@ -902,7 +749,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/rds-pg-refers-to.test.ts - CLI_REGION: us-east-1 + CLI_REGION: us-west-1 depend-on: - publish_to_local_registry - identifier: rds_pg_relational_directives @@ -911,7 +758,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/rds-pg-relational-directives.test.ts - CLI_REGION: ap-northeast-1 + CLI_REGION: eu-west-1 depend-on: - publish_to_local_registry - identifier: rds_pg_userpool_auth @@ -920,7 +767,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/rds-pg-userpool-auth.test.ts - CLI_REGION: us-west-1 + CLI_REGION: sa-east-1 depend-on: - publish_to_local_registry - identifier: rds_pg_v2_generate_schema @@ -929,7 +776,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/rds-pg-v2-generate-schema.test.ts - CLI_REGION: eu-south-1 + CLI_REGION: ap-northeast-2 depend-on: - publish_to_local_registry - identifier: rds_relational_directives @@ -938,7 +785,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/rds-relational-directives.test.ts - CLI_REGION: ap-east-1 + CLI_REGION: ap-south-1 depend-on: - publish_to_local_registry - identifier: rds_v2_test_utils @@ -947,7 +794,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/rds-v2-test-utils.test.ts - CLI_REGION: ap-northeast-2 + CLI_REGION: us-east-2 depend-on: - publish_to_local_registry - identifier: schema_model @@ -956,7 +803,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/schema-model.test.ts - CLI_REGION: ap-south-1 + CLI_REGION: eu-central-1 depend-on: - publish_to_local_registry - identifier: apigw @@ -965,7 +812,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/apigw.test.ts - CLI_REGION: us-east-2 + CLI_REGION: ap-southeast-2 depend-on: - publish_to_local_registry - identifier: containers_api_2 @@ -983,7 +830,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/schema-auth-14.test.ts - CLI_REGION: ap-southeast-2 + CLI_REGION: us-west-2 depend-on: - publish_to_local_registry - identifier: schema_auth_7 @@ -992,7 +839,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/schema-auth-7.test.ts - CLI_REGION: eu-west-2 + CLI_REGION: ap-southeast-1 depend-on: - publish_to_local_registry - identifier: schema_auth_9 @@ -1001,91 +848,10 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/schema-auth-9.test.ts - CLI_REGION: us-west-2 - depend-on: - - publish_to_local_registry - - identifier: api_1ap_northeast_2 - buildspec: codebuild_specs/run_e2e_tests.yml - env: - compute-type: BUILD_GENERAL1_SMALL - variables: - TEST_SUITE: src/__tests__/api_1.test.ts - CLI_REGION: ap-northeast-2 - depend-on: - - publish_to_local_registry - - identifier: api_1ap_south_1 - buildspec: codebuild_specs/run_e2e_tests.yml - env: - compute-type: BUILD_GENERAL1_SMALL - variables: - TEST_SUITE: src/__tests__/api_1.test.ts - CLI_REGION: ap-south-1 - depend-on: - - publish_to_local_registry - - identifier: api_1us_east_2 - buildspec: codebuild_specs/run_e2e_tests.yml - env: - compute-type: BUILD_GENERAL1_SMALL - variables: - TEST_SUITE: src/__tests__/api_1.test.ts - CLI_REGION: us-east-2 - depend-on: - - publish_to_local_registry - - identifier: api_1eu_central_1 - buildspec: codebuild_specs/run_e2e_tests.yml - env: - compute-type: BUILD_GENERAL1_SMALL - variables: - TEST_SUITE: src/__tests__/api_1.test.ts - CLI_REGION: eu-central-1 - depend-on: - - publish_to_local_registry - - identifier: api_1ap_southeast_2 - buildspec: codebuild_specs/run_e2e_tests.yml - env: - compute-type: BUILD_GENERAL1_SMALL - variables: - TEST_SUITE: src/__tests__/api_1.test.ts - CLI_REGION: ap-southeast-2 - depend-on: - - publish_to_local_registry - - identifier: api_1eu_west_2 - buildspec: codebuild_specs/run_e2e_tests.yml - env: - compute-type: BUILD_GENERAL1_SMALL - variables: - TEST_SUITE: src/__tests__/api_1.test.ts - CLI_REGION: eu-west-2 - depend-on: - - publish_to_local_registry - - identifier: api_1us_west_2 - buildspec: codebuild_specs/run_e2e_tests.yml - env: - compute-type: BUILD_GENERAL1_SMALL - variables: - TEST_SUITE: src/__tests__/api_1.test.ts - CLI_REGION: us-west-2 - depend-on: - - publish_to_local_registry - - identifier: api_1ap_southeast_1 - buildspec: codebuild_specs/run_e2e_tests.yml - env: - compute-type: BUILD_GENERAL1_SMALL - variables: - TEST_SUITE: src/__tests__/api_1.test.ts - CLI_REGION: ap-southeast-1 - depend-on: - - publish_to_local_registry - - identifier: api_1ca_central_1 - buildspec: codebuild_specs/run_e2e_tests.yml - env: - compute-type: BUILD_GENERAL1_SMALL - variables: - TEST_SUITE: src/__tests__/api_1.test.ts CLI_REGION: ca-central-1 depend-on: - publish_to_local_registry - - identifier: api_1eu_north_1 + - identifier: api_1 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL @@ -1094,94 +860,13 @@ batch: CLI_REGION: eu-north-1 depend-on: - publish_to_local_registry - - identifier: api_1me_south_1 - buildspec: codebuild_specs/run_e2e_tests.yml - env: - compute-type: BUILD_GENERAL1_SMALL - variables: - TEST_SUITE: src/__tests__/api_1.test.ts - CLI_REGION: me-south-1 - depend-on: - - publish_to_local_registry - - identifier: api_1eu_west_3 - buildspec: codebuild_specs/run_e2e_tests.yml - env: - compute-type: BUILD_GENERAL1_SMALL - variables: - TEST_SUITE: src/__tests__/api_1.test.ts - CLI_REGION: eu-west-3 - depend-on: - - publish_to_local_registry - - identifier: api_1eu_west_1 - buildspec: codebuild_specs/run_e2e_tests.yml - env: - compute-type: BUILD_GENERAL1_SMALL - variables: - TEST_SUITE: src/__tests__/api_1.test.ts - CLI_REGION: eu-west-1 - depend-on: - - publish_to_local_registry - - identifier: api_1sa_east_1 - buildspec: codebuild_specs/run_e2e_tests.yml - env: - compute-type: BUILD_GENERAL1_SMALL - variables: - TEST_SUITE: src/__tests__/api_1.test.ts - CLI_REGION: sa-east-1 - depend-on: - - publish_to_local_registry - - identifier: api_1us_east_1 - buildspec: codebuild_specs/run_e2e_tests.yml - env: - compute-type: BUILD_GENERAL1_SMALL - variables: - TEST_SUITE: src/__tests__/api_1.test.ts - CLI_REGION: us-east-1 - depend-on: - - publish_to_local_registry - - identifier: api_1ap_northeast_1 - buildspec: codebuild_specs/run_e2e_tests.yml - env: - compute-type: BUILD_GENERAL1_SMALL - variables: - TEST_SUITE: src/__tests__/api_1.test.ts - CLI_REGION: ap-northeast-1 - depend-on: - - publish_to_local_registry - - identifier: api_1us_west_1 - buildspec: codebuild_specs/run_e2e_tests.yml - env: - compute-type: BUILD_GENERAL1_SMALL - variables: - TEST_SUITE: src/__tests__/api_1.test.ts - CLI_REGION: us-west-1 - depend-on: - - publish_to_local_registry - - identifier: api_1eu_south_1 - buildspec: codebuild_specs/run_e2e_tests.yml - env: - compute-type: BUILD_GENERAL1_SMALL - variables: - TEST_SUITE: src/__tests__/api_1.test.ts - CLI_REGION: eu-south-1 - depend-on: - - publish_to_local_registry - - identifier: api_1ap_east_1 - buildspec: codebuild_specs/run_e2e_tests.yml - env: - compute-type: BUILD_GENERAL1_SMALL - variables: - TEST_SUITE: src/__tests__/api_1.test.ts - CLI_REGION: ap-east-1 - depend-on: - - publish_to_local_registry - identifier: schema_auth_5 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/schema-auth-5.test.ts - CLI_REGION: ap-southeast-1 + CLI_REGION: me-south-1 depend-on: - publish_to_local_registry - identifier: searchable_datastore @@ -1190,7 +875,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/graphql-v2/searchable-datastore.test.ts - CLI_REGION: ca-central-1 + CLI_REGION: eu-west-3 USE_PARENT_ACCOUNT: 1 depend-on: - publish_to_local_registry @@ -1200,7 +885,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/schema-iterative-update-4.test.ts - CLI_REGION: eu-north-1 + CLI_REGION: eu-west-1 depend-on: - publish_to_local_registry - identifier: schema_searchable @@ -1209,7 +894,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/schema-searchable.test.ts - CLI_REGION: us-east-1 + CLI_REGION: sa-east-1 USE_PARENT_ACCOUNT: 1 depend-on: - publish_to_local_registry @@ -1219,7 +904,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/schema-auth-6.test.ts - CLI_REGION: eu-west-1 + CLI_REGION: ap-northeast-1 depend-on: - publish_to_local_registry - identifier: schema_connection @@ -1228,7 +913,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/schema-connection.test.ts - CLI_REGION: sa-east-1 + CLI_REGION: us-west-1 depend-on: - publish_to_local_registry - identifier: searchable_previous_deployment_had_node_to_node @@ -1238,7 +923,7 @@ batch: variables: TEST_SUITE: >- src/__tests__/graphql-v2/searchable-node-to-node-encryption/searchable-previous-deployment-had-node-to-node.test.ts - CLI_REGION: us-east-1 + CLI_REGION: eu-south-1 depend-on: - publish_to_local_registry - identifier: searchable_previous_deployment_no_node_to_node @@ -1248,7 +933,7 @@ batch: variables: TEST_SUITE: >- src/__tests__/graphql-v2/searchable-node-to-node-encryption/searchable-previous-deployment-no-node-to-node.test.ts - CLI_REGION: ap-northeast-1 + CLI_REGION: ap-east-1 depend-on: - publish_to_local_registry - identifier: api_2 @@ -1257,7 +942,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/api_2.test.ts - CLI_REGION: us-west-1 + CLI_REGION: ap-northeast-2 depend-on: - publish_to_local_registry - identifier: searchable_migration @@ -1266,71 +951,80 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/transformer-migrations/searchable-migration.test.ts - CLI_REGION: ap-southeast-2 + CLI_REGION: ap-south-1 USE_PARENT_ACCOUNT: 1 depend-on: - publish_to_local_registry - - identifier: add_resources_admin_role_all_auth_modes_amplify_table_2 + - identifier: add_resources_all_auth_modes_amplify_table_2_custom_logic buildspec: codebuild_specs/run_cdk_tests.yml env: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: >- - src/__tests__/add-resources.test.ts|src/__tests__/admin-role.test.ts|src/__tests__/all-auth-modes.test.ts|src/__tests__/amplify-table-2.test.ts + src/__tests__/add-resources.test.ts|src/__tests__/all-auth-modes.test.ts|src/__tests__/amplify-table-2.test.ts|src/__tests__/custom-logic.test.ts CLI_REGION: ap-northeast-2 depend-on: - publish_to_local_registry - - identifier: custom_logic_data_construct_3_gsis_10k_records_3_gsis_1k_records + - identifier: data_construct_3_gsis_10k_records_3_gsis_1k_records_3_gsis_empty_table buildspec: codebuild_specs/run_cdk_tests.yml env: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: >- - src/__tests__/custom-logic.test.ts|src/__tests__/data-construct.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/3-gsis-10k-records.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/3-gsis-1k-records.test.ts - CLI_REGION: us-east-2 + src/__tests__/data-construct.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/3-gsis-10k-records.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/3-gsis-1k-records.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/3-gsis-empty-table.test.ts + CLI_REGION: eu-central-1 depend-on: - publish_to_local_registry - identifier: >- - 3_gsis_empty_table_3_gsis_single_record_replace_2_gsis_10k_records_replace_2_gsis_1k_records + 3_gsis_single_record_replace_2_gsis_10k_records_replace_2_gsis_1k_records_replace_2_gsis_empty_table buildspec: codebuild_specs/run_cdk_tests.yml env: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: >- - src/__tests__/deploy-velocity-temporarily-disabled/3-gsis-empty-table.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/3-gsis-single-record.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-10k-records.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-1k-records.test.ts - CLI_REGION: eu-central-1 + src/__tests__/deploy-velocity-temporarily-disabled/3-gsis-single-record.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-10k-records.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-1k-records.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-empty-table.test.ts + CLI_REGION: ap-southeast-2 depend-on: - publish_to_local_registry - identifier: >- - replace_2_gsis_empty_table_replace_2_gsis_single_record_replace_2_gsis_update_attr_10k_records_replace_2_gsis_update_attr_1k_re + replace_2_gsis_single_record_replace_2_gsis_update_attr_10k_records_replace_2_gsis_update_attr_1k_records_replace_2_gsis_update buildspec: codebuild_specs/run_cdk_tests.yml env: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: >- - src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-empty-table.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-single-record.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-update-attr-10k-records.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-update-attr-1k-records.test.ts - CLI_REGION: ap-southeast-2 + src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-single-record.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-update-attr-10k-records.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-update-attr-1k-records.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-update-attr-empty-table.test.ts + CLI_REGION: eu-west-2 depend-on: - publish_to_local_registry - identifier: >- - replace_2_gsis_update_attr_empty_table_replace_2_gsis_update_attr_single_record_single_gsi_10k_records_single_gsi_1k_records + replace_2_gsis_update_attr_single_record_single_gsi_10k_records_single_gsi_1k_records_single_gsi_empty_table buildspec: codebuild_specs/run_cdk_tests.yml env: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: >- - src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-update-attr-empty-table.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-update-attr-single-record.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/single-gsi-10k-records.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/single-gsi-1k-records.test.ts - CLI_REGION: eu-west-2 + src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-update-attr-single-record.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/single-gsi-10k-records.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/single-gsi-1k-records.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/single-gsi-empty-table.test.ts + CLI_REGION: us-west-2 depend-on: - publish_to_local_registry - - identifier: single_gsi_empty_table_single_gsi_single_record_relationships_sql_models + - identifier: single_gsi_single_record_relationships_sql_models buildspec: codebuild_specs/run_cdk_tests.yml env: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: >- - src/__tests__/deploy-velocity-temporarily-disabled/single-gsi-empty-table.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/single-gsi-single-record.test.ts|src/__tests__/relationships.test.ts|src/__tests__/sql-models.test.ts - CLI_REGION: us-west-2 + src/__tests__/deploy-velocity-temporarily-disabled/single-gsi-single-record.test.ts|src/__tests__/relationships.test.ts|src/__tests__/sql-models.test.ts + CLI_REGION: ap-southeast-1 + depend-on: + - publish_to_local_registry + - identifier: admin_role + buildspec: codebuild_specs/run_cdk_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/admin-role.test.ts + CLI_REGION: ap-south-1 depend-on: - publish_to_local_registry - identifier: amplify_table_1 @@ -1339,7 +1033,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/amplify-table-1.test.ts - CLI_REGION: ap-south-1 + CLI_REGION: us-east-2 depend-on: - publish_to_local_registry - identifier: base_cdkap_northeast_2 @@ -1519,7 +1213,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/deploy-velocity/3-gsis-100k-records.test.ts - CLI_REGION: ap-southeast-1 + CLI_REGION: ca-central-1 depend-on: - publish_to_local_registry - identifier: replace_2_gsis_100k_records @@ -1528,7 +1222,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/deploy-velocity/replace-2-gsis-100k-records.test.ts - CLI_REGION: ca-central-1 + CLI_REGION: eu-north-1 depend-on: - publish_to_local_registry - identifier: replace_2_gsis_update_attr_100k_records @@ -1538,7 +1232,7 @@ batch: variables: TEST_SUITE: >- src/__tests__/deploy-velocity/replace-2-gsis-update-attr-100k-records.test.ts - CLI_REGION: eu-north-1 + CLI_REGION: me-south-1 depend-on: - publish_to_local_registry - identifier: single_gsi_100k_records @@ -1547,7 +1241,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/deploy-velocity/single-gsi-100k-records.test.ts - CLI_REGION: me-south-1 + CLI_REGION: eu-west-3 depend-on: - publish_to_local_registry - identifier: >- @@ -1705,13 +1399,13 @@ batch: depend-on: - publish_to_local_registry - identifier: >- - SearchableWithAuthTests_SearchableModelTransformer_SearchableWithAuthV2_SearchableWithAuthV2WithFF + SearchableModelTransformer_SearchableWithAuthV2_SearchableWithAuthV2WithFF buildspec: codebuild_specs/graphql_e2e_tests.yml env: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: >- - src/__tests__/SearchableWithAuthTests.e2e.test.ts|src/__tests__/SearchableModelTransformer.e2e.test.ts|src/__tests__/SearchableWithAuthV2.e2e.test.ts|src/__tests__/SearchableWithAuthV2WithFF.e2e.test.ts + src/__tests__/SearchableModelTransformer.e2e.test.ts|src/__tests__/SearchableWithAuthV2.e2e.test.ts|src/__tests__/SearchableWithAuthV2WithFF.e2e.test.ts CLI_REGION: eu-south-1 depend-on: - publish_to_local_registry @@ -1743,6 +1437,15 @@ batch: CLI_REGION: ap-southeast-1 depend-on: - publish_to_local_registry + - identifier: SearchableWithAuthTests + buildspec: codebuild_specs/graphql_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/SearchableWithAuthTests.e2e.test.ts + CLI_REGION: ap-east-1 + depend-on: + - publish_to_local_registry - identifier: cleanup_e2e_resources buildspec: codebuild_specs/cleanup_e2e_resources.yml env: diff --git a/scripts/split-e2e-tests.ts b/scripts/split-e2e-tests.ts index 1aaf1fe9e9..6c70ec2f1a 100644 --- a/scripts/split-e2e-tests.ts +++ b/scripts/split-e2e-tests.ts @@ -6,9 +6,8 @@ import * as yaml from 'js-yaml'; const REPO_ROOT = join(__dirname, '..'); const SUPPORTED_REGIONS_PATH = join(REPO_ROOT, 'scripts', 'e2e-test-regions.json'); const AMPLIFY_SUPPORTED_REGIONS: string[] = JSON.parse(fs.readFileSync(SUPPORTED_REGIONS_PATH, 'utf-8')); -// const AWS_REGIONS_TO_RUN_TESTS = AMPLIFY_SUPPORTED_REGIONS.filter((region) => !['me-south-1', 'eu-south-1'].includes(region)); const AWS_REGIONS_TO_RUN_TESTS = AMPLIFY_SUPPORTED_REGIONS; -const SUPPORTED_OPT_IN_REGIONS = ['eu-south-1', 'ap-east-1', 'me-south-1']; +const SUPPORTED_OPT_IN_REGIONS = ['ap-east-1', 'eu-south-1', 'me-south-1']; type ForceTests = 'interactions' | 'containers'; type TestTiming = { @@ -123,17 +122,23 @@ const RUN_SOLO: (string | RegExp)[] = [ // CDK tests /src\/__tests__\/base-cdk.*\.test\.ts/, 'src/__tests__/amplify-table-1.test.ts', + 'src/__tests__/api_canary.test.ts', + 'src/__tests__/admin-role.test.ts', + 'src/__tests__/SearchableWithAuthTests.e2e.test.ts', ]; const RUN_IN_ALL_REGIONS = [ - // SQL tests one per supported engines - /src\/__tests__\/rds-.*-model-v2\.test\.ts/, // DDB tests - 'src/__tests__/api_1.test.ts', + 'src/__tests__/api_canary.test.ts', // CDK tests 'src/__tests__/base-cdk.test.ts', ]; +const RUN_IN_NON_OPT_IN_REGIONS: (string | RegExp)[] = [ + // SQL tests + /src\/__tests__\/rds-.*\.test\.ts/, +]; + const DEBUG_FLAG = '--debug'; const EXCLUDE_TEST_IDS: string[] = []; @@ -224,6 +229,11 @@ const splitTests = (baseJobLinux: any, testDirectory: string, pickTests?: (testS newSoloJob.region = nonOptInRegions[jobIdx % nonOptInRegions.length]; } } + if (RUN_IN_NON_OPT_IN_REGIONS.find((nonOptInTest) => test === nonOptInTest || test.match(nonOptInTest))) { + if (SUPPORTED_OPT_IN_REGIONS.includes(newSoloJob.region)) { + newSoloJob.region = nonOptInRegions[jobIdx % nonOptInRegions.length]; + } + } soloJobs.push(newSoloJob); continue; } From 44df205ccf5e7f15b8fc69ec0377f97f45355486 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 20 Feb 2024 18:41:48 +0000 Subject: [PATCH 31/45] chore(deps): bump ip from 1.1.8 to 1.1.9 Bumps [ip](https://github.com/indutny/node-ip) from 1.1.8 to 1.1.9. - [Commits](https://github.com/indutny/node-ip/compare/v1.1.8...v1.1.9) --- updated-dependencies: - dependency-name: ip dependency-type: indirect ... Signed-off-by: dependabot[bot] --- yarn.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/yarn.lock b/yarn.lock index 99615e8c2d..122b7c26b0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -14015,14 +14015,14 @@ invariant@^2.2.4: loose-envify "^1.0.0" ip@^1.1.5, ip@^1.1.8: - version "1.1.8" - resolved "https://registry.yarnpkg.com/ip/-/ip-1.1.8.tgz#ae05948f6b075435ed3307acce04629da8cdbf48" - integrity sha512-PuExPYUiu6qMBQb4l06ecm6T6ujzhmh+MeJcW9wa89PoAz5pvd4zPgN5WJV104mb6S2T1AwNIAaB70JNrLQWhg== + version "1.1.9" + resolved "https://registry.yarnpkg.com/ip/-/ip-1.1.9.tgz#8dfbcc99a754d07f425310b86a99546b1151e396" + integrity sha512-cyRxvOEpNHNtchU3Ln9KC/auJgup87llfQpQ+t5ghoC/UhL16SWzbueiCsdTnWmqAWl7LadfuwhlqmtOaqMHdQ== ip@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ip/-/ip-2.0.0.tgz#4cf4ab182fee2314c75ede1276f8c80b479936da" - integrity sha512-WKa+XuLG1A1R0UWhl2+1XQSi+fZWMsYKffMZTTYsiZaUD8k2yDAj5atimTUD2TZkyCkNEeYE5NhFZmupOGtjYQ== + version "2.0.1" + resolved "https://registry.yarnpkg.com/ip/-/ip-2.0.1.tgz#e8f3595d33a3ea66490204234b77636965307105" + integrity sha512-lJUL9imLTNi1ZfXT+DU6rBBdbiKGBuay9B6xGSPVjUeQwaH1RIGqef8RZkUtHioLmSNpPR5M4HVKJGm1j8FWVQ== ipaddr.js@1.9.1: version "1.9.1" From f1d92bd578d225f6e34552e85f2df9ea511423ef Mon Sep 17 00:00:00 2001 From: Christopher Sundersingh <83315412+sundersc@users.noreply.github.com> Date: Tue, 20 Feb 2024 10:53:59 -0800 Subject: [PATCH 32/45] chore(ci): emit canary metrics on each region test (#2283) * chore(ci): emit canary metrics on each region test * add region to emitted metrics --- codebuild_specs/createapi_canary_workflow.yml | 46 ++++++++----------- ...ry_metric.yml => run_canary_e2e_tests.yml} | 12 ++++- shared-scripts.sh | 2 +- 3 files changed, 32 insertions(+), 28 deletions(-) rename codebuild_specs/{emit_createapi_canary_metric.yml => run_canary_e2e_tests.yml} (53%) diff --git a/codebuild_specs/createapi_canary_workflow.yml b/codebuild_specs/createapi_canary_workflow.yml index aab31b586c..22656bb2b9 100644 --- a/codebuild_specs/createapi_canary_workflow.yml +++ b/codebuild_specs/createapi_canary_workflow.yml @@ -28,7 +28,7 @@ batch: depend-on: - build_linux - identifier: api_test_us_east_1 - buildspec: codebuild_specs/run_e2e_tests.yml + buildspec: codebuild_specs/run_canary_e2e_tests.yml env: compute-type: BUILD_GENERAL1_MEDIUM variables: @@ -38,7 +38,7 @@ batch: depend-on: - publish_to_local_registry - identifier: api_test_ap_northeast_2 - buildspec: codebuild_specs/run_e2e_tests.yml + buildspec: codebuild_specs/run_canary_e2e_tests.yml env: compute-type: BUILD_GENERAL1_MEDIUM variables: @@ -48,7 +48,7 @@ batch: depend-on: - publish_to_local_registry - identifier: api_test_ap_south_1 - buildspec: codebuild_specs/run_e2e_tests.yml + buildspec: codebuild_specs/run_canary_e2e_tests.yml env: compute-type: BUILD_GENERAL1_MEDIUM variables: @@ -58,7 +58,7 @@ batch: depend-on: - publish_to_local_registry - identifier: api_test_ap_southeast_2 - buildspec: codebuild_specs/run_e2e_tests.yml + buildspec: codebuild_specs/run_canary_e2e_tests.yml env: compute-type: BUILD_GENERAL1_MEDIUM variables: @@ -68,7 +68,7 @@ batch: depend-on: - publish_to_local_registry - identifier: api_test_eu_central_1 - buildspec: codebuild_specs/run_e2e_tests.yml + buildspec: codebuild_specs/run_canary_e2e_tests.yml env: compute-type: BUILD_GENERAL1_MEDIUM variables: @@ -78,7 +78,7 @@ batch: depend-on: - publish_to_local_registry - identifier: api_test_us_east_2 - buildspec: codebuild_specs/run_e2e_tests.yml + buildspec: codebuild_specs/run_canary_e2e_tests.yml env: compute-type: BUILD_GENERAL1_MEDIUM variables: @@ -88,7 +88,7 @@ batch: depend-on: - publish_to_local_registry - identifier: api_test_ap_southeast_1 - buildspec: codebuild_specs/run_e2e_tests.yml + buildspec: codebuild_specs/run_canary_e2e_tests.yml env: compute-type: BUILD_GENERAL1_MEDIUM variables: @@ -98,7 +98,7 @@ batch: depend-on: - publish_to_local_registry - identifier: api_test_ca_central_1 - buildspec: codebuild_specs/run_e2e_tests.yml + buildspec: codebuild_specs/run_canary_e2e_tests.yml env: compute-type: BUILD_GENERAL1_MEDIUM variables: @@ -108,7 +108,7 @@ batch: depend-on: - publish_to_local_registry - identifier: api_test_eu_west_2 - buildspec: codebuild_specs/run_e2e_tests.yml + buildspec: codebuild_specs/run_canary_e2e_tests.yml env: compute-type: BUILD_GENERAL1_MEDIUM variables: @@ -118,7 +118,7 @@ batch: depend-on: - publish_to_local_registry - identifier: api_test_us_west_2 - buildspec: codebuild_specs/run_e2e_tests.yml + buildspec: codebuild_specs/run_canary_e2e_tests.yml env: compute-type: BUILD_GENERAL1_MEDIUM variables: @@ -128,7 +128,7 @@ batch: depend-on: - publish_to_local_registry # - identifier: api_test_ap_east_1 - # buildspec: codebuild_specs/run_e2e_tests.yml + # buildspec: codebuild_specs/run_canary_e2e_tests.yml # env: # compute-type: BUILD_GENERAL1_MEDIUM # variables: @@ -138,7 +138,7 @@ batch: # depend-on: # - publish_to_local_registry - identifier: api_test_ap_northeast_1 - buildspec: codebuild_specs/run_e2e_tests.yml + buildspec: codebuild_specs/run_canary_e2e_tests.yml env: compute-type: BUILD_GENERAL1_MEDIUM variables: @@ -148,7 +148,7 @@ batch: depend-on: - publish_to_local_registry - identifier: api_test_ap_northeast_3 - buildspec: codebuild_specs/run_e2e_tests.yml + buildspec: codebuild_specs/run_canary_e2e_tests.yml env: compute-type: BUILD_GENERAL1_MEDIUM variables: @@ -158,7 +158,7 @@ batch: depend-on: - publish_to_local_registry - identifier: api_test_eu_north_1 - buildspec: codebuild_specs/run_e2e_tests.yml + buildspec: codebuild_specs/run_canary_e2e_tests.yml env: compute-type: BUILD_GENERAL1_MEDIUM variables: @@ -168,7 +168,7 @@ batch: depend-on: - publish_to_local_registry - identifier: api_test_eu_west_1 - buildspec: codebuild_specs/run_e2e_tests.yml + buildspec: codebuild_specs/run_canary_e2e_tests.yml env: compute-type: BUILD_GENERAL1_MEDIUM variables: @@ -178,7 +178,7 @@ batch: depend-on: - publish_to_local_registry # - identifier: api_test_eu_south_1 - # buildspec: codebuild_specs/run_e2e_tests.yml + # buildspec: codebuild_specs/run_canary_e2e_tests.yml # env: # compute-type: BUILD_GENERAL1_MEDIUM # variables: @@ -188,7 +188,7 @@ batch: # depend-on: # - publish_to_local_registry - identifier: api_test_eu_west_3 - buildspec: codebuild_specs/run_e2e_tests.yml + buildspec: codebuild_specs/run_canary_e2e_tests.yml env: compute-type: BUILD_GENERAL1_MEDIUM variables: @@ -198,7 +198,7 @@ batch: depend-on: - publish_to_local_registry # - identifier: api_test_me_south_1 - # buildspec: codebuild_specs/run_e2e_tests.yml + # buildspec: codebuild_specs/run_canary_e2e_tests.yml # env: # compute-type: BUILD_GENERAL1_MEDIUM # variables: @@ -208,7 +208,7 @@ batch: # depend-on: # - publish_to_local_registry - identifier: api_test_sa_east_1 - buildspec: codebuild_specs/run_e2e_tests.yml + buildspec: codebuild_specs/run_canary_e2e_tests.yml env: compute-type: BUILD_GENERAL1_MEDIUM variables: @@ -218,7 +218,7 @@ batch: depend-on: - publish_to_local_registry - identifier: api_test_us_west_1 - buildspec: codebuild_specs/run_e2e_tests.yml + buildspec: codebuild_specs/run_canary_e2e_tests.yml env: compute-type: BUILD_GENERAL1_MEDIUM variables: @@ -227,12 +227,6 @@ batch: CLI_REGION: us-west-1 depend-on: - publish_to_local_registry - - identifier: report_status - buildspec: codebuild_specs/emit_createapi_canary_metric.yml - env: - compute-type: BUILD_GENERAL1_SMALL - depend-on: - - api_test_us_east_1 # - identifier: cleanup_e2e_resources # buildspec: codebuild_specs/cleanup_e2e_resources.yml # env: diff --git a/codebuild_specs/emit_createapi_canary_metric.yml b/codebuild_specs/run_canary_e2e_tests.yml similarity index 53% rename from codebuild_specs/emit_createapi_canary_metric.yml rename to codebuild_specs/run_canary_e2e_tests.yml index a6299e727b..cec310b7b5 100644 --- a/codebuild_specs/emit_createapi_canary_metric.yml +++ b/codebuild_specs/run_canary_e2e_tests.yml @@ -9,7 +9,17 @@ env: NODE_OPTIONS: --max-old-space-size=8096 phases: build: + commands: + - codebuild-breakpoint + - source ./shared-scripts.sh && _setupE2ETestsLinux + - source ./shared-scripts.sh && _runE2ETestsLinux + post_build: commands: - source ./shared-scripts.sh && _unassumeTestAccountCredentials - aws sts get-caller-identity - - source ./shared-scripts.sh && _emitCreateApiCanaryMetric + - source ./shared-scripts.sh && _scanArtifacts && _emitCreateApiCanaryMetric + +artifacts: + files: + - '**/*' + base-directory: $CODEBUILD_SRC_DIR/packages/amplify-e2e-tests/amplify-e2e-reports diff --git a/shared-scripts.sh b/shared-scripts.sh index 9333979c6f..3cd785242e 100755 --- a/shared-scripts.sh +++ b/shared-scripts.sh @@ -445,6 +445,6 @@ function _emitCreateApiCanaryMetric { --namespace amplify-category-api-e2e-tests \ --unit Count \ --value $CODEBUILD_BUILD_SUCCEEDING \ - --dimensions branch=main \ + --dimensions branch=main,region=$CLI_REGION \ --region us-west-2 } From ab9fc4008d4359973b23b46aa93a46809ba594d6 Mon Sep 17 00:00:00 2001 From: phani-srikar Date: Tue, 20 Feb 2024 11:54:05 -0800 Subject: [PATCH 33/45] chore: fix admin-role cdk test --- codebuild_specs/e2e_workflow.yml | 79 ++++++++----------- .../src/cleanup-e2e-resources.ts | 4 +- .../src/__tests__/admin-role.test.ts | 13 ++- .../src/lambda-request.ts | 13 ++- scripts/split-e2e-tests.ts | 58 +++++++------- 5 files changed, 89 insertions(+), 78 deletions(-) diff --git a/codebuild_specs/e2e_workflow.yml b/codebuild_specs/e2e_workflow.yml index 7dfec42a49..08942f0fcb 100644 --- a/codebuild_specs/e2e_workflow.yml +++ b/codebuild_specs/e2e_workflow.yml @@ -923,7 +923,7 @@ batch: variables: TEST_SUITE: >- src/__tests__/graphql-v2/searchable-node-to-node-encryption/searchable-previous-deployment-had-node-to-node.test.ts - CLI_REGION: eu-south-1 + CLI_REGION: ap-northeast-1 depend-on: - publish_to_local_registry - identifier: searchable_previous_deployment_no_node_to_node @@ -933,7 +933,7 @@ batch: variables: TEST_SUITE: >- src/__tests__/graphql-v2/searchable-node-to-node-encryption/searchable-previous-deployment-no-node-to-node.test.ts - CLI_REGION: ap-east-1 + CLI_REGION: us-west-1 depend-on: - publish_to_local_registry - identifier: api_2 @@ -955,76 +955,67 @@ batch: USE_PARENT_ACCOUNT: 1 depend-on: - publish_to_local_registry - - identifier: add_resources_all_auth_modes_amplify_table_2_custom_logic + - identifier: add_resources_admin_role_all_auth_modes_amplify_table_2 buildspec: codebuild_specs/run_cdk_tests.yml env: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: >- - src/__tests__/add-resources.test.ts|src/__tests__/all-auth-modes.test.ts|src/__tests__/amplify-table-2.test.ts|src/__tests__/custom-logic.test.ts + src/__tests__/add-resources.test.ts|src/__tests__/admin-role.test.ts|src/__tests__/all-auth-modes.test.ts|src/__tests__/amplify-table-2.test.ts CLI_REGION: ap-northeast-2 depend-on: - publish_to_local_registry - - identifier: data_construct_3_gsis_10k_records_3_gsis_1k_records_3_gsis_empty_table + - identifier: custom_logic_data_construct_3_gsis_10k_records_3_gsis_1k_records buildspec: codebuild_specs/run_cdk_tests.yml env: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: >- - src/__tests__/data-construct.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/3-gsis-10k-records.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/3-gsis-1k-records.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/3-gsis-empty-table.test.ts - CLI_REGION: eu-central-1 + src/__tests__/custom-logic.test.ts|src/__tests__/data-construct.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/3-gsis-10k-records.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/3-gsis-1k-records.test.ts + CLI_REGION: us-east-2 depend-on: - publish_to_local_registry - identifier: >- - 3_gsis_single_record_replace_2_gsis_10k_records_replace_2_gsis_1k_records_replace_2_gsis_empty_table + 3_gsis_empty_table_3_gsis_single_record_replace_2_gsis_10k_records_replace_2_gsis_1k_records buildspec: codebuild_specs/run_cdk_tests.yml env: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: >- - src/__tests__/deploy-velocity-temporarily-disabled/3-gsis-single-record.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-10k-records.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-1k-records.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-empty-table.test.ts - CLI_REGION: ap-southeast-2 + src/__tests__/deploy-velocity-temporarily-disabled/3-gsis-empty-table.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/3-gsis-single-record.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-10k-records.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-1k-records.test.ts + CLI_REGION: eu-central-1 depend-on: - publish_to_local_registry - identifier: >- - replace_2_gsis_single_record_replace_2_gsis_update_attr_10k_records_replace_2_gsis_update_attr_1k_records_replace_2_gsis_update + replace_2_gsis_empty_table_replace_2_gsis_single_record_replace_2_gsis_update_attr_10k_records_replace_2_gsis_update_attr_1k_re buildspec: codebuild_specs/run_cdk_tests.yml env: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: >- - src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-single-record.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-update-attr-10k-records.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-update-attr-1k-records.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-update-attr-empty-table.test.ts - CLI_REGION: eu-west-2 + src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-empty-table.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-single-record.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-update-attr-10k-records.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-update-attr-1k-records.test.ts + CLI_REGION: ap-southeast-2 depend-on: - publish_to_local_registry - identifier: >- - replace_2_gsis_update_attr_single_record_single_gsi_10k_records_single_gsi_1k_records_single_gsi_empty_table + replace_2_gsis_update_attr_empty_table_replace_2_gsis_update_attr_single_record_single_gsi_10k_records_single_gsi_1k_records buildspec: codebuild_specs/run_cdk_tests.yml env: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: >- - src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-update-attr-single-record.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/single-gsi-10k-records.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/single-gsi-1k-records.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/single-gsi-empty-table.test.ts - CLI_REGION: us-west-2 + src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-update-attr-empty-table.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-update-attr-single-record.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/single-gsi-10k-records.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/single-gsi-1k-records.test.ts + CLI_REGION: eu-west-2 depend-on: - publish_to_local_registry - - identifier: single_gsi_single_record_relationships_sql_models + - identifier: single_gsi_empty_table_single_gsi_single_record_relationships buildspec: codebuild_specs/run_cdk_tests.yml env: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: >- - src/__tests__/deploy-velocity-temporarily-disabled/single-gsi-single-record.test.ts|src/__tests__/relationships.test.ts|src/__tests__/sql-models.test.ts - CLI_REGION: ap-southeast-1 - depend-on: - - publish_to_local_registry - - identifier: admin_role - buildspec: codebuild_specs/run_cdk_tests.yml - env: - compute-type: BUILD_GENERAL1_SMALL - variables: - TEST_SUITE: src/__tests__/admin-role.test.ts - CLI_REGION: ap-south-1 + src/__tests__/deploy-velocity-temporarily-disabled/single-gsi-empty-table.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/single-gsi-single-record.test.ts|src/__tests__/relationships.test.ts + CLI_REGION: us-west-2 depend-on: - publish_to_local_registry - identifier: amplify_table_1 @@ -1033,7 +1024,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/amplify-table-1.test.ts - CLI_REGION: us-east-2 + CLI_REGION: ap-south-1 depend-on: - publish_to_local_registry - identifier: base_cdkap_northeast_2 @@ -1213,7 +1204,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/deploy-velocity/3-gsis-100k-records.test.ts - CLI_REGION: ca-central-1 + CLI_REGION: ap-southeast-1 depend-on: - publish_to_local_registry - identifier: replace_2_gsis_100k_records @@ -1222,7 +1213,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/deploy-velocity/replace-2-gsis-100k-records.test.ts - CLI_REGION: eu-north-1 + CLI_REGION: ca-central-1 depend-on: - publish_to_local_registry - identifier: replace_2_gsis_update_attr_100k_records @@ -1232,7 +1223,7 @@ batch: variables: TEST_SUITE: >- src/__tests__/deploy-velocity/replace-2-gsis-update-attr-100k-records.test.ts - CLI_REGION: me-south-1 + CLI_REGION: eu-north-1 depend-on: - publish_to_local_registry - identifier: single_gsi_100k_records @@ -1241,6 +1232,15 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/deploy-velocity/single-gsi-100k-records.test.ts + CLI_REGION: me-south-1 + depend-on: + - publish_to_local_registry + - identifier: sql_models + buildspec: codebuild_specs/run_cdk_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/sql-models.test.ts CLI_REGION: eu-west-3 depend-on: - publish_to_local_registry @@ -1399,14 +1399,14 @@ batch: depend-on: - publish_to_local_registry - identifier: >- - SearchableModelTransformer_SearchableWithAuthV2_SearchableWithAuthV2WithFF + SearchableWithAuthTests_SearchableModelTransformer_SearchableWithAuthV2_SearchableWithAuthV2WithFF buildspec: codebuild_specs/graphql_e2e_tests.yml env: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: >- - src/__tests__/SearchableModelTransformer.e2e.test.ts|src/__tests__/SearchableWithAuthV2.e2e.test.ts|src/__tests__/SearchableWithAuthV2WithFF.e2e.test.ts - CLI_REGION: eu-south-1 + src/__tests__/SearchableWithAuthTests.e2e.test.ts|src/__tests__/SearchableModelTransformer.e2e.test.ts|src/__tests__/SearchableWithAuthV2.e2e.test.ts|src/__tests__/SearchableWithAuthV2WithFF.e2e.test.ts + CLI_REGION: us-east-2 depend-on: - publish_to_local_registry - identifier: FunctionTransformerTestsV2 @@ -1437,15 +1437,6 @@ batch: CLI_REGION: ap-southeast-1 depend-on: - publish_to_local_registry - - identifier: SearchableWithAuthTests - buildspec: codebuild_specs/graphql_e2e_tests.yml - env: - compute-type: BUILD_GENERAL1_SMALL - variables: - TEST_SUITE: src/__tests__/SearchableWithAuthTests.e2e.test.ts - CLI_REGION: ap-east-1 - depend-on: - - publish_to_local_registry - identifier: cleanup_e2e_resources buildspec: codebuild_specs/cleanup_e2e_resources.yml env: diff --git a/packages/amplify-e2e-tests/src/cleanup-e2e-resources.ts b/packages/amplify-e2e-tests/src/cleanup-e2e-resources.ts index 87844d0b83..e143d01f5e 100644 --- a/packages/amplify-e2e-tests/src/cleanup-e2e-resources.ts +++ b/packages/amplify-e2e-tests/src/cleanup-e2e-resources.ts @@ -164,7 +164,7 @@ const getAmplifyApps = async (account: AWSAccountInfo, region: string): Promise< amplifyApps = await amplifyClient.listApps({ maxResults: 50 }).promise(); // keeping it to 50 as max supported is 50 } catch (e) { // Do not fail the cleanup and continue - console.log(`Listing apps for account ${account}-${region} failed with error with code ${e?.code}. Skipping.`); + console.log(`Listing apps for account ${account.accountId}-${region} failed with error with code ${e?.code}. Skipping.`); return result; } @@ -257,7 +257,7 @@ const getStacks = async (account: AWSAccountInfo, region: string): Promise { ], }); const outputs = await cdkDeploy(projRoot, '--all'); - const { awsAppsyncApiEndpoint: apiEndpoint, awsAppsyncApiKey: apiKey, ApiInvokerFunctionName: functionName } = outputs[name]; + const { + awsAppsyncApiEndpoint: apiEndpoint, + awsAppsyncApiKey: apiKey, + ApiInvokerFunctionName: functionName, + awsAppsyncRegion: region, + } = outputs[name]; const testTitle = crypto.randomUUID(); // Validate that the lambda can be invoked to create a record via signed IAM admin role. - const invokeResult = await invokeGraphqlProxyLambda(functionName, { title: testTitle }); + const invokeResult = await invokeGraphqlProxyLambda( + functionName, + { title: testTitle }, + region, + ); // And the result object is returned expect(invokeResult.createTodo.title).toEqual(testTitle); diff --git a/packages/amplify-graphql-api-construct-tests/src/lambda-request.ts b/packages/amplify-graphql-api-construct-tests/src/lambda-request.ts index a70b77b211..85ffd81f5d 100644 --- a/packages/amplify-graphql-api-construct-tests/src/lambda-request.ts +++ b/packages/amplify-graphql-api-construct-tests/src/lambda-request.ts @@ -4,10 +4,15 @@ import { LambdaClient, InvokeCommand } from '@aws-sdk/client-lambda'; * Invoke a lambda function given the function name, and input payload. * @param functionName the function to invoke * @param payload the function request payload + * @param region the region where function is deployed * @returns the function response body */ -export const invokeLambda = async (functionName: string, payload: RequestType): Promise => { - const client = new LambdaClient({}); +export const invokeLambda = async ( + functionName: string, + payload: RequestType, + region: string, +): Promise => { + const client = new LambdaClient({ region }); const { Payload } = await client.send( new InvokeCommand({ FunctionName: functionName, @@ -33,13 +38,15 @@ export type GraphqlProxiedLambdaResponse = { * Invoke a lambda function which executes a graphql operation. Assert response code was 200, and return the wrapped data object. * @param functionName the function to invoke * @param payload the function request payload + * @param region the region where function is deployed * @returns the graphql wrapped data payload */ export const invokeGraphqlProxyLambda = async ( functionName: string, payload: RequestType, + region: string, ): Promise => { - const lambdaResponse = await invokeLambda>(functionName, payload); + const lambdaResponse = await invokeLambda>(functionName, payload, region); expect(lambdaResponse.statusCode).toEqual(200); return lambdaResponse.body.data; }; diff --git a/scripts/split-e2e-tests.ts b/scripts/split-e2e-tests.ts index 6c70ec2f1a..498f39ed10 100644 --- a/scripts/split-e2e-tests.ts +++ b/scripts/split-e2e-tests.ts @@ -123,8 +123,7 @@ const RUN_SOLO: (string | RegExp)[] = [ /src\/__tests__\/base-cdk.*\.test\.ts/, 'src/__tests__/amplify-table-1.test.ts', 'src/__tests__/api_canary.test.ts', - 'src/__tests__/admin-role.test.ts', - 'src/__tests__/SearchableWithAuthTests.e2e.test.ts', + 'src/__tests__/sql-models.test.ts', ]; const RUN_IN_ALL_REGIONS = [ @@ -137,6 +136,8 @@ const RUN_IN_ALL_REGIONS = [ const RUN_IN_NON_OPT_IN_REGIONS: (string | RegExp)[] = [ // SQL tests /src\/__tests__\/rds-.*\.test\.ts/, + // Searchable tests + /src\/__tests__\/.*searchable.*\.test\.ts/, ]; const DEBUG_FLAG = '--debug'; @@ -145,6 +146,8 @@ const EXCLUDE_TEST_IDS: string[] = []; const MAX_WORKERS = 4; +const nonOptInRegions = AWS_REGIONS_TO_RUN_TESTS.filter((region) => !SUPPORTED_OPT_IN_REGIONS.includes(region)); + // eslint-disable-next-line import/namespace const loadConfigBase = (): ConfigBase => yaml.load(fs.readFileSync(CODEBUILD_CONFIG_BASE_PATH, 'utf8')) as ConfigBase; @@ -197,13 +200,7 @@ const splitTests = (baseJobLinux: any, testDirectory: string, pickTests?: (testS for (const test of testSuites) { const currentJob = osJobs[osJobs.length - 1]; - const FORCE_REGION = Object.keys(FORCE_REGION_MAP).find((key) => { - const testName = getTestNameFromPath(test); - return testName.startsWith(key); - }); - const USE_PARENT = USE_PARENT_ACCOUNT.some((usesParent) => test.startsWith(usesParent)); - const nonOptInRegions = AWS_REGIONS_TO_RUN_TESTS.filter((region) => !SUPPORTED_OPT_IN_REGIONS.includes(region)); if (RUN_SOLO.find((solo) => test === solo || test.match(solo))) { if (RUN_IN_ALL_REGIONS.find((allRegions) => test === allRegions || test.match(allRegions))) { @@ -219,36 +216,20 @@ const splitTests = (baseJobLinux: any, testDirectory: string, pickTests?: (testS const newSoloJob = createJob(os, jobIdx, true); jobIdx++; newSoloJob.tests.push(test); - if (FORCE_REGION) { - newSoloJob.region = FORCE_REGION_MAP[FORCE_REGION as ForceTests]; - } + if (USE_PARENT) { newSoloJob.useParentAccount = true; - // parent E2E account does not have opt-in regions. Choose non-opt-in region. - if (SUPPORTED_OPT_IN_REGIONS.includes(newSoloJob.region)) { - newSoloJob.region = nonOptInRegions[jobIdx % nonOptInRegions.length]; - } - } - if (RUN_IN_NON_OPT_IN_REGIONS.find((nonOptInTest) => test === nonOptInTest || test.match(nonOptInTest))) { - if (SUPPORTED_OPT_IN_REGIONS.includes(newSoloJob.region)) { - newSoloJob.region = nonOptInRegions[jobIdx % nonOptInRegions.length]; - } } + setJobRegion(test, newSoloJob, jobIdx); soloJobs.push(newSoloJob); continue; } // add the test currentJob.tests.push(test); - if (FORCE_REGION) { - currentJob.region = FORCE_REGION_MAP[FORCE_REGION as ForceTests]; - } + setJobRegion(test, currentJob, jobIdx); if (USE_PARENT) { currentJob.useParentAccount = true; - // parent E2E account does not have opt-in regions. Choose non-opt-in region. - if (SUPPORTED_OPT_IN_REGIONS.includes(currentJob.region)) { - currentJob.region = nonOptInRegions[jobIdx % nonOptInRegions.length]; - } } // create a new job once the current job is full; @@ -284,6 +265,29 @@ const splitTests = (baseJobLinux: any, testDirectory: string, pickTests?: (testS return result; }; +const setJobRegion = (test: string, job: CandidateJob, jobIdx: number) => { + const FORCE_REGION = Object.keys(FORCE_REGION_MAP).find((key) => { + const testName = getTestNameFromPath(test); + return testName.startsWith(key); + }); + + if (FORCE_REGION) { + job.region = FORCE_REGION_MAP[FORCE_REGION as ForceTests]; + return; + } + + // Parent E2E account does not have opt-in regions. Choose non-opt-in region. + // If the tests are explicitly specified as to be run in non-opt-in regions, follow that. + if ( + RUN_IN_NON_OPT_IN_REGIONS.find((nonOptInTest) => test.toLowerCase() === nonOptInTest || test.toLowerCase().match(nonOptInTest)) || + USE_PARENT_ACCOUNT.some((usesParent) => test.startsWith(usesParent)) + ) { + if (SUPPORTED_OPT_IN_REGIONS.includes(job.region)) { + job.region = nonOptInRegions[jobIdx % nonOptInRegions.length]; + } + } +}; + const main = (): void => { const filteredTests = process.argv.slice(2); const configBase: ConfigBase = loadConfigBase(); From c4e65721dcbf099c4b710e1e7417bf5ebf51b849 Mon Sep 17 00:00:00 2001 From: phani-srikar Date: Tue, 20 Feb 2024 11:58:39 -0800 Subject: [PATCH 34/45] chore: lint fix --- .../amplify-graphql-api-construct-tests/src/commands.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/amplify-graphql-api-construct-tests/src/commands.ts b/packages/amplify-graphql-api-construct-tests/src/commands.ts index f75d99cb27..0cba9778fa 100644 --- a/packages/amplify-graphql-api-construct-tests/src/commands.ts +++ b/packages/amplify-graphql-api-construct-tests/src/commands.ts @@ -98,7 +98,11 @@ export const cdkDeploy = async (cwd: string, option: string, props?: CdkDeployPr // Checks and succeeds early (a no-op) if the account-region combination is already bootstrapped. await spawn(getNpxPath(), ['cdk', 'bootstrap'], commandOptions).runAsync(); - await spawn(getNpxPath(), ['cdk', 'deploy', '--outputs-file', 'outputs.json', '--require-approval', 'never', option], commandOptions).runAsync(); + await spawn( + getNpxPath(), + ['cdk', 'deploy', '--outputs-file', 'outputs.json', '--require-approval', 'never', option], + commandOptions, + ).runAsync(); return JSON.parse(readFileSync(path.join(cwd, 'outputs.json'), 'utf8')); }; From b2f7d8580f658645652c8f34ac1435c2dffe5a65 Mon Sep 17 00:00:00 2001 From: Christopher Sundersingh <83315412+sundersc@users.noreply.github.com> Date: Wed, 21 Feb 2024 07:27:59 -0800 Subject: [PATCH 35/45] chore(ci): add max socket to npm config (#2288) --- shared-scripts.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/shared-scripts.sh b/shared-scripts.sh index 3cd785242e..963bb15c64 100755 --- a/shared-scripts.sh +++ b/shared-scripts.sh @@ -181,8 +181,9 @@ function _installCLIFromLocalRegistry { # set longer timeout to avoid socket timeout error npm config set fetch-retries 5 npm config set fetch-timeout 600000 - npm config set fetch-retry-mintimeout 20000 - npm config set fetch-retry-maxtimeout 120000 + npm config set fetch-retry-mintimeout 30000 + npm config set fetch-retry-maxtimeout 180000 + npm config set maxsockets 1 npm install -g @aws-amplify/cli-internal echo "using Amplify CLI version: "$(amplify --version) npm list -g --depth=1 | grep -e '@aws-amplify/amplify-category-api' -e 'amplify-codegen' From f66070086c2f375648c2a2c982b4d4647121bd61 Mon Sep 17 00:00:00 2001 From: phani-srikar Date: Wed, 21 Feb 2024 12:31:55 -0800 Subject: [PATCH 36/45] chore: test regions file to include optionality info --- codebuild_specs/e2e_workflow.yml | 362 +++++++++--------- .../src/cleanup-e2e-resources.ts | 36 +- packages/amplify-e2e-tests/tsconfig.json | 3 +- scripts/e2e-test-regions.json | 38 +- scripts/split-e2e-tests.ts | 26 +- shared-scripts.sh | 5 +- 6 files changed, 244 insertions(+), 226 deletions(-) diff --git a/codebuild_specs/e2e_workflow.yml b/codebuild_specs/e2e_workflow.yml index 08942f0fcb..e6bd3395ab 100644 --- a/codebuild_specs/e2e_workflow.yml +++ b/codebuild_specs/e2e_workflow.yml @@ -67,7 +67,7 @@ batch: variables: TEST_SUITE: >- src/__tests__/auth_2.test.ts|src/__tests__/datastore-modelgen.test.ts|src/__tests__/amplify-app.test.ts|src/__tests__/graphql-v2/custom-transformers.test.ts - CLI_REGION: ap-northeast-2 + CLI_REGION: ap-east-1 depend-on: - publish_to_local_registry - identifier: >- @@ -78,7 +78,7 @@ batch: variables: TEST_SUITE: >- src/__tests__/mock-api.test.ts|src/__tests__/graphql-v2/invalid-input-arguments.test.ts|src/__tests__/schema-versioned.test.ts|src/__tests__/schema-data-access-patterns.test.ts - CLI_REGION: ap-south-1 + CLI_REGION: ap-northeast-1 depend-on: - publish_to_local_registry - identifier: predictions_migration_function_10_schema_predictions_api_7 @@ -88,7 +88,7 @@ batch: variables: TEST_SUITE: >- src/__tests__/transformer-migrations/predictions-migration.test.ts|src/__tests__/function_10.test.ts|src/__tests__/schema-predictions.test.ts|src/__tests__/api_7.test.ts - CLI_REGION: us-east-2 + CLI_REGION: ap-northeast-2 depend-on: - publish_to_local_registry - identifier: http_migration_global_sandbox_schema_function_2_api_connection_migration @@ -98,7 +98,7 @@ batch: variables: TEST_SUITE: >- src/__tests__/transformer-migrations/http-migration.test.ts|src/__tests__/global_sandbox.test.ts|src/__tests__/schema-function-2.test.ts|src/__tests__/migration/api.connection.migration.test.ts - CLI_REGION: eu-west-2 + CLI_REGION: ap-southeast-2 depend-on: - publish_to_local_registry - identifier: api_8_schema_iterative_update_3_auth_migration_lambda_conflict_handler @@ -108,7 +108,7 @@ batch: variables: TEST_SUITE: >- src/__tests__/api_8.test.ts|src/__tests__/schema-iterative-update-3.test.ts|src/__tests__/transformer-migrations/auth-migration.test.ts|src/__tests__/graphql-v2/lambda-conflict-handler.test.ts - CLI_REGION: me-south-1 + CLI_REGION: eu-west-1 depend-on: - publish_to_local_registry - identifier: >- @@ -119,7 +119,7 @@ batch: variables: TEST_SUITE: >- src/__tests__/schema-iterative-update-1.test.ts|src/__tests__/schema-iterative-update-locking.test.ts|src/__tests__/graphql-v2/index-with-stack-mappings.test.ts|src/__tests__/api_4.test.ts - CLI_REGION: ap-northeast-1 + CLI_REGION: us-east-1 depend-on: - publish_to_local_registry - identifier: >- @@ -130,7 +130,7 @@ batch: variables: TEST_SUITE: >- src/__tests__/custom_policies_container.test.ts|src/__tests__/schema-iterative-update-2.test.ts|src/__tests__/migration/api.connection.migration2.test.ts|src/__tests__/api_5.test.ts - CLI_REGION: ap-south-1 + CLI_REGION: ap-northeast-1 depend-on: - publish_to_local_registry - identifier: containers_api_secrets_schema_function_1_api_3_generate_ts_data_schema @@ -150,7 +150,7 @@ batch: variables: TEST_SUITE: >- src/__tests__/sql-generate-unauth.test.ts|src/__tests__/resolvers.test.ts|src/__tests__/graphql-v2/sync_query_datastore.test.ts|src/__tests__/api_6.test.ts - CLI_REGION: us-east-1 + CLI_REGION: sa-east-1 depend-on: - publish_to_local_registry - identifier: api_lambda_auth_api_9 @@ -160,7 +160,7 @@ batch: variables: TEST_SUITE: >- src/__tests__/graphql-v2/api_lambda_auth.test.ts|src/__tests__/api_9.test.ts - CLI_REGION: us-east-1 + CLI_REGION: sa-east-1 depend-on: - publish_to_local_registry - identifier: api_10 @@ -169,7 +169,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/api_10.test.ts - CLI_REGION: eu-central-1 + CLI_REGION: ap-south-1 depend-on: - publish_to_local_registry - identifier: rds_v2 @@ -178,7 +178,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/rds-v2.test.ts - CLI_REGION: ap-southeast-2 + CLI_REGION: ap-southeast-1 depend-on: - publish_to_local_registry - identifier: function_migration @@ -187,7 +187,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/transformer-migrations/function-migration.test.ts - CLI_REGION: us-west-2 + CLI_REGION: ca-central-1 depend-on: - publish_to_local_registry - identifier: api_key_migration3 @@ -196,7 +196,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/migration/api.key.migration3.test.ts - CLI_REGION: ap-southeast-1 + CLI_REGION: eu-central-1 USE_PARENT_ACCOUNT: 1 depend-on: - publish_to_local_registry @@ -206,7 +206,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/migration/api.key.migration5.test.ts - CLI_REGION: ca-central-1 + CLI_REGION: eu-north-1 USE_PARENT_ACCOUNT: 1 depend-on: - publish_to_local_registry @@ -216,7 +216,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/schema-iterative-update-5.test.ts - CLI_REGION: eu-north-1 + CLI_REGION: eu-south-1 depend-on: - publish_to_local_registry - identifier: model_migration @@ -225,7 +225,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/transformer-migrations/model-migration.test.ts - CLI_REGION: eu-west-3 + CLI_REGION: eu-west-2 depend-on: - publish_to_local_registry - identifier: schema_auth_10 @@ -234,7 +234,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/schema-auth-10.test.ts - CLI_REGION: eu-west-1 + CLI_REGION: eu-west-3 depend-on: - publish_to_local_registry - identifier: schema_auth_2 @@ -243,7 +243,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/schema-auth-2.test.ts - CLI_REGION: sa-east-1 + CLI_REGION: me-south-1 depend-on: - publish_to_local_registry - identifier: schema_auth_1 @@ -252,7 +252,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/schema-auth-1.test.ts - CLI_REGION: us-east-1 + CLI_REGION: sa-east-1 depend-on: - publish_to_local_registry - identifier: schema_auth_12 @@ -261,7 +261,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/schema-auth-12.test.ts - CLI_REGION: us-west-1 + CLI_REGION: us-east-2 depend-on: - publish_to_local_registry - identifier: schema_auth_13 @@ -270,7 +270,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/schema-auth-13.test.ts - CLI_REGION: eu-south-1 + CLI_REGION: us-west-1 depend-on: - publish_to_local_registry - identifier: schema_auth_15 @@ -279,7 +279,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/schema-auth-15.test.ts - CLI_REGION: ap-east-1 + CLI_REGION: us-west-2 depend-on: - publish_to_local_registry - identifier: schema_auth_3 @@ -288,7 +288,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/schema-auth-3.test.ts - CLI_REGION: ap-northeast-2 + CLI_REGION: ap-east-1 depend-on: - publish_to_local_registry - identifier: api_key_migration4 @@ -297,7 +297,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/migration/api.key.migration4.test.ts - CLI_REGION: us-east-2 + CLI_REGION: ap-northeast-2 USE_PARENT_ACCOUNT: 1 depend-on: - publish_to_local_registry @@ -307,7 +307,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/schema-iterative-rollback-1.test.ts - CLI_REGION: eu-central-1 + CLI_REGION: ap-south-1 depend-on: - publish_to_local_registry - identifier: schema_iterative_rollback_2 @@ -316,7 +316,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/schema-iterative-rollback-2.test.ts - CLI_REGION: ap-southeast-2 + CLI_REGION: ap-southeast-1 depend-on: - publish_to_local_registry - identifier: schema_key @@ -325,7 +325,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/schema-key.test.ts - CLI_REGION: eu-west-2 + CLI_REGION: ap-southeast-2 depend-on: - publish_to_local_registry - identifier: containers_api_1 @@ -343,7 +343,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/schema-auth-4.test.ts - CLI_REGION: ca-central-1 + CLI_REGION: eu-north-1 depend-on: - publish_to_local_registry - identifier: schema_auth_8 @@ -352,7 +352,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/schema-auth-8.test.ts - CLI_REGION: eu-north-1 + CLI_REGION: eu-south-1 depend-on: - publish_to_local_registry - identifier: api_key_migration2 @@ -361,7 +361,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/migration/api.key.migration2.test.ts - CLI_REGION: ap-northeast-1 + CLI_REGION: eu-west-1 USE_PARENT_ACCOUNT: 1 depend-on: - publish_to_local_registry @@ -371,7 +371,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/schema-auth-11.test.ts - CLI_REGION: eu-west-3 + CLI_REGION: eu-west-2 depend-on: - publish_to_local_registry - identifier: api_key_migration1 @@ -380,7 +380,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/migration/api.key.migration1.test.ts - CLI_REGION: eu-west-1 + CLI_REGION: eu-west-3 depend-on: - publish_to_local_registry - identifier: api_11 @@ -389,178 +389,178 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/api_11.test.ts - CLI_REGION: sa-east-1 + CLI_REGION: me-south-1 depend-on: - publish_to_local_registry - - identifier: api_canaryap_northeast_2 + - identifier: api_canary_ap_east_1 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/api_canary.test.ts - CLI_REGION: ap-northeast-2 + CLI_REGION: ap-east-1 depend-on: - publish_to_local_registry - - identifier: api_canaryap_south_1 + - identifier: api_canary_ap_northeast_1 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/api_canary.test.ts - CLI_REGION: ap-south-1 + CLI_REGION: ap-northeast-1 depend-on: - publish_to_local_registry - - identifier: api_canaryus_east_2 + - identifier: api_canary_ap_northeast_2 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/api_canary.test.ts - CLI_REGION: us-east-2 + CLI_REGION: ap-northeast-2 depend-on: - publish_to_local_registry - - identifier: api_canaryeu_central_1 + - identifier: api_canary_ap_south_1 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/api_canary.test.ts - CLI_REGION: eu-central-1 + CLI_REGION: ap-south-1 depend-on: - publish_to_local_registry - - identifier: api_canaryap_southeast_2 + - identifier: api_canary_ap_southeast_1 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/api_canary.test.ts - CLI_REGION: ap-southeast-2 + CLI_REGION: ap-southeast-1 depend-on: - publish_to_local_registry - - identifier: api_canaryeu_west_2 + - identifier: api_canary_ap_southeast_2 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/api_canary.test.ts - CLI_REGION: eu-west-2 + CLI_REGION: ap-southeast-2 depend-on: - publish_to_local_registry - - identifier: api_canaryus_west_2 + - identifier: api_canary_ca_central_1 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/api_canary.test.ts - CLI_REGION: us-west-2 + CLI_REGION: ca-central-1 depend-on: - publish_to_local_registry - - identifier: api_canaryap_southeast_1 + - identifier: api_canary_eu_central_1 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/api_canary.test.ts - CLI_REGION: ap-southeast-1 + CLI_REGION: eu-central-1 depend-on: - publish_to_local_registry - - identifier: api_canaryca_central_1 + - identifier: api_canary_eu_north_1 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/api_canary.test.ts - CLI_REGION: ca-central-1 + CLI_REGION: eu-north-1 depend-on: - publish_to_local_registry - - identifier: api_canaryeu_north_1 + - identifier: api_canary_eu_south_1 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/api_canary.test.ts - CLI_REGION: eu-north-1 + CLI_REGION: eu-south-1 depend-on: - publish_to_local_registry - - identifier: api_canaryme_south_1 + - identifier: api_canary_eu_west_1 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/api_canary.test.ts - CLI_REGION: me-south-1 + CLI_REGION: eu-west-1 depend-on: - publish_to_local_registry - - identifier: api_canaryeu_west_3 + - identifier: api_canary_eu_west_2 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/api_canary.test.ts - CLI_REGION: eu-west-3 + CLI_REGION: eu-west-2 depend-on: - publish_to_local_registry - - identifier: api_canaryeu_west_1 + - identifier: api_canary_eu_west_3 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/api_canary.test.ts - CLI_REGION: eu-west-1 + CLI_REGION: eu-west-3 depend-on: - publish_to_local_registry - - identifier: api_canarysa_east_1 + - identifier: api_canary_me_south_1 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/api_canary.test.ts - CLI_REGION: sa-east-1 + CLI_REGION: me-south-1 depend-on: - publish_to_local_registry - - identifier: api_canaryus_east_1 + - identifier: api_canary_sa_east_1 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/api_canary.test.ts - CLI_REGION: us-east-1 + CLI_REGION: sa-east-1 depend-on: - publish_to_local_registry - - identifier: api_canaryap_northeast_1 + - identifier: api_canary_us_east_1 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/api_canary.test.ts - CLI_REGION: ap-northeast-1 + CLI_REGION: us-east-1 depend-on: - publish_to_local_registry - - identifier: api_canaryus_west_1 + - identifier: api_canary_us_east_2 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/api_canary.test.ts - CLI_REGION: us-west-1 + CLI_REGION: us-east-2 depend-on: - publish_to_local_registry - - identifier: api_canaryeu_south_1 + - identifier: api_canary_us_west_1 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/api_canary.test.ts - CLI_REGION: eu-south-1 + CLI_REGION: us-west-1 depend-on: - publish_to_local_registry - - identifier: api_canaryap_east_1 + - identifier: api_canary_us_west_2 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/api_canary.test.ts - CLI_REGION: ap-east-1 + CLI_REGION: us-west-2 depend-on: - publish_to_local_registry - identifier: rds_mysql_auth_apikey_lambda @@ -569,7 +569,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/rds-mysql-auth-apikey-lambda.test.ts - CLI_REGION: ap-northeast-1 + CLI_REGION: us-east-1 depend-on: - publish_to_local_registry - identifier: rds_mysql_auth_iam_apikey_lambda_subscription @@ -578,7 +578,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/rds-mysql-auth-iam-apikey-lambda-subscription.test.ts - CLI_REGION: us-west-1 + CLI_REGION: us-east-2 depend-on: - publish_to_local_registry - identifier: rds_mysql_auth_iam @@ -587,7 +587,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/rds-mysql-auth-iam.test.ts - CLI_REGION: ca-central-1 + CLI_REGION: us-west-1 depend-on: - publish_to_local_registry - identifier: rds_mysql_custom_claims_refersto_auth @@ -596,7 +596,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/rds-mysql-custom-claims-refersto-auth.test.ts - CLI_REGION: eu-north-1 + CLI_REGION: us-west-2 depend-on: - publish_to_local_registry - identifier: rds_mysql_model_v2 @@ -605,7 +605,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/rds-mysql-model-v2.test.ts - CLI_REGION: ap-northeast-2 + CLI_REGION: eu-west-3 depend-on: - publish_to_local_registry - identifier: rds_mysql_multi_auth_1 @@ -614,7 +614,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/rds-mysql-multi-auth-1.test.ts - CLI_REGION: ap-south-1 + CLI_REGION: ap-northeast-1 depend-on: - publish_to_local_registry - identifier: rds_mysql_oidc_auth @@ -623,7 +623,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/rds-mysql-oidc-auth.test.ts - CLI_REGION: us-east-2 + CLI_REGION: ap-northeast-2 depend-on: - publish_to_local_registry - identifier: rds_mysql_refers_to_fields @@ -632,7 +632,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/rds-mysql-refers-to-fields.test.ts - CLI_REGION: eu-central-1 + CLI_REGION: ap-south-1 depend-on: - publish_to_local_registry - identifier: rds_mysql_refers_to @@ -641,7 +641,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/rds-mysql-refers-to.test.ts - CLI_REGION: ap-southeast-2 + CLI_REGION: ap-southeast-1 depend-on: - publish_to_local_registry - identifier: rds_mysql_userpool_auth @@ -650,7 +650,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/rds-mysql-userpool-auth.test.ts - CLI_REGION: eu-west-2 + CLI_REGION: ap-southeast-2 depend-on: - publish_to_local_registry - identifier: rds_mysql_v2_generate_schema @@ -659,7 +659,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/rds-mysql-v2-generate-schema.test.ts - CLI_REGION: us-west-2 + CLI_REGION: ca-central-1 depend-on: - publish_to_local_registry - identifier: rds_pg_array_objects @@ -668,7 +668,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/rds-pg-array-objects.test.ts - CLI_REGION: ap-southeast-1 + CLI_REGION: eu-central-1 depend-on: - publish_to_local_registry - identifier: rds_pg_auth_apikey_lambda @@ -677,7 +677,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/rds-pg-auth-apikey-lambda.test.ts - CLI_REGION: ca-central-1 + CLI_REGION: eu-north-1 depend-on: - publish_to_local_registry - identifier: rds_pg_auth_iam_apikey_lambda_subscription @@ -686,7 +686,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/rds-pg-auth-iam-apikey-lambda-subscription.test.ts - CLI_REGION: eu-north-1 + CLI_REGION: ap-southeast-1 depend-on: - publish_to_local_registry - identifier: rds_pg_auth_iam @@ -695,7 +695,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/rds-pg-auth-iam.test.ts - CLI_REGION: ap-southeast-2 + CLI_REGION: eu-west-1 depend-on: - publish_to_local_registry - identifier: rds_pg_custom_claims_refersto_auth @@ -704,7 +704,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/rds-pg-custom-claims-refersto-auth.test.ts - CLI_REGION: eu-west-3 + CLI_REGION: eu-west-2 depend-on: - publish_to_local_registry - identifier: rds_pg_import @@ -713,7 +713,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/rds-pg-import.test.ts - CLI_REGION: eu-west-1 + CLI_REGION: eu-west-3 depend-on: - publish_to_local_registry - identifier: rds_pg_model_v2 @@ -722,7 +722,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/rds-pg-model-v2.test.ts - CLI_REGION: sa-east-1 + CLI_REGION: eu-north-1 depend-on: - publish_to_local_registry - identifier: rds_pg_oidc_auth @@ -731,7 +731,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/rds-pg-oidc-auth.test.ts - CLI_REGION: us-east-1 + CLI_REGION: sa-east-1 depend-on: - publish_to_local_registry - identifier: rds_pg_refers_to_fields @@ -740,7 +740,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/rds-pg-refers-to-fields.test.ts - CLI_REGION: ap-northeast-1 + CLI_REGION: us-east-1 depend-on: - publish_to_local_registry - identifier: rds_pg_refers_to @@ -749,7 +749,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/rds-pg-refers-to.test.ts - CLI_REGION: us-west-1 + CLI_REGION: us-east-2 depend-on: - publish_to_local_registry - identifier: rds_pg_relational_directives @@ -758,7 +758,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/rds-pg-relational-directives.test.ts - CLI_REGION: eu-west-1 + CLI_REGION: us-west-1 depend-on: - publish_to_local_registry - identifier: rds_pg_userpool_auth @@ -767,7 +767,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/rds-pg-userpool-auth.test.ts - CLI_REGION: sa-east-1 + CLI_REGION: us-west-2 depend-on: - publish_to_local_registry - identifier: rds_pg_v2_generate_schema @@ -776,7 +776,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/rds-pg-v2-generate-schema.test.ts - CLI_REGION: ap-northeast-2 + CLI_REGION: us-east-2 depend-on: - publish_to_local_registry - identifier: rds_relational_directives @@ -785,7 +785,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/rds-relational-directives.test.ts - CLI_REGION: ap-south-1 + CLI_REGION: ap-northeast-1 depend-on: - publish_to_local_registry - identifier: rds_v2_test_utils @@ -794,7 +794,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/rds-v2-test-utils.test.ts - CLI_REGION: us-east-2 + CLI_REGION: ap-northeast-2 depend-on: - publish_to_local_registry - identifier: schema_model @@ -803,7 +803,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/schema-model.test.ts - CLI_REGION: eu-central-1 + CLI_REGION: ap-south-1 depend-on: - publish_to_local_registry - identifier: apigw @@ -812,7 +812,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/apigw.test.ts - CLI_REGION: ap-southeast-2 + CLI_REGION: ap-southeast-1 depend-on: - publish_to_local_registry - identifier: containers_api_2 @@ -830,7 +830,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/schema-auth-14.test.ts - CLI_REGION: us-west-2 + CLI_REGION: ca-central-1 depend-on: - publish_to_local_registry - identifier: schema_auth_7 @@ -839,7 +839,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/schema-auth-7.test.ts - CLI_REGION: ap-southeast-1 + CLI_REGION: eu-central-1 depend-on: - publish_to_local_registry - identifier: schema_auth_9 @@ -848,7 +848,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/schema-auth-9.test.ts - CLI_REGION: ca-central-1 + CLI_REGION: eu-north-1 depend-on: - publish_to_local_registry - identifier: api_1 @@ -857,7 +857,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/api_1.test.ts - CLI_REGION: eu-north-1 + CLI_REGION: eu-south-1 depend-on: - publish_to_local_registry - identifier: schema_auth_5 @@ -866,7 +866,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/schema-auth-5.test.ts - CLI_REGION: me-south-1 + CLI_REGION: eu-west-1 depend-on: - publish_to_local_registry - identifier: searchable_datastore @@ -875,7 +875,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/graphql-v2/searchable-datastore.test.ts - CLI_REGION: eu-west-3 + CLI_REGION: eu-west-2 USE_PARENT_ACCOUNT: 1 depend-on: - publish_to_local_registry @@ -885,7 +885,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/schema-iterative-update-4.test.ts - CLI_REGION: eu-west-1 + CLI_REGION: eu-west-3 depend-on: - publish_to_local_registry - identifier: schema_searchable @@ -894,7 +894,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/schema-searchable.test.ts - CLI_REGION: sa-east-1 + CLI_REGION: eu-west-3 USE_PARENT_ACCOUNT: 1 depend-on: - publish_to_local_registry @@ -904,7 +904,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/schema-auth-6.test.ts - CLI_REGION: ap-northeast-1 + CLI_REGION: us-east-1 depend-on: - publish_to_local_registry - identifier: schema_connection @@ -913,7 +913,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/schema-connection.test.ts - CLI_REGION: us-west-1 + CLI_REGION: us-east-2 depend-on: - publish_to_local_registry - identifier: searchable_previous_deployment_had_node_to_node @@ -923,7 +923,7 @@ batch: variables: TEST_SUITE: >- src/__tests__/graphql-v2/searchable-node-to-node-encryption/searchable-previous-deployment-had-node-to-node.test.ts - CLI_REGION: ap-northeast-1 + CLI_REGION: us-west-1 depend-on: - publish_to_local_registry - identifier: searchable_previous_deployment_no_node_to_node @@ -933,7 +933,7 @@ batch: variables: TEST_SUITE: >- src/__tests__/graphql-v2/searchable-node-to-node-encryption/searchable-previous-deployment-no-node-to-node.test.ts - CLI_REGION: us-west-1 + CLI_REGION: us-west-2 depend-on: - publish_to_local_registry - identifier: api_2 @@ -942,7 +942,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/api_2.test.ts - CLI_REGION: ap-northeast-2 + CLI_REGION: ap-east-1 depend-on: - publish_to_local_registry - identifier: searchable_migration @@ -951,7 +951,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/transformer-migrations/searchable-migration.test.ts - CLI_REGION: ap-south-1 + CLI_REGION: ap-northeast-1 USE_PARENT_ACCOUNT: 1 depend-on: - publish_to_local_registry @@ -962,7 +962,7 @@ batch: variables: TEST_SUITE: >- src/__tests__/add-resources.test.ts|src/__tests__/admin-role.test.ts|src/__tests__/all-auth-modes.test.ts|src/__tests__/amplify-table-2.test.ts - CLI_REGION: ap-northeast-2 + CLI_REGION: ap-east-1 depend-on: - publish_to_local_registry - identifier: custom_logic_data_construct_3_gsis_10k_records_3_gsis_1k_records @@ -972,7 +972,7 @@ batch: variables: TEST_SUITE: >- src/__tests__/custom-logic.test.ts|src/__tests__/data-construct.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/3-gsis-10k-records.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/3-gsis-1k-records.test.ts - CLI_REGION: us-east-2 + CLI_REGION: ap-northeast-2 depend-on: - publish_to_local_registry - identifier: >- @@ -983,7 +983,7 @@ batch: variables: TEST_SUITE: >- src/__tests__/deploy-velocity-temporarily-disabled/3-gsis-empty-table.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/3-gsis-single-record.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-10k-records.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-1k-records.test.ts - CLI_REGION: eu-central-1 + CLI_REGION: ap-south-1 depend-on: - publish_to_local_registry - identifier: >- @@ -994,7 +994,7 @@ batch: variables: TEST_SUITE: >- src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-empty-table.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-single-record.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-update-attr-10k-records.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-update-attr-1k-records.test.ts - CLI_REGION: ap-southeast-2 + CLI_REGION: ap-southeast-1 depend-on: - publish_to_local_registry - identifier: >- @@ -1005,7 +1005,7 @@ batch: variables: TEST_SUITE: >- src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-update-attr-empty-table.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-update-attr-single-record.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/single-gsi-10k-records.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/single-gsi-1k-records.test.ts - CLI_REGION: eu-west-2 + CLI_REGION: ap-southeast-2 depend-on: - publish_to_local_registry - identifier: single_gsi_empty_table_single_gsi_single_record_relationships @@ -1015,7 +1015,7 @@ batch: variables: TEST_SUITE: >- src/__tests__/deploy-velocity-temporarily-disabled/single-gsi-empty-table.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/single-gsi-single-record.test.ts|src/__tests__/relationships.test.ts - CLI_REGION: us-west-2 + CLI_REGION: ca-central-1 depend-on: - publish_to_local_registry - identifier: amplify_table_1 @@ -1024,178 +1024,178 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/amplify-table-1.test.ts - CLI_REGION: ap-south-1 + CLI_REGION: ap-northeast-1 depend-on: - publish_to_local_registry - - identifier: base_cdkap_northeast_2 + - identifier: base_cdk_ap_east_1 buildspec: codebuild_specs/run_cdk_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/base-cdk.test.ts - CLI_REGION: ap-northeast-2 + CLI_REGION: ap-east-1 depend-on: - publish_to_local_registry - - identifier: base_cdkap_south_1 + - identifier: base_cdk_ap_northeast_1 buildspec: codebuild_specs/run_cdk_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/base-cdk.test.ts - CLI_REGION: ap-south-1 + CLI_REGION: ap-northeast-1 depend-on: - publish_to_local_registry - - identifier: base_cdkus_east_2 + - identifier: base_cdk_ap_northeast_2 buildspec: codebuild_specs/run_cdk_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/base-cdk.test.ts - CLI_REGION: us-east-2 + CLI_REGION: ap-northeast-2 depend-on: - publish_to_local_registry - - identifier: base_cdkeu_central_1 + - identifier: base_cdk_ap_south_1 buildspec: codebuild_specs/run_cdk_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/base-cdk.test.ts - CLI_REGION: eu-central-1 + CLI_REGION: ap-south-1 depend-on: - publish_to_local_registry - - identifier: base_cdkap_southeast_2 + - identifier: base_cdk_ap_southeast_1 buildspec: codebuild_specs/run_cdk_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/base-cdk.test.ts - CLI_REGION: ap-southeast-2 + CLI_REGION: ap-southeast-1 depend-on: - publish_to_local_registry - - identifier: base_cdkeu_west_2 + - identifier: base_cdk_ap_southeast_2 buildspec: codebuild_specs/run_cdk_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/base-cdk.test.ts - CLI_REGION: eu-west-2 + CLI_REGION: ap-southeast-2 depend-on: - publish_to_local_registry - - identifier: base_cdkus_west_2 + - identifier: base_cdk_ca_central_1 buildspec: codebuild_specs/run_cdk_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/base-cdk.test.ts - CLI_REGION: us-west-2 + CLI_REGION: ca-central-1 depend-on: - publish_to_local_registry - - identifier: base_cdkap_southeast_1 + - identifier: base_cdk_eu_central_1 buildspec: codebuild_specs/run_cdk_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/base-cdk.test.ts - CLI_REGION: ap-southeast-1 + CLI_REGION: eu-central-1 depend-on: - publish_to_local_registry - - identifier: base_cdkca_central_1 + - identifier: base_cdk_eu_north_1 buildspec: codebuild_specs/run_cdk_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/base-cdk.test.ts - CLI_REGION: ca-central-1 + CLI_REGION: eu-north-1 depend-on: - publish_to_local_registry - - identifier: base_cdkeu_north_1 + - identifier: base_cdk_eu_south_1 buildspec: codebuild_specs/run_cdk_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/base-cdk.test.ts - CLI_REGION: eu-north-1 + CLI_REGION: eu-south-1 depend-on: - publish_to_local_registry - - identifier: base_cdkme_south_1 + - identifier: base_cdk_eu_west_1 buildspec: codebuild_specs/run_cdk_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/base-cdk.test.ts - CLI_REGION: me-south-1 + CLI_REGION: eu-west-1 depend-on: - publish_to_local_registry - - identifier: base_cdkeu_west_3 + - identifier: base_cdk_eu_west_2 buildspec: codebuild_specs/run_cdk_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/base-cdk.test.ts - CLI_REGION: eu-west-3 + CLI_REGION: eu-west-2 depend-on: - publish_to_local_registry - - identifier: base_cdkeu_west_1 + - identifier: base_cdk_eu_west_3 buildspec: codebuild_specs/run_cdk_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/base-cdk.test.ts - CLI_REGION: eu-west-1 + CLI_REGION: eu-west-3 depend-on: - publish_to_local_registry - - identifier: base_cdksa_east_1 + - identifier: base_cdk_me_south_1 buildspec: codebuild_specs/run_cdk_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/base-cdk.test.ts - CLI_REGION: sa-east-1 + CLI_REGION: me-south-1 depend-on: - publish_to_local_registry - - identifier: base_cdkus_east_1 + - identifier: base_cdk_sa_east_1 buildspec: codebuild_specs/run_cdk_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/base-cdk.test.ts - CLI_REGION: us-east-1 + CLI_REGION: sa-east-1 depend-on: - publish_to_local_registry - - identifier: base_cdkap_northeast_1 + - identifier: base_cdk_us_east_1 buildspec: codebuild_specs/run_cdk_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/base-cdk.test.ts - CLI_REGION: ap-northeast-1 + CLI_REGION: us-east-1 depend-on: - publish_to_local_registry - - identifier: base_cdkus_west_1 + - identifier: base_cdk_us_east_2 buildspec: codebuild_specs/run_cdk_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/base-cdk.test.ts - CLI_REGION: us-west-1 + CLI_REGION: us-east-2 depend-on: - publish_to_local_registry - - identifier: base_cdkeu_south_1 + - identifier: base_cdk_us_west_1 buildspec: codebuild_specs/run_cdk_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/base-cdk.test.ts - CLI_REGION: eu-south-1 + CLI_REGION: us-west-1 depend-on: - publish_to_local_registry - - identifier: base_cdkap_east_1 + - identifier: base_cdk_us_west_2 buildspec: codebuild_specs/run_cdk_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/base-cdk.test.ts - CLI_REGION: ap-east-1 + CLI_REGION: us-west-2 depend-on: - publish_to_local_registry - identifier: 3_gsis_100k_records @@ -1204,7 +1204,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/deploy-velocity/3-gsis-100k-records.test.ts - CLI_REGION: ap-southeast-1 + CLI_REGION: eu-central-1 depend-on: - publish_to_local_registry - identifier: replace_2_gsis_100k_records @@ -1213,7 +1213,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/deploy-velocity/replace-2-gsis-100k-records.test.ts - CLI_REGION: ca-central-1 + CLI_REGION: eu-north-1 depend-on: - publish_to_local_registry - identifier: replace_2_gsis_update_attr_100k_records @@ -1223,7 +1223,7 @@ batch: variables: TEST_SUITE: >- src/__tests__/deploy-velocity/replace-2-gsis-update-attr-100k-records.test.ts - CLI_REGION: eu-north-1 + CLI_REGION: eu-south-1 depend-on: - publish_to_local_registry - identifier: single_gsi_100k_records @@ -1232,7 +1232,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/deploy-velocity/single-gsi-100k-records.test.ts - CLI_REGION: me-south-1 + CLI_REGION: eu-west-1 depend-on: - publish_to_local_registry - identifier: sql_models @@ -1241,7 +1241,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/sql-models.test.ts - CLI_REGION: eu-west-3 + CLI_REGION: eu-west-2 depend-on: - publish_to_local_registry - identifier: >- @@ -1252,7 +1252,7 @@ batch: variables: TEST_SUITE: >- src/__tests__/CustomRoots.e2e.test.ts|src/__tests__/KeyTransformerLocal.e2e.test.ts|src/__tests__/NestedStacksTest.e2e.test.ts|src/__tests__/TestComplexStackMappingsLocal.e2e.test.ts - CLI_REGION: ap-northeast-2 + CLI_REGION: ap-east-1 depend-on: - publish_to_local_registry - identifier: >- @@ -1263,7 +1263,7 @@ batch: variables: TEST_SUITE: >- src/__tests__/NonModelAuthV2Function.e2e.test.ts|src/__tests__/FunctionTransformerTests.e2e.test.ts|src/__tests__/KeyWithAuth.e2e.test.ts|src/__tests__/MutationCondition.e2e.test.ts - CLI_REGION: ap-south-1 + CLI_REGION: ap-northeast-1 depend-on: - publish_to_local_registry - identifier: >- @@ -1274,7 +1274,7 @@ batch: variables: TEST_SUITE: >- src/__tests__/NoneEnvFunctionTransformer.e2e.test.ts|src/__tests__/NonModelAuthFunction.e2e.test.ts|src/__tests__/PerFieldAuthTests.e2e.test.ts|src/__tests__/PredictionsTransformerTests.e2e.test.ts - CLI_REGION: eu-central-1 + CLI_REGION: ap-south-1 depend-on: - publish_to_local_registry - identifier: >- @@ -1285,7 +1285,7 @@ batch: variables: TEST_SUITE: >- src/__tests__/PredictionsTransformerV2Tests.e2e.test.ts|src/__tests__/TransformerOptionsV2.e2e.test.ts|src/__tests__/VersionedModelTransformer.e2e.test.ts|src/__tests__/ConnectionsWithAuthTests.e2e.test.ts - CLI_REGION: ap-southeast-2 + CLI_REGION: ap-southeast-1 depend-on: - publish_to_local_registry - identifier: >- @@ -1296,7 +1296,7 @@ batch: variables: TEST_SUITE: >- src/__tests__/DefaultValueTransformer.e2e.test.ts|src/__tests__/DynamoDBModelTransformer.e2e.test.ts|src/__tests__/ModelConnectionTransformer.e2e.test.ts|src/__tests__/NewConnectionTransformer.e2e.test.ts - CLI_REGION: eu-west-2 + CLI_REGION: ap-southeast-2 depend-on: - publish_to_local_registry - identifier: >- @@ -1307,7 +1307,7 @@ batch: variables: TEST_SUITE: >- src/__tests__/NewConnectionWithAuth.e2e.test.ts|src/__tests__/RelationalWithOwnerFieldAsKeySchemaAuth.e2e.test.ts|src/__tests__/BelongsToTransformerV2.e2e.test.ts|src/__tests__/KeyTransformer.e2e.test.ts - CLI_REGION: ca-central-1 + CLI_REGION: eu-north-1 depend-on: - publish_to_local_registry - identifier: >- @@ -1318,7 +1318,7 @@ batch: variables: TEST_SUITE: >- src/__tests__/ModelAuthTransformer.e2e.test.ts|src/__tests__/PerFieldAuthV2Transformer.e2e.test.ts|src/__tests__/PerFieldAuthV2TransformerWithFF.e2e.test.ts|src/__tests__/SubscriptionsWithAuthTest.e2e.test.ts - CLI_REGION: eu-north-1 + CLI_REGION: eu-south-1 depend-on: - publish_to_local_registry - identifier: >- @@ -1329,7 +1329,7 @@ batch: variables: TEST_SUITE: >- src/__tests__/IndexWithAuthV2.e2e.test.ts|src/__tests__/ModelConnectionWithKeyTransformer.e2e.test.ts|src/__tests__/RelationalWithAuthV2WithFF.e2e.test.ts|src/__tests__/IndexWithAuthV2WithFF.e2e.test.ts - CLI_REGION: me-south-1 + CLI_REGION: eu-west-1 depend-on: - publish_to_local_registry - identifier: >- @@ -1340,7 +1340,7 @@ batch: variables: TEST_SUITE: >- src/__tests__/MultiAuthModelAuthTransformer.e2e.test.ts|src/__tests__/IndexWithClaimFieldAsSortKeyAuth.e2e.test.ts|src/__tests__/ModelTransformer.e2e.test.ts|src/__tests__/MultiAuthV2Transformer.e2e.test.ts - CLI_REGION: eu-west-3 + CLI_REGION: eu-west-2 depend-on: - publish_to_local_registry - identifier: >- @@ -1351,7 +1351,7 @@ batch: variables: TEST_SUITE: >- src/__tests__/SubscriptionsWithAuthV2WithFF.e2e.test.ts|src/__tests__/MapsToTransformer.e2e.test.ts|src/__tests__/RelationalWithAuthV2.e2e.test.ts|src/__tests__/SubscriptionsWithAuthV2.e2e.test.ts - CLI_REGION: eu-west-1 + CLI_REGION: eu-west-3 depend-on: - publish_to_local_registry - identifier: >- @@ -1362,7 +1362,7 @@ batch: variables: TEST_SUITE: >- src/__tests__/IndexTransformer.e2e.test.ts|src/__tests__/MultiAuthV2TransformerWithFF.e2e.test.ts|src/__tests__/AuthV2Transformer.e2e.test.ts|src/__tests__/AuthV2ExhaustiveT1A.test.ts - CLI_REGION: sa-east-1 + CLI_REGION: me-south-1 depend-on: - publish_to_local_registry - identifier: >- @@ -1373,7 +1373,7 @@ batch: variables: TEST_SUITE: >- src/__tests__/AuthV2ExhaustiveT1B.test.ts|src/__tests__/AuthV2TransformerWithFF.e2e.test.ts|src/__tests__/IndexWithAutoQueryField.e2e.test.ts|src/__tests__/AuthV2ExhaustiveT1C.test.ts - CLI_REGION: us-east-1 + CLI_REGION: sa-east-1 depend-on: - publish_to_local_registry - identifier: >- @@ -1384,7 +1384,7 @@ batch: variables: TEST_SUITE: >- src/__tests__/AuthV2ExhaustiveT2A.test.ts|src/__tests__/RelationalTransformers.e2e.test.ts|src/__tests__/SubscriptionsRuntimeFiltering.e2e.test.ts|src/__tests__/AuthV2ExhaustiveT1D.test.ts - CLI_REGION: ap-northeast-1 + CLI_REGION: us-east-1 depend-on: - publish_to_local_registry - identifier: >- @@ -1395,7 +1395,7 @@ batch: variables: TEST_SUITE: >- src/__tests__/AuthV2ExhaustiveT2B.test.ts|src/__tests__/AuthV2ExhaustiveT2D.test.ts|src/__tests__/AuthV2ExhaustiveT2C.test.ts|src/__tests__/SearchableModelTransformerV2.e2e.test.ts - CLI_REGION: us-west-1 + CLI_REGION: us-east-2 depend-on: - publish_to_local_registry - identifier: >- @@ -1406,7 +1406,7 @@ batch: variables: TEST_SUITE: >- src/__tests__/SearchableWithAuthTests.e2e.test.ts|src/__tests__/SearchableModelTransformer.e2e.test.ts|src/__tests__/SearchableWithAuthV2.e2e.test.ts|src/__tests__/SearchableWithAuthV2WithFF.e2e.test.ts - CLI_REGION: us-east-2 + CLI_REGION: us-west-1 depend-on: - publish_to_local_registry - identifier: FunctionTransformerTestsV2 @@ -1415,7 +1415,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/FunctionTransformerTestsV2.e2e.test.ts - CLI_REGION: us-east-2 + CLI_REGION: ap-northeast-2 USE_PARENT_ACCOUNT: 1 depend-on: - publish_to_local_registry @@ -1425,7 +1425,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/HttpTransformer.e2e.test.ts - CLI_REGION: us-west-2 + CLI_REGION: ca-central-1 depend-on: - publish_to_local_registry - identifier: HttpTransformerV2 @@ -1434,7 +1434,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/HttpTransformerV2.e2e.test.ts - CLI_REGION: ap-southeast-1 + CLI_REGION: eu-central-1 depend-on: - publish_to_local_registry - identifier: cleanup_e2e_resources diff --git a/packages/amplify-e2e-tests/src/cleanup-e2e-resources.ts b/packages/amplify-e2e-tests/src/cleanup-e2e-resources.ts index e143d01f5e..343df151da 100644 --- a/packages/amplify-e2e-tests/src/cleanup-e2e-resources.ts +++ b/packages/amplify-e2e-tests/src/cleanup-e2e-resources.ts @@ -8,9 +8,15 @@ import _ from 'lodash'; import fs from 'fs-extra'; import { deleteS3Bucket, sleep } from 'amplify-category-api-e2e-core'; -const REPO_ROOT = path.join(__dirname, '..', '..', '..'); -const SUPPORTED_REGIONS_PATH = path.join(REPO_ROOT, 'scripts', 'e2e-test-regions.json'); -const AWS_REGIONS_TO_RUN_TESTS: string[] = JSON.parse(fs.readFileSync(SUPPORTED_REGIONS_PATH, 'utf-8')); +type TestRegion = { + name: string; + optIn: boolean; +}; + +const repoRoot = path.join(__dirname, '..', '..', '..'); +const supportedRegionsPath = path.join(repoRoot, 'scripts', 'e2e-test-regions.json'); +const suportedRegions: TestRegion[] = JSON.parse(fs.readFileSync(supportedRegionsPath, 'utf-8')); +const testRegions = suportedRegions.map((region) => region.name); const reportPathDir = path.normalize(path.join(__dirname, '..', 'amplify-e2e-reports')); @@ -163,9 +169,13 @@ const getAmplifyApps = async (account: AWSAccountInfo, region: string): Promise< try { amplifyApps = await amplifyClient.listApps({ maxResults: 50 }).promise(); // keeping it to 50 as max supported is 50 } catch (e) { - // Do not fail the cleanup and continue - console.log(`Listing apps for account ${account.accountId}-${region} failed with error with code ${e?.code}. Skipping.`); - return result; + if (e?.code === 'UnrecognizedClientException') { + // Do not fail the cleanup and continue + console.log(`Listing apps for account ${account.accountId}-${region} failed with error with code ${e?.code}. Skipping.`); + return result; + } else { + throw e; + } } for (const app of amplifyApps?.apps) { @@ -256,9 +266,13 @@ const getStacks = async (account: AWSAccountInfo, region: string): Promise => { }; const cleanupAccount = async (account: AWSAccountInfo, accountIndex: number, filterPredicate: JobFilterPredicate): Promise => { - const appPromises = AWS_REGIONS_TO_RUN_TESTS.map((region) => getAmplifyApps(account, region)); - const stackPromises = AWS_REGIONS_TO_RUN_TESTS.map((region) => getStacks(account, region)); + const appPromises = testRegions.map((region) => getAmplifyApps(account, region)); + const stackPromises = testRegions.map((region) => getStacks(account, region)); const bucketPromise = getS3Buckets(account); const orphanBucketPromise = getOrphanS3TestBuckets(account); const orphanIamRolesPromise = getOrphanTestIamRoles(account); diff --git a/packages/amplify-e2e-tests/tsconfig.json b/packages/amplify-e2e-tests/tsconfig.json index 07f245ef39..6807354862 100644 --- a/packages/amplify-e2e-tests/tsconfig.json +++ b/packages/amplify-e2e-tests/tsconfig.json @@ -10,8 +10,7 @@ "outDir": "lib", "lib": ["es2015", "es2016.array.include", "esnext.asynciterable", "dom"], "declaration": true, - "typeRoots": ["../../node_modules/@types", "node_modules/@types", "./typings"], - "resolveJsonModule": true + "typeRoots": ["../../node_modules/@types", "node_modules/@types", "./typings"] }, "references": [{ "path": "../amplify-e2e-core" }], "exclude": ["node_modules", "lib", "__tests__", "custom-resources", "overrides"] diff --git a/scripts/e2e-test-regions.json b/scripts/e2e-test-regions.json index 338071f1bc..2979e21eab 100644 --- a/scripts/e2e-test-regions.json +++ b/scripts/e2e-test-regions.json @@ -1,21 +1,21 @@ [ - "ap-northeast-2", - "ap-south-1", - "us-east-2", - "eu-central-1", - "ap-southeast-2", - "eu-west-2", - "us-west-2", - "ap-southeast-1", - "ca-central-1", - "eu-north-1", - "me-south-1", - "eu-west-3", - "eu-west-1", - "sa-east-1", - "us-east-1", - "ap-northeast-1", - "us-west-1", - "eu-south-1", - "ap-east-1" + { "name": "ap-east-1", "optIn": true }, + { "name": "ap-northeast-1", "optIn": false }, + { "name": "ap-northeast-2", "optIn": false }, + { "name": "ap-south-1", "optIn": false }, + { "name": "ap-southeast-1", "optIn": false }, + { "name": "ap-southeast-2", "optIn": false }, + { "name": "ca-central-1", "optIn": false }, + { "name": "eu-central-1", "optIn": false }, + { "name": "eu-north-1", "optIn": false }, + { "name": "eu-south-1", "optIn": true }, + { "name": "eu-west-1", "optIn": false }, + { "name": "eu-west-2", "optIn": false }, + { "name": "eu-west-3", "optIn": false }, + { "name": "me-south-1", "optIn": true }, + { "name": "sa-east-1", "optIn": false }, + { "name": "us-east-1", "optIn": false }, + { "name": "us-east-2", "optIn": false }, + { "name": "us-west-1", "optIn": false }, + { "name": "us-west-2", "optIn": false } ] diff --git a/scripts/split-e2e-tests.ts b/scripts/split-e2e-tests.ts index 498f39ed10..eec78630d0 100644 --- a/scripts/split-e2e-tests.ts +++ b/scripts/split-e2e-tests.ts @@ -3,11 +3,18 @@ import * as glob from 'glob'; import * as fs from 'fs-extra'; import * as yaml from 'js-yaml'; +type TestRegion = { + name: string; + optIn: boolean; +}; + const REPO_ROOT = join(__dirname, '..'); -const SUPPORTED_REGIONS_PATH = join(REPO_ROOT, 'scripts', 'e2e-test-regions.json'); -const AMPLIFY_SUPPORTED_REGIONS: string[] = JSON.parse(fs.readFileSync(SUPPORTED_REGIONS_PATH, 'utf-8')); -const AWS_REGIONS_TO_RUN_TESTS = AMPLIFY_SUPPORTED_REGIONS; -const SUPPORTED_OPT_IN_REGIONS = ['ap-east-1', 'eu-south-1', 'me-south-1']; + +const supportedRegionsPath = join(REPO_ROOT, 'scripts', 'e2e-test-regions.json'); +const suportedRegions: TestRegion[] = JSON.parse(fs.readFileSync(supportedRegionsPath, 'utf-8')); +const testRegions = suportedRegions.map((region) => region.name); +const nonOptInRegions = suportedRegions.filter((region) => !region.optIn).map((region) => region.name); + type ForceTests = 'interactions' | 'containers'; type TestTiming = { @@ -146,8 +153,6 @@ const EXCLUDE_TEST_IDS: string[] = []; const MAX_WORKERS = 4; -const nonOptInRegions = AWS_REGIONS_TO_RUN_TESTS.filter((region) => !SUPPORTED_OPT_IN_REGIONS.includes(region)); - // eslint-disable-next-line import/namespace const loadConfigBase = (): ConfigBase => yaml.load(fs.readFileSync(CODEBUILD_CONFIG_BASE_PATH, 'utf8')) as ConfigBase; @@ -161,7 +166,7 @@ const loadTestTimings = (): { timingData: TestTiming[] } => JSON.parse(fs.readFi const getTestFiles = (dir: string, pattern = 'src/**/*.test.ts'): string[] => glob.sync(pattern, { cwd: dir }); const createJob = (os: OSType, jobIdx: number, runSolo = false): CandidateJob => ({ - region: AWS_REGIONS_TO_RUN_TESTS[jobIdx % AWS_REGIONS_TO_RUN_TESTS.length], + region: testRegions[jobIdx % testRegions.length], os, tests: [], useParentAccount: false, @@ -172,7 +177,8 @@ const getTestNameFromPath = (testSuitePath: string, region?: string): string => const startIndex = testSuitePath.lastIndexOf('/') + 1; const endIndex = testSuitePath.lastIndexOf('.test'); const regionSuffix = - RUN_IN_ALL_REGIONS.find((allRegions) => testSuitePath === allRegions || testSuitePath.match(allRegions)) && region ? region : ''; + RUN_IN_ALL_REGIONS.find((allRegions) => testSuitePath === allRegions || testSuitePath.match(allRegions)) && region ? `-${region}` : ''; + return testSuitePath.substring(startIndex, endIndex).split('.e2e').join('').split('.').join('-').concat(regionSuffix); }; @@ -204,7 +210,7 @@ const splitTests = (baseJobLinux: any, testDirectory: string, pickTests?: (testS if (RUN_SOLO.find((solo) => test === solo || test.match(solo))) { if (RUN_IN_ALL_REGIONS.find((allRegions) => test === allRegions || test.match(allRegions))) { - AWS_REGIONS_TO_RUN_TESTS.forEach((region) => { + testRegions.forEach((region) => { const newSoloJob = createJob(os, jobIdx, true); jobIdx++; newSoloJob.tests.push(test); @@ -282,7 +288,7 @@ const setJobRegion = (test: string, job: CandidateJob, jobIdx: number) => { RUN_IN_NON_OPT_IN_REGIONS.find((nonOptInTest) => test.toLowerCase() === nonOptInTest || test.toLowerCase().match(nonOptInTest)) || USE_PARENT_ACCOUNT.some((usesParent) => test.startsWith(usesParent)) ) { - if (SUPPORTED_OPT_IN_REGIONS.includes(job.region)) { + if (!nonOptInRegions.includes(job.region)) { job.region = nonOptInRegions[jobIdx % nonOptInRegions.length]; } } diff --git a/shared-scripts.sh b/shared-scripts.sh index d084293cc8..a7ed781343 100755 --- a/shared-scripts.sh +++ b/shared-scripts.sh @@ -281,11 +281,10 @@ function useChildAccountCredentials { parent_acct=$(aws sts get-caller-identity | jq -cr '.Account') child_accts=$(aws organizations list-accounts | jq -c "[.Accounts[].Id | select(. != \"$parent_acct\")]") org_size=$(echo $child_accts | jq 'length') - opt_in_regions="eu-south-1 ap-east-1 me-south-1" + opt_in_regions=$(jq -r '.[] | select(.optIn == true) | .name' ./scripts/e2e-test-regions.json) if echo "$opt_in_regions" | grep -qw "$CLI_REGION"; then - child_accts=$(echo $child_accts | jq -c '.[]') + child_accts=$(echo $child_accts | jq -cr '.[]') for child_acct in $child_accts; do - child_acct=$(echo $child_acct | tr -d '"') # Get enabled opt-in regions for the child account enabled_regions=$(aws account list-regions --account-id $child_acct --region-opt-status-contains ENABLED) # Check if given opt-in region is enabled for the child account From 30a297217e2cad518d42c23665d2208431845f14 Mon Sep 17 00:00:00 2001 From: Christopher Sundersingh <83315412+sundersc@users.noreply.github.com> Date: Wed, 21 Feb 2024 15:54:19 -0800 Subject: [PATCH 37/45] chore(ci): enable create api canary in opt-in regions (#2290) --- codebuild_specs/createapi_canary_workflow.yml | 60 +++++++++---------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/codebuild_specs/createapi_canary_workflow.yml b/codebuild_specs/createapi_canary_workflow.yml index 22656bb2b9..d91ed77583 100644 --- a/codebuild_specs/createapi_canary_workflow.yml +++ b/codebuild_specs/createapi_canary_workflow.yml @@ -127,16 +127,16 @@ batch: CLI_REGION: us-west-2 depend-on: - publish_to_local_registry - # - identifier: api_test_ap_east_1 - # buildspec: codebuild_specs/run_canary_e2e_tests.yml - # env: - # compute-type: BUILD_GENERAL1_MEDIUM - # variables: - # TEST_SUITE: >- - # src/__tests__/api_canary.test.ts - # CLI_REGION: ap-east-1 - # depend-on: - # - publish_to_local_registry + - identifier: api_test_ap_east_1 + buildspec: codebuild_specs/run_canary_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_MEDIUM + variables: + TEST_SUITE: >- + src/__tests__/api_canary.test.ts + CLI_REGION: ap-east-1 + depend-on: + - publish_to_local_registry - identifier: api_test_ap_northeast_1 buildspec: codebuild_specs/run_canary_e2e_tests.yml env: @@ -177,16 +177,16 @@ batch: CLI_REGION: eu-west-1 depend-on: - publish_to_local_registry - # - identifier: api_test_eu_south_1 - # buildspec: codebuild_specs/run_canary_e2e_tests.yml - # env: - # compute-type: BUILD_GENERAL1_MEDIUM - # variables: - # TEST_SUITE: >- - # src/__tests__/api_canary.test.ts - # CLI_REGION: eu-south-1 - # depend-on: - # - publish_to_local_registry + - identifier: api_test_eu_south_1 + buildspec: codebuild_specs/run_canary_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_MEDIUM + variables: + TEST_SUITE: >- + src/__tests__/api_canary.test.ts + CLI_REGION: eu-south-1 + depend-on: + - publish_to_local_registry - identifier: api_test_eu_west_3 buildspec: codebuild_specs/run_canary_e2e_tests.yml env: @@ -197,16 +197,16 @@ batch: CLI_REGION: eu-west-3 depend-on: - publish_to_local_registry - # - identifier: api_test_me_south_1 - # buildspec: codebuild_specs/run_canary_e2e_tests.yml - # env: - # compute-type: BUILD_GENERAL1_MEDIUM - # variables: - # TEST_SUITE: >- - # src/__tests__/api_canary.test.ts - # CLI_REGION: me-south-1 - # depend-on: - # - publish_to_local_registry + - identifier: api_test_me_south_1 + buildspec: codebuild_specs/run_canary_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_MEDIUM + variables: + TEST_SUITE: >- + src/__tests__/api_canary.test.ts + CLI_REGION: me-south-1 + depend-on: + - publish_to_local_registry - identifier: api_test_sa_east_1 buildspec: codebuild_specs/run_canary_e2e_tests.yml env: From 4b1bfc3732cf79c686bae2ebe4495570f54634e1 Mon Sep 17 00:00:00 2001 From: phani-srikar Date: Thu, 22 Feb 2024 09:17:47 -0800 Subject: [PATCH 38/45] chore: use absolute path --- shared-scripts.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-scripts.sh b/shared-scripts.sh index 60c984ea60..c7ded5a7e6 100755 --- a/shared-scripts.sh +++ b/shared-scripts.sh @@ -282,7 +282,7 @@ function useChildAccountCredentials { parent_acct=$(aws sts get-caller-identity | jq -cr '.Account') child_accts=$(aws organizations list-accounts | jq -c "[.Accounts[].Id | select(. != \"$parent_acct\")]") org_size=$(echo $child_accts | jq 'length') - opt_in_regions=$(jq -r '.[] | select(.optIn == true) | .name' ./scripts/e2e-test-regions.json) + opt_in_regions=$(jq -r '.[] | select(.optIn == true) | .name' $$CODEBUILD_SRC_DIR/scripts/e2e-test-regions.json) if echo "$opt_in_regions" | grep -qw "$CLI_REGION"; then child_accts=$(echo $child_accts | jq -cr '.[]') for child_acct in $child_accts; do From 23d8da700c5dcbe14d78be8c89223b6ced487879 Mon Sep 17 00:00:00 2001 From: phani-srikar Date: Thu, 22 Feb 2024 11:02:04 -0800 Subject: [PATCH 39/45] chore: use absolute path --- shared-scripts.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-scripts.sh b/shared-scripts.sh index c7ded5a7e6..f7572bd072 100755 --- a/shared-scripts.sh +++ b/shared-scripts.sh @@ -282,7 +282,7 @@ function useChildAccountCredentials { parent_acct=$(aws sts get-caller-identity | jq -cr '.Account') child_accts=$(aws organizations list-accounts | jq -c "[.Accounts[].Id | select(. != \"$parent_acct\")]") org_size=$(echo $child_accts | jq 'length') - opt_in_regions=$(jq -r '.[] | select(.optIn == true) | .name' $$CODEBUILD_SRC_DIR/scripts/e2e-test-regions.json) + opt_in_regions=$(jq -r '.[] | select(.optIn == true) | .name' $CODEBUILD_SRC_DIR/scripts/e2e-test-regions.json) if echo "$opt_in_regions" | grep -qw "$CLI_REGION"; then child_accts=$(echo $child_accts | jq -cr '.[]') for child_acct in $child_accts; do From abd398a81e95638486046f3e28cc913db3d69014 Mon Sep 17 00:00:00 2001 From: phani-srikar Date: Wed, 21 Feb 2024 23:02:34 -0800 Subject: [PATCH 40/45] chore: test with cdk latest --- .../src/__tests__/amplify-table-1.test.ts | 2 +- .../amplify-graphql-api-construct-tests/src/commands.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/amplify-graphql-api-construct-tests/src/__tests__/amplify-table-1.test.ts b/packages/amplify-graphql-api-construct-tests/src/__tests__/amplify-table-1.test.ts index 20746e7407..297c382ca5 100644 --- a/packages/amplify-graphql-api-construct-tests/src/__tests__/amplify-table-1.test.ts +++ b/packages/amplify-graphql-api-construct-tests/src/__tests__/amplify-table-1.test.ts @@ -37,7 +37,7 @@ describe('CDK amplify table 1', () => { expect(table.Table.StreamSpecification.StreamViewType).toBe('NEW_AND_OLD_IMAGES'); const updateTemplatePath = path.resolve(path.join(__dirname, 'backends', 'amplify-table', 'simple-todo', 'updateIndex')); updateCDKAppWithTemplate(projRoot, updateTemplatePath); - await cdkDeploy(projRoot, '--all', { timeoutMs: 10 * 60 * 1000 /* 10m */ }); + await cdkDeploy(projRoot, '--all'); const updatedTable = await getDDBTable(tableName, region); expect(updatedTable).toBeDefined(); expect(updatedTable.Table.BillingModeSummary.BillingMode).toBe('PROVISIONED'); diff --git a/packages/amplify-graphql-api-construct-tests/src/commands.ts b/packages/amplify-graphql-api-construct-tests/src/commands.ts index 0cba9778fa..c203fe2fcc 100644 --- a/packages/amplify-graphql-api-construct-tests/src/commands.ts +++ b/packages/amplify-graphql-api-construct-tests/src/commands.ts @@ -52,7 +52,7 @@ export type InitCDKProjectProps = { * @returns a promise which resolves to the stack name */ export const initCDKProject = async (cwd: string, templatePath: string, props?: InitCDKProjectProps): Promise => { - const { cdkVersion = '2.97.0', additionalDependencies = [] } = props ?? {}; + const { cdkVersion = '2.129.0', additionalDependencies = [] } = props ?? {}; await spawn(getNpxPath(), ['cdk', 'init', 'app', '--language', 'typescript'], { cwd, @@ -86,13 +86,13 @@ export type CdkDeployProps = { export const cdkDeploy = async (cwd: string, option: string, props?: CdkDeployProps): Promise => { // The CodegenAssets BucketDeployment resource takes a while. Set the timeout to 10m account for that. (Note that this is the "no output // timeout"--the overall deployment is still allowed to take longer than 10m) - const noOutputTimeout = props?.timeoutMs ?? 10 * 60 * 1000; + // const noOutputTimeout = props?.timeoutMs ?? 10 * 60 * 1000; const commandOptions = { cwd, stripColors: true, // npx cdk does not work on verdaccio env: { npm_config_registry: 'https://registry.npmjs.org/' }, - noOutputTimeout, + noOutputTimeout: props?.timeoutMs, }; // This prevents us from maintaining a separate CDK account bootstrap process as we add support for new accounts, regions. // Checks and succeeds early (a no-op) if the account-region combination is already bootstrapped. From 96d0ae01cd09386f5a036c14dc4e0ab660e79234 Mon Sep 17 00:00:00 2001 From: phani-srikar Date: Thu, 22 Feb 2024 08:58:43 -0800 Subject: [PATCH 41/45] chore: skip destructive case amplify table 1 --- .../src/__tests__/amplify-table-1.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/amplify-graphql-api-construct-tests/src/__tests__/amplify-table-1.test.ts b/packages/amplify-graphql-api-construct-tests/src/__tests__/amplify-table-1.test.ts index 297c382ca5..89bd7790dc 100644 --- a/packages/amplify-graphql-api-construct-tests/src/__tests__/amplify-table-1.test.ts +++ b/packages/amplify-graphql-api-construct-tests/src/__tests__/amplify-table-1.test.ts @@ -46,7 +46,7 @@ describe('CDK amplify table 1', () => { expect(updatedTable.Table.StreamSpecification.StreamViewType).toBe('KEYS_ONLY'); }); - test('cannot replace table when destructive updates are not allowed', async () => { + test.skip('cannot replace table when destructive updates are not allowed', async () => { const templatePath = path.resolve(path.join(__dirname, 'backends', 'amplify-table', 'simple-todo')); const name = await initCDKProject(projRoot, templatePath); const outputs = await cdkDeploy(projRoot, '--all'); From 514e93ab73d59b46f9f81b963e109e60638df168 Mon Sep 17 00:00:00 2001 From: phani-srikar Date: Thu, 22 Feb 2024 12:19:35 -0800 Subject: [PATCH 42/45] chore: re-run full tests --- codebuild_specs/e2e_workflow.yml | 27 ++++++--- .../src/__tests__/amplify-table-1.test.ts | 32 ----------- .../src/__tests__/amplify-table-3.test.ts | 57 +++++++++++++++++++ scripts/split-e2e-tests.ts | 1 + 4 files changed, 76 insertions(+), 41 deletions(-) create mode 100644 packages/amplify-graphql-api-construct-tests/src/__tests__/amplify-table-3.test.ts diff --git a/codebuild_specs/e2e_workflow.yml b/codebuild_specs/e2e_workflow.yml index e6bd3395ab..786c1dfa92 100644 --- a/codebuild_specs/e2e_workflow.yml +++ b/codebuild_specs/e2e_workflow.yml @@ -983,7 +983,7 @@ batch: variables: TEST_SUITE: >- src/__tests__/deploy-velocity-temporarily-disabled/3-gsis-empty-table.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/3-gsis-single-record.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-10k-records.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-1k-records.test.ts - CLI_REGION: ap-south-1 + CLI_REGION: ap-southeast-1 depend-on: - publish_to_local_registry - identifier: >- @@ -994,7 +994,7 @@ batch: variables: TEST_SUITE: >- src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-empty-table.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-single-record.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-update-attr-10k-records.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-update-attr-1k-records.test.ts - CLI_REGION: ap-southeast-1 + CLI_REGION: ap-southeast-2 depend-on: - publish_to_local_registry - identifier: >- @@ -1005,7 +1005,7 @@ batch: variables: TEST_SUITE: >- src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-update-attr-empty-table.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-update-attr-single-record.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/single-gsi-10k-records.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/single-gsi-1k-records.test.ts - CLI_REGION: ap-southeast-2 + CLI_REGION: ca-central-1 depend-on: - publish_to_local_registry - identifier: single_gsi_empty_table_single_gsi_single_record_relationships @@ -1015,7 +1015,7 @@ batch: variables: TEST_SUITE: >- src/__tests__/deploy-velocity-temporarily-disabled/single-gsi-empty-table.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/single-gsi-single-record.test.ts|src/__tests__/relationships.test.ts - CLI_REGION: ca-central-1 + CLI_REGION: eu-central-1 depend-on: - publish_to_local_registry - identifier: amplify_table_1 @@ -1027,6 +1027,15 @@ batch: CLI_REGION: ap-northeast-1 depend-on: - publish_to_local_registry + - identifier: amplify_table_3 + buildspec: codebuild_specs/run_cdk_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/amplify-table-3.test.ts + CLI_REGION: ap-south-1 + depend-on: + - publish_to_local_registry - identifier: base_cdk_ap_east_1 buildspec: codebuild_specs/run_cdk_tests.yml env: @@ -1204,7 +1213,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/deploy-velocity/3-gsis-100k-records.test.ts - CLI_REGION: eu-central-1 + CLI_REGION: eu-north-1 depend-on: - publish_to_local_registry - identifier: replace_2_gsis_100k_records @@ -1213,7 +1222,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/deploy-velocity/replace-2-gsis-100k-records.test.ts - CLI_REGION: eu-north-1 + CLI_REGION: eu-south-1 depend-on: - publish_to_local_registry - identifier: replace_2_gsis_update_attr_100k_records @@ -1223,7 +1232,7 @@ batch: variables: TEST_SUITE: >- src/__tests__/deploy-velocity/replace-2-gsis-update-attr-100k-records.test.ts - CLI_REGION: eu-south-1 + CLI_REGION: eu-west-1 depend-on: - publish_to_local_registry - identifier: single_gsi_100k_records @@ -1232,7 +1241,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/deploy-velocity/single-gsi-100k-records.test.ts - CLI_REGION: eu-west-1 + CLI_REGION: eu-west-2 depend-on: - publish_to_local_registry - identifier: sql_models @@ -1241,7 +1250,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/sql-models.test.ts - CLI_REGION: eu-west-2 + CLI_REGION: eu-west-3 depend-on: - publish_to_local_registry - identifier: >- diff --git a/packages/amplify-graphql-api-construct-tests/src/__tests__/amplify-table-1.test.ts b/packages/amplify-graphql-api-construct-tests/src/__tests__/amplify-table-1.test.ts index 89bd7790dc..0c72959ac4 100644 --- a/packages/amplify-graphql-api-construct-tests/src/__tests__/amplify-table-1.test.ts +++ b/packages/amplify-graphql-api-construct-tests/src/__tests__/amplify-table-1.test.ts @@ -45,36 +45,4 @@ describe('CDK amplify table 1', () => { expect(updatedTable.Table.SSEDescription).toBeUndefined(); expect(updatedTable.Table.StreamSpecification.StreamViewType).toBe('KEYS_ONLY'); }); - - test.skip('cannot replace table when destructive updates are not allowed', async () => { - const templatePath = path.resolve(path.join(__dirname, 'backends', 'amplify-table', 'simple-todo')); - const name = await initCDKProject(projRoot, templatePath); - const outputs = await cdkDeploy(projRoot, '--all'); - const { awsAppsyncApiId: apiId, awsAppsyncRegion: region } = outputs[name]; - const tableName = `Todo-${apiId}-NONE`; - const table = await getDDBTable(tableName, region); - expect(table.Table.KeySchema[0]).toEqual({ - AttributeName: 'id', - KeyType: 'HASH', - }); - // deploy with destructive update disabled - let updateTemplatePath; - updateTemplatePath = path.resolve(path.join(__dirname, 'backends', 'amplify-table', 'simple-todo', 'updateKeySchema', 'disabled')); - updateCDKAppWithTemplate(projRoot, updateTemplatePath); - await expect(() => cdkDeploy(projRoot, '--all')).rejects.toThrow(); - const tableAfterFailure = await getDDBTable(tableName, region); - expect(tableAfterFailure.Table.KeySchema[0]).toEqual({ - AttributeName: 'id', - KeyType: 'HASH', - }); - // deploy with destructive update enabled - updateTemplatePath = path.resolve(path.join(__dirname, 'backends', 'amplify-table', 'simple-todo', 'updateKeySchema', 'enabled')); - updateCDKAppWithTemplate(projRoot, updateTemplatePath); - await cdkDeploy(projRoot, '--all'); - const updatedTable = await getDDBTable(tableName, region); - expect(updatedTable.Table.KeySchema[0]).toEqual({ - AttributeName: 'todoid', - KeyType: 'HASH', - }); - }); }); diff --git a/packages/amplify-graphql-api-construct-tests/src/__tests__/amplify-table-3.test.ts b/packages/amplify-graphql-api-construct-tests/src/__tests__/amplify-table-3.test.ts new file mode 100644 index 0000000000..d7ee301600 --- /dev/null +++ b/packages/amplify-graphql-api-construct-tests/src/__tests__/amplify-table-3.test.ts @@ -0,0 +1,57 @@ +import * as path from 'path'; +import { createNewProjectDir, deleteProjectDir, getDDBTable } from 'amplify-category-api-e2e-core'; +import { cdkDestroy, initCDKProject, cdkDeploy, updateCDKAppWithTemplate } from '../commands'; + +jest.setTimeout(1000 * 60 * 60 /* 1 hour */); + +describe('CDK amplify table 3', () => { + let projRoot: string; + let projFolderName: string; + + beforeEach(async () => { + projFolderName = 'cdkamplifytable3'; + projRoot = await createNewProjectDir(projFolderName); + }); + + afterEach(async () => { + try { + await cdkDestroy(projRoot, '--all'); + } catch (_) { + /* No-op */ + } + + deleteProjectDir(projRoot); + }); + + test('cannot replace table when destructive updates are not allowed', async () => { + const templatePath = path.resolve(path.join(__dirname, 'backends', 'amplify-table', 'simple-todo')); + const name = await initCDKProject(projRoot, templatePath); + const outputs = await cdkDeploy(projRoot, '--all'); + const { awsAppsyncApiId: apiId, awsAppsyncRegion: region } = outputs[name]; + const tableName = `Todo-${apiId}-NONE`; + const table = await getDDBTable(tableName, region); + expect(table.Table.KeySchema[0]).toEqual({ + AttributeName: 'id', + KeyType: 'HASH', + }); + // deploy with destructive update disabled + let updateTemplatePath; + updateTemplatePath = path.resolve(path.join(__dirname, 'backends', 'amplify-table', 'simple-todo', 'updateKeySchema', 'disabled')); + updateCDKAppWithTemplate(projRoot, updateTemplatePath); + await expect(() => cdkDeploy(projRoot, '--all')).rejects.toThrow(); + const tableAfterFailure = await getDDBTable(tableName, region); + expect(tableAfterFailure.Table.KeySchema[0]).toEqual({ + AttributeName: 'id', + KeyType: 'HASH', + }); + // deploy with destructive update enabled + updateTemplatePath = path.resolve(path.join(__dirname, 'backends', 'amplify-table', 'simple-todo', 'updateKeySchema', 'enabled')); + updateCDKAppWithTemplate(projRoot, updateTemplatePath); + await cdkDeploy(projRoot, '--all'); + const updatedTable = await getDDBTable(tableName, region); + expect(updatedTable.Table.KeySchema[0]).toEqual({ + AttributeName: 'todoid', + KeyType: 'HASH', + }); + }); +}); diff --git a/scripts/split-e2e-tests.ts b/scripts/split-e2e-tests.ts index eec78630d0..c957df8d75 100644 --- a/scripts/split-e2e-tests.ts +++ b/scripts/split-e2e-tests.ts @@ -129,6 +129,7 @@ const RUN_SOLO: (string | RegExp)[] = [ // CDK tests /src\/__tests__\/base-cdk.*\.test\.ts/, 'src/__tests__/amplify-table-1.test.ts', + 'src/__tests__/amplify-table-3.test.ts', 'src/__tests__/api_canary.test.ts', 'src/__tests__/sql-models.test.ts', ]; From 289b9fde93cbe1b7a3370d3db277197894dad5ad Mon Sep 17 00:00:00 2001 From: phani-srikar Date: Thu, 22 Feb 2024 20:00:33 -0800 Subject: [PATCH 43/45] chore: run failing tests as solo --- codebuild_specs/e2e_workflow.yml | 70 ++++++++++++++++++++------------ scripts/split-e2e-tests.ts | 3 ++ 2 files changed, 47 insertions(+), 26 deletions(-) diff --git a/codebuild_specs/e2e_workflow.yml b/codebuild_specs/e2e_workflow.yml index 786c1dfa92..4e4bc7b46d 100644 --- a/codebuild_specs/e2e_workflow.yml +++ b/codebuild_specs/e2e_workflow.yml @@ -955,67 +955,76 @@ batch: USE_PARENT_ACCOUNT: 1 depend-on: - publish_to_local_registry - - identifier: add_resources_admin_role_all_auth_modes_amplify_table_2 + - identifier: add_resources_custom_logic_data_construct_3_gsis_10k_records buildspec: codebuild_specs/run_cdk_tests.yml env: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: >- - src/__tests__/add-resources.test.ts|src/__tests__/admin-role.test.ts|src/__tests__/all-auth-modes.test.ts|src/__tests__/amplify-table-2.test.ts + src/__tests__/add-resources.test.ts|src/__tests__/custom-logic.test.ts|src/__tests__/data-construct.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/3-gsis-10k-records.test.ts CLI_REGION: ap-east-1 depend-on: - publish_to_local_registry - - identifier: custom_logic_data_construct_3_gsis_10k_records_3_gsis_1k_records + - identifier: >- + 3_gsis_1k_records_3_gsis_empty_table_3_gsis_single_record_replace_2_gsis_10k_records buildspec: codebuild_specs/run_cdk_tests.yml env: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: >- - src/__tests__/custom-logic.test.ts|src/__tests__/data-construct.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/3-gsis-10k-records.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/3-gsis-1k-records.test.ts - CLI_REGION: ap-northeast-2 + src/__tests__/deploy-velocity-temporarily-disabled/3-gsis-1k-records.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/3-gsis-empty-table.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/3-gsis-single-record.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-10k-records.test.ts + CLI_REGION: ca-central-1 depend-on: - publish_to_local_registry - identifier: >- - 3_gsis_empty_table_3_gsis_single_record_replace_2_gsis_10k_records_replace_2_gsis_1k_records + replace_2_gsis_1k_records_replace_2_gsis_empty_table_replace_2_gsis_single_record_replace_2_gsis_update_attr_10k_records buildspec: codebuild_specs/run_cdk_tests.yml env: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: >- - src/__tests__/deploy-velocity-temporarily-disabled/3-gsis-empty-table.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/3-gsis-single-record.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-10k-records.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-1k-records.test.ts - CLI_REGION: ap-southeast-1 + src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-1k-records.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-empty-table.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-single-record.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-update-attr-10k-records.test.ts + CLI_REGION: eu-central-1 depend-on: - publish_to_local_registry - identifier: >- - replace_2_gsis_empty_table_replace_2_gsis_single_record_replace_2_gsis_update_attr_10k_records_replace_2_gsis_update_attr_1k_re + replace_2_gsis_update_attr_1k_records_replace_2_gsis_update_attr_empty_table_replace_2_gsis_update_attr_single_record_single_gs buildspec: codebuild_specs/run_cdk_tests.yml env: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: >- - src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-empty-table.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-single-record.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-update-attr-10k-records.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-update-attr-1k-records.test.ts - CLI_REGION: ap-southeast-2 + src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-update-attr-1k-records.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-update-attr-empty-table.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-update-attr-single-record.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/single-gsi-10k-records.test.ts + CLI_REGION: eu-north-1 depend-on: - publish_to_local_registry - identifier: >- - replace_2_gsis_update_attr_empty_table_replace_2_gsis_update_attr_single_record_single_gsi_10k_records_single_gsi_1k_records + single_gsi_1k_records_single_gsi_empty_table_single_gsi_single_record_relationships buildspec: codebuild_specs/run_cdk_tests.yml env: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: >- - src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-update-attr-empty-table.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-update-attr-single-record.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/single-gsi-10k-records.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/single-gsi-1k-records.test.ts - CLI_REGION: ca-central-1 + src/__tests__/deploy-velocity-temporarily-disabled/single-gsi-1k-records.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/single-gsi-empty-table.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/single-gsi-single-record.test.ts|src/__tests__/relationships.test.ts + CLI_REGION: eu-south-1 depend-on: - publish_to_local_registry - - identifier: single_gsi_empty_table_single_gsi_single_record_relationships + - identifier: admin_role buildspec: codebuild_specs/run_cdk_tests.yml env: - compute-type: BUILD_GENERAL1_MEDIUM + compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: >- - src/__tests__/deploy-velocity-temporarily-disabled/single-gsi-empty-table.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/single-gsi-single-record.test.ts|src/__tests__/relationships.test.ts - CLI_REGION: eu-central-1 + TEST_SUITE: src/__tests__/admin-role.test.ts + CLI_REGION: ap-northeast-1 + depend-on: + - publish_to_local_registry + - identifier: all_auth_modes + buildspec: codebuild_specs/run_cdk_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/all-auth-modes.test.ts + CLI_REGION: ap-northeast-2 depend-on: - publish_to_local_registry - identifier: amplify_table_1 @@ -1024,7 +1033,16 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/amplify-table-1.test.ts - CLI_REGION: ap-northeast-1 + CLI_REGION: ap-south-1 + depend-on: + - publish_to_local_registry + - identifier: amplify_table_2 + buildspec: codebuild_specs/run_cdk_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/amplify-table-2.test.ts + CLI_REGION: ap-southeast-1 depend-on: - publish_to_local_registry - identifier: amplify_table_3 @@ -1033,7 +1051,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/amplify-table-3.test.ts - CLI_REGION: ap-south-1 + CLI_REGION: ap-southeast-2 depend-on: - publish_to_local_registry - identifier: base_cdk_ap_east_1 @@ -1213,7 +1231,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/deploy-velocity/3-gsis-100k-records.test.ts - CLI_REGION: eu-north-1 + CLI_REGION: eu-west-1 depend-on: - publish_to_local_registry - identifier: replace_2_gsis_100k_records @@ -1222,7 +1240,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/deploy-velocity/replace-2-gsis-100k-records.test.ts - CLI_REGION: eu-south-1 + CLI_REGION: eu-west-2 depend-on: - publish_to_local_registry - identifier: replace_2_gsis_update_attr_100k_records @@ -1232,7 +1250,7 @@ batch: variables: TEST_SUITE: >- src/__tests__/deploy-velocity/replace-2-gsis-update-attr-100k-records.test.ts - CLI_REGION: eu-west-1 + CLI_REGION: eu-west-3 depend-on: - publish_to_local_registry - identifier: single_gsi_100k_records @@ -1241,7 +1259,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/deploy-velocity/single-gsi-100k-records.test.ts - CLI_REGION: eu-west-2 + CLI_REGION: me-south-1 depend-on: - publish_to_local_registry - identifier: sql_models @@ -1250,7 +1268,7 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/sql-models.test.ts - CLI_REGION: eu-west-3 + CLI_REGION: us-east-1 depend-on: - publish_to_local_registry - identifier: >- diff --git a/scripts/split-e2e-tests.ts b/scripts/split-e2e-tests.ts index c957df8d75..ad17203b81 100644 --- a/scripts/split-e2e-tests.ts +++ b/scripts/split-e2e-tests.ts @@ -132,6 +132,9 @@ const RUN_SOLO: (string | RegExp)[] = [ 'src/__tests__/amplify-table-3.test.ts', 'src/__tests__/api_canary.test.ts', 'src/__tests__/sql-models.test.ts', + 'src/__tests__/amplify-table-2.test.ts', + 'src/__tests__/admin-role.test.ts', + 'src/__tests__/all-auth-modes.test.ts', ]; const RUN_IN_ALL_REGIONS = [ From 152744898bd3a5d0c6d1c4145901ac50fe9398be Mon Sep 17 00:00:00 2001 From: phani-srikar Date: Fri, 23 Feb 2024 09:06:40 -0800 Subject: [PATCH 44/45] test: restore a 10 min noouttimeout --- packages/amplify-graphql-api-construct-tests/src/commands.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/amplify-graphql-api-construct-tests/src/commands.ts b/packages/amplify-graphql-api-construct-tests/src/commands.ts index c203fe2fcc..52368341e2 100644 --- a/packages/amplify-graphql-api-construct-tests/src/commands.ts +++ b/packages/amplify-graphql-api-construct-tests/src/commands.ts @@ -86,13 +86,13 @@ export type CdkDeployProps = { export const cdkDeploy = async (cwd: string, option: string, props?: CdkDeployProps): Promise => { // The CodegenAssets BucketDeployment resource takes a while. Set the timeout to 10m account for that. (Note that this is the "no output // timeout"--the overall deployment is still allowed to take longer than 10m) - // const noOutputTimeout = props?.timeoutMs ?? 10 * 60 * 1000; + const noOutputTimeout = props?.timeoutMs ?? 10 * 60 * 1000; const commandOptions = { cwd, stripColors: true, // npx cdk does not work on verdaccio env: { npm_config_registry: 'https://registry.npmjs.org/' }, - noOutputTimeout: props?.timeoutMs, + noOutputTimeout, }; // This prevents us from maintaining a separate CDK account bootstrap process as we add support for new accounts, regions. // Checks and succeeds early (a no-op) if the account-region combination is already bootstrapped. From f7ec6014d4eecfede186129a6ea19041780bafb3 Mon Sep 17 00:00:00 2001 From: Dane Pilcher Date: Wed, 28 Feb 2024 08:56:47 -0700 Subject: [PATCH 45/45] feat: add implicit fields to filter input (#2236) --- .../__snapshots__/owner-auth.test.ts.snap | 889 ++++ .../src/__tests__/owner-auth.test.ts | 108 +- .../src/graphql-auth-transformer.ts | 42 +- ...hql-default-value-transformer.test.ts.snap | 12 + .../amplify-graphql-model-transformer/API.md | 2 +- .../model-transformer.test.ts.snap | 47 + .../src/graphql-model-transformer.ts | 31 +- .../src/graphql-types/common.ts | 1 + .../src/graphql-types/mutation.ts | 21 +- ...-graphql-has-many-transformer.test.ts.snap | 3566 ++++++++++------- ...phql-many-to-many-transformer.test.ts.snap | 72 + ...-relations-with-custom-primary-key.test.ts | 61 + .../src/schema.ts | 37 +- ...raphql-searchable-transformer.test.ts.snap | 12 + .../amplify-graphql-transformer-core/API.md | 12 + .../transformer-context/output.test.ts | 52 +- .../src/index.ts | 4 + .../src/transformer-context/output.ts | 16 + .../src/utils/index.ts | 8 +- .../src/utils/model-util.ts | 17 + .../API.md | 4 + .../transformer-context-output-provider.ts | 4 + 22 files changed, 3467 insertions(+), 1551 deletions(-) diff --git a/packages/amplify-graphql-auth-transformer/src/__tests__/__snapshots__/owner-auth.test.ts.snap b/packages/amplify-graphql-auth-transformer/src/__tests__/__snapshots__/owner-auth.test.ts.snap index a9588e8431..68afd9dfa5 100644 --- a/packages/amplify-graphql-auth-transformer/src/__tests__/__snapshots__/owner-auth.test.ts.snap +++ b/packages/amplify-graphql-auth-transformer/src/__tests__/__snapshots__/owner-auth.test.ts.snap @@ -600,6 +600,895 @@ exports[`owner based @auth owner where field is "::" delimited with only mutatio ## [End] Parse owner field auth for Get. **" `; +exports[`owner based @auth should not add duplicate implicit field when already included 1`] = ` +"type Todo { + owner: String + content: String + id: ID! + createdAt: AWSDateTime! + updatedAt: AWSDateTime! +} + +input ModelStringInput { + ne: String + eq: String + le: String + lt: String + ge: String + gt: String + contains: String + notContains: String + between: [String] + beginsWith: String + attributeExists: Boolean + attributeType: ModelAttributeTypes + size: ModelSizeInput +} + +input ModelIntInput { + ne: Int + eq: Int + le: Int + lt: Int + ge: Int + gt: Int + between: [Int] + attributeExists: Boolean + attributeType: ModelAttributeTypes +} + +input ModelFloatInput { + ne: Float + eq: Float + le: Float + lt: Float + ge: Float + gt: Float + between: [Float] + attributeExists: Boolean + attributeType: ModelAttributeTypes +} + +input ModelBooleanInput { + ne: Boolean + eq: Boolean + attributeExists: Boolean + attributeType: ModelAttributeTypes +} + +input ModelIDInput { + ne: ID + eq: ID + le: ID + lt: ID + ge: ID + gt: ID + contains: ID + notContains: ID + between: [ID] + beginsWith: ID + attributeExists: Boolean + attributeType: ModelAttributeTypes + size: ModelSizeInput +} + +input ModelSubscriptionStringInput { + ne: String + eq: String + le: String + lt: String + ge: String + gt: String + contains: String + notContains: String + between: [String] + beginsWith: String + in: [String] + notIn: [String] +} + +input ModelSubscriptionIntInput { + ne: Int + eq: Int + le: Int + lt: Int + ge: Int + gt: Int + between: [Int] + in: [Int] + notIn: [Int] +} + +input ModelSubscriptionFloatInput { + ne: Float + eq: Float + le: Float + lt: Float + ge: Float + gt: Float + between: [Float] + in: [Float] + notIn: [Float] +} + +input ModelSubscriptionBooleanInput { + ne: Boolean + eq: Boolean +} + +input ModelSubscriptionIDInput { + ne: ID + eq: ID + le: ID + lt: ID + ge: ID + gt: ID + contains: ID + notContains: ID + between: [ID] + beginsWith: ID + in: [ID] + notIn: [ID] +} + +enum ModelAttributeTypes { + binary + binarySet + bool + list + map + number + numberSet + string + stringSet + _null +} + +input ModelSizeInput { + ne: Int + eq: Int + le: Int + lt: Int + ge: Int + gt: Int + between: [Int] +} + +enum ModelSortDirection { + ASC + DESC +} + +type ModelTodoConnection { + items: [Todo]! + nextToken: String +} + +input ModelTodoFilterInput { + owner: ModelStringInput + content: ModelStringInput + id: ModelIDInput + createdAt: ModelStringInput + updatedAt: ModelStringInput + and: [ModelTodoFilterInput] + or: [ModelTodoFilterInput] + not: ModelTodoFilterInput +} + +type Query { + getTodo(id: ID!): Todo + listTodos(filter: ModelTodoFilterInput, limit: Int, nextToken: String): ModelTodoConnection +} + +input ModelTodoConditionInput { + owner: ModelStringInput + content: ModelStringInput + and: [ModelTodoConditionInput] + or: [ModelTodoConditionInput] + not: ModelTodoConditionInput + createdAt: ModelStringInput + updatedAt: ModelStringInput +} + +input CreateTodoInput { + owner: String + content: String + id: ID +} + +input UpdateTodoInput { + owner: String + content: String + id: ID! +} + +input DeleteTodoInput { + id: ID! +} + +type Mutation { + createTodo(input: CreateTodoInput!, condition: ModelTodoConditionInput): Todo + updateTodo(input: UpdateTodoInput!, condition: ModelTodoConditionInput): Todo + deleteTodo(input: DeleteTodoInput!, condition: ModelTodoConditionInput): Todo +} + +input ModelSubscriptionTodoFilterInput { + content: ModelSubscriptionStringInput + id: ModelSubscriptionIDInput + createdAt: ModelSubscriptionStringInput + updatedAt: ModelSubscriptionStringInput + and: [ModelSubscriptionTodoFilterInput] + or: [ModelSubscriptionTodoFilterInput] + owner: ModelStringInput +} + +type Subscription { + onCreateTodo(filter: ModelSubscriptionTodoFilterInput, owner: String): Todo @aws_subscribe(mutations: [\\"createTodo\\"]) + onUpdateTodo(filter: ModelSubscriptionTodoFilterInput, owner: String): Todo @aws_subscribe(mutations: [\\"updateTodo\\"]) + onDeleteTodo(filter: ModelSubscriptionTodoFilterInput, owner: String): Todo @aws_subscribe(mutations: [\\"deleteTodo\\"]) +} +" +`; + +exports[`owner based @auth should not add subscription filter with implicit owner field when subscription is disabled 1`] = ` +"type Todo { + owner: String + content: String + id: ID! + createdAt: AWSDateTime! + updatedAt: AWSDateTime! +} + +input ModelStringInput { + ne: String + eq: String + le: String + lt: String + ge: String + gt: String + contains: String + notContains: String + between: [String] + beginsWith: String + attributeExists: Boolean + attributeType: ModelAttributeTypes + size: ModelSizeInput +} + +input ModelIntInput { + ne: Int + eq: Int + le: Int + lt: Int + ge: Int + gt: Int + between: [Int] + attributeExists: Boolean + attributeType: ModelAttributeTypes +} + +input ModelFloatInput { + ne: Float + eq: Float + le: Float + lt: Float + ge: Float + gt: Float + between: [Float] + attributeExists: Boolean + attributeType: ModelAttributeTypes +} + +input ModelBooleanInput { + ne: Boolean + eq: Boolean + attributeExists: Boolean + attributeType: ModelAttributeTypes +} + +input ModelIDInput { + ne: ID + eq: ID + le: ID + lt: ID + ge: ID + gt: ID + contains: ID + notContains: ID + between: [ID] + beginsWith: ID + attributeExists: Boolean + attributeType: ModelAttributeTypes + size: ModelSizeInput +} + +input ModelSubscriptionStringInput { + ne: String + eq: String + le: String + lt: String + ge: String + gt: String + contains: String + notContains: String + between: [String] + beginsWith: String + in: [String] + notIn: [String] +} + +input ModelSubscriptionIntInput { + ne: Int + eq: Int + le: Int + lt: Int + ge: Int + gt: Int + between: [Int] + in: [Int] + notIn: [Int] +} + +input ModelSubscriptionFloatInput { + ne: Float + eq: Float + le: Float + lt: Float + ge: Float + gt: Float + between: [Float] + in: [Float] + notIn: [Float] +} + +input ModelSubscriptionBooleanInput { + ne: Boolean + eq: Boolean +} + +input ModelSubscriptionIDInput { + ne: ID + eq: ID + le: ID + lt: ID + ge: ID + gt: ID + contains: ID + notContains: ID + between: [ID] + beginsWith: ID + in: [ID] + notIn: [ID] +} + +enum ModelAttributeTypes { + binary + binarySet + bool + list + map + number + numberSet + string + stringSet + _null +} + +input ModelSizeInput { + ne: Int + eq: Int + le: Int + lt: Int + ge: Int + gt: Int + between: [Int] +} + +enum ModelSortDirection { + ASC + DESC +} + +type ModelTodoConnection { + items: [Todo]! + nextToken: String +} + +input ModelTodoFilterInput { + owner: ModelStringInput + content: ModelStringInput + id: ModelIDInput + createdAt: ModelStringInput + updatedAt: ModelStringInput + and: [ModelTodoFilterInput] + or: [ModelTodoFilterInput] + not: ModelTodoFilterInput +} + +type Query { + getTodo(id: ID!): Todo + listTodos(filter: ModelTodoFilterInput, limit: Int, nextToken: String): ModelTodoConnection +} + +input ModelTodoConditionInput { + owner: ModelStringInput + content: ModelStringInput + and: [ModelTodoConditionInput] + or: [ModelTodoConditionInput] + not: ModelTodoConditionInput + createdAt: ModelStringInput + updatedAt: ModelStringInput +} + +input CreateTodoInput { + owner: String + content: String + id: ID +} + +input UpdateTodoInput { + owner: String + content: String + id: ID! +} + +input DeleteTodoInput { + id: ID! +} + +type Mutation { + createTodo(input: CreateTodoInput!, condition: ModelTodoConditionInput): Todo + updateTodo(input: UpdateTodoInput!, condition: ModelTodoConditionInput): Todo + deleteTodo(input: DeleteTodoInput!, condition: ModelTodoConditionInput): Todo +} +" +`; + +exports[`owner based @auth should successfully transform simple valid schema with implicit fields 1`] = ` +"type Todo { + content: String + id: ID! + createdAt: AWSDateTime! + updatedAt: AWSDateTime! + owner: String +} + +input ModelStringInput { + ne: String + eq: String + le: String + lt: String + ge: String + gt: String + contains: String + notContains: String + between: [String] + beginsWith: String + attributeExists: Boolean + attributeType: ModelAttributeTypes + size: ModelSizeInput +} + +input ModelIntInput { + ne: Int + eq: Int + le: Int + lt: Int + ge: Int + gt: Int + between: [Int] + attributeExists: Boolean + attributeType: ModelAttributeTypes +} + +input ModelFloatInput { + ne: Float + eq: Float + le: Float + lt: Float + ge: Float + gt: Float + between: [Float] + attributeExists: Boolean + attributeType: ModelAttributeTypes +} + +input ModelBooleanInput { + ne: Boolean + eq: Boolean + attributeExists: Boolean + attributeType: ModelAttributeTypes +} + +input ModelIDInput { + ne: ID + eq: ID + le: ID + lt: ID + ge: ID + gt: ID + contains: ID + notContains: ID + between: [ID] + beginsWith: ID + attributeExists: Boolean + attributeType: ModelAttributeTypes + size: ModelSizeInput +} + +input ModelSubscriptionStringInput { + ne: String + eq: String + le: String + lt: String + ge: String + gt: String + contains: String + notContains: String + between: [String] + beginsWith: String + in: [String] + notIn: [String] +} + +input ModelSubscriptionIntInput { + ne: Int + eq: Int + le: Int + lt: Int + ge: Int + gt: Int + between: [Int] + in: [Int] + notIn: [Int] +} + +input ModelSubscriptionFloatInput { + ne: Float + eq: Float + le: Float + lt: Float + ge: Float + gt: Float + between: [Float] + in: [Float] + notIn: [Float] +} + +input ModelSubscriptionBooleanInput { + ne: Boolean + eq: Boolean +} + +input ModelSubscriptionIDInput { + ne: ID + eq: ID + le: ID + lt: ID + ge: ID + gt: ID + contains: ID + notContains: ID + between: [ID] + beginsWith: ID + in: [ID] + notIn: [ID] +} + +enum ModelAttributeTypes { + binary + binarySet + bool + list + map + number + numberSet + string + stringSet + _null +} + +input ModelSizeInput { + ne: Int + eq: Int + le: Int + lt: Int + ge: Int + gt: Int + between: [Int] +} + +enum ModelSortDirection { + ASC + DESC +} + +type ModelTodoConnection { + items: [Todo]! + nextToken: String +} + +input ModelTodoFilterInput { + content: ModelStringInput + id: ModelIDInput + createdAt: ModelStringInput + updatedAt: ModelStringInput + and: [ModelTodoFilterInput] + or: [ModelTodoFilterInput] + not: ModelTodoFilterInput + owner: ModelStringInput +} + +type Query { + getTodo(id: ID!): Todo + listTodos(filter: ModelTodoFilterInput, limit: Int, nextToken: String): ModelTodoConnection +} + +input ModelTodoConditionInput { + content: ModelStringInput + and: [ModelTodoConditionInput] + or: [ModelTodoConditionInput] + not: ModelTodoConditionInput + createdAt: ModelStringInput + updatedAt: ModelStringInput + owner: ModelStringInput +} + +input CreateTodoInput { + content: String + id: ID +} + +input UpdateTodoInput { + content: String + id: ID! +} + +input DeleteTodoInput { + id: ID! +} + +type Mutation { + createTodo(input: CreateTodoInput!, condition: ModelTodoConditionInput): Todo + updateTodo(input: UpdateTodoInput!, condition: ModelTodoConditionInput): Todo + deleteTodo(input: DeleteTodoInput!, condition: ModelTodoConditionInput): Todo +} + +input ModelSubscriptionTodoFilterInput { + content: ModelSubscriptionStringInput + id: ModelSubscriptionIDInput + createdAt: ModelSubscriptionStringInput + updatedAt: ModelSubscriptionStringInput + and: [ModelSubscriptionTodoFilterInput] + or: [ModelSubscriptionTodoFilterInput] + owner: ModelStringInput +} + +type Subscription { + onCreateTodo(filter: ModelSubscriptionTodoFilterInput, owner: String): Todo @aws_subscribe(mutations: [\\"createTodo\\"]) + onUpdateTodo(filter: ModelSubscriptionTodoFilterInput, owner: String): Todo @aws_subscribe(mutations: [\\"updateTodo\\"]) + onDeleteTodo(filter: ModelSubscriptionTodoFilterInput, owner: String): Todo @aws_subscribe(mutations: [\\"deleteTodo\\"]) +} +" +`; + +exports[`owner based @auth should successfully transform simple valid schema with implicit fields 2`] = ` +"type Todo { + id: ID! + content: String + owner: String +} + +input ModelStringInput { + ne: String + eq: String + le: String + lt: String + ge: String + gt: String + contains: String + notContains: String + between: [String] + beginsWith: String + attributeExists: Boolean + attributeType: ModelAttributeTypes + size: ModelSizeInput +} + +input ModelIntInput { + ne: Int + eq: Int + le: Int + lt: Int + ge: Int + gt: Int + between: [Int] + attributeExists: Boolean + attributeType: ModelAttributeTypes +} + +input ModelFloatInput { + ne: Float + eq: Float + le: Float + lt: Float + ge: Float + gt: Float + between: [Float] + attributeExists: Boolean + attributeType: ModelAttributeTypes +} + +input ModelBooleanInput { + ne: Boolean + eq: Boolean + attributeExists: Boolean + attributeType: ModelAttributeTypes +} + +input ModelIDInput { + ne: ID + eq: ID + le: ID + lt: ID + ge: ID + gt: ID + contains: ID + notContains: ID + between: [ID] + beginsWith: ID + attributeExists: Boolean + attributeType: ModelAttributeTypes + size: ModelSizeInput +} + +input ModelSubscriptionStringInput { + ne: String + eq: String + le: String + lt: String + ge: String + gt: String + contains: String + notContains: String + between: [String] + beginsWith: String + in: [String] + notIn: [String] +} + +input ModelSubscriptionIntInput { + ne: Int + eq: Int + le: Int + lt: Int + ge: Int + gt: Int + between: [Int] + in: [Int] + notIn: [Int] +} + +input ModelSubscriptionFloatInput { + ne: Float + eq: Float + le: Float + lt: Float + ge: Float + gt: Float + between: [Float] + in: [Float] + notIn: [Float] +} + +input ModelSubscriptionBooleanInput { + ne: Boolean + eq: Boolean +} + +input ModelSubscriptionIDInput { + ne: ID + eq: ID + le: ID + lt: ID + ge: ID + gt: ID + contains: ID + notContains: ID + between: [ID] + beginsWith: ID + in: [ID] + notIn: [ID] +} + +enum ModelAttributeTypes { + binary + binarySet + bool + list + map + number + numberSet + string + stringSet + _null +} + +input ModelSizeInput { + ne: Int + eq: Int + le: Int + lt: Int + ge: Int + gt: Int + between: [Int] +} + +enum ModelSortDirection { + ASC + DESC +} + +type ModelTodoConnection { + items: [Todo]! + nextToken: String +} + +input ModelTodoFilterInput { + id: ModelIDInput + content: ModelStringInput + and: [ModelTodoFilterInput] + or: [ModelTodoFilterInput] + not: ModelTodoFilterInput +} + +type Query { + getTodo(id: ID!): Todo + listTodos(id: ID, filter: ModelTodoFilterInput, limit: Int, nextToken: String, sortDirection: ModelSortDirection): ModelTodoConnection +} + +input ModelTodoConditionInput { + content: ModelStringInput + and: [ModelTodoConditionInput] + or: [ModelTodoConditionInput] + not: ModelTodoConditionInput +} + +input CreateTodoInput { + id: ID + content: String +} + +input UpdateTodoInput { + id: ID! + content: String +} + +input DeleteTodoInput { + id: ID! +} + +type Mutation { + createTodo(input: CreateTodoInput!, condition: ModelTodoConditionInput): Todo + updateTodo(input: UpdateTodoInput!, condition: ModelTodoConditionInput): Todo + deleteTodo(input: DeleteTodoInput!, condition: ModelTodoConditionInput): Todo +} + +input ModelSubscriptionTodoFilterInput { + id: ModelSubscriptionIDInput + content: ModelSubscriptionStringInput + and: [ModelSubscriptionTodoFilterInput] + or: [ModelSubscriptionTodoFilterInput] +} + +type Subscription { + onCreateTodo(filter: ModelSubscriptionTodoFilterInput, owner: String): Todo @aws_subscribe(mutations: [\\"createTodo\\"]) + onUpdateTodo(filter: ModelSubscriptionTodoFilterInput, owner: String): Todo @aws_subscribe(mutations: [\\"updateTodo\\"]) + onDeleteTodo(filter: ModelSubscriptionTodoFilterInput, owner: String): Todo @aws_subscribe(mutations: [\\"deleteTodo\\"]) +} +" +`; + exports[`owner based @auth sort key fields on @auth owner field owner field as part of global secondary index handles ownerfield as GSI field with default identity claim 1`] = ` "## [Start] Authorization Steps. ** $util.qr($ctx.stash.put(\\"hasAuth\\", true)) diff --git a/packages/amplify-graphql-auth-transformer/src/__tests__/owner-auth.test.ts b/packages/amplify-graphql-auth-transformer/src/__tests__/owner-auth.test.ts index cb6e4595d5..76dc22a079 100644 --- a/packages/amplify-graphql-auth-transformer/src/__tests__/owner-auth.test.ts +++ b/packages/amplify-graphql-auth-transformer/src/__tests__/owner-auth.test.ts @@ -1,11 +1,11 @@ import { parse } from 'graphql'; import { ModelTransformer } from '@aws-amplify/graphql-model-transformer'; import { PrimaryKeyTransformer, IndexTransformer } from '@aws-amplify/graphql-index-transformer'; -import { validateModelSchema } from '@aws-amplify/graphql-transformer-core'; +import { validateModelSchema, constructDataSourceStrategies, MYSQL_DB_TYPE } from '@aws-amplify/graphql-transformer-core'; import { ResourceConstants } from 'graphql-transformer-common'; import { AppSyncAuthConfiguration } from '@aws-amplify/graphql-transformer-interfaces'; import { HasManyTransformer } from '@aws-amplify/graphql-relational-transformer'; -import { testTransform } from '@aws-amplify/graphql-transformer-test-utils'; +import { testTransform, mockSqlDataSourceStrategy } from '@aws-amplify/graphql-transformer-test-utils'; import { AuthTransformer } from '../graphql-auth-transformer'; import { getField, getObjectType } from './test-helpers'; @@ -456,6 +456,110 @@ describe('owner based @auth', () => { expect(out.resolvers['Query.listPosts.auth.1.req.vtl']).toMatchSnapshot(); }); + it('should successfully transform simple valid schema with implicit fields', async () => { + const authConfig: AppSyncAuthConfiguration = { + defaultAuthentication: { + authenticationType: 'AMAZON_COGNITO_USER_POOLS', + }, + additionalAuthenticationProviders: [], + }; + const validSchema = ` + type Todo @model @auth(rules: [{ allow: owner }]) { + content: String + } + `; + + const out = testTransform({ + schema: validSchema, + authConfig, + transformers: [new ModelTransformer(), new AuthTransformer()], + }); + expect(out).toBeDefined(); + + validateModelSchema(parse(out.schema)); + parse(out.schema); + expect(out.schema).toMatchSnapshot(); + }); + + it('should not add duplicate implicit field when already included', async () => { + const authConfig: AppSyncAuthConfiguration = { + defaultAuthentication: { + authenticationType: 'AMAZON_COGNITO_USER_POOLS', + }, + additionalAuthenticationProviders: [], + }; + const validSchema = ` + type Todo @model @auth(rules: [{ allow: owner }]) { + owner: String + content: String + } + `; + + const out = testTransform({ + schema: validSchema, + authConfig, + transformers: [new ModelTransformer(), new AuthTransformer()], + }); + expect(out).toBeDefined(); + + validateModelSchema(parse(out.schema)); + parse(out.schema); + expect(out.schema).toMatchSnapshot(); + }); + + it('should successfully transform simple valid schema with implicit fields', async () => { + const authConfig: AppSyncAuthConfiguration = { + defaultAuthentication: { + authenticationType: 'AMAZON_COGNITO_USER_POOLS', + }, + additionalAuthenticationProviders: [], + }; + const validSchema = ` + type Todo @model @auth(rules: [{ allow: owner }]) { + id: ID! @primaryKey + content: String + } + `; + + const out = testTransform({ + schema: validSchema, + authConfig, + transformers: [new ModelTransformer(), new AuthTransformer(), new PrimaryKeyTransformer()], + dataSourceStrategies: constructDataSourceStrategies(validSchema, mockSqlDataSourceStrategy()), + }); + expect(out).toBeDefined(); + + validateModelSchema(parse(out.schema)); + parse(out.schema); + expect(out.schema).toMatchSnapshot(); + }); + + it('should not add subscription filter with implicit owner field when subscription is disabled', async () => { + const authConfig: AppSyncAuthConfiguration = { + defaultAuthentication: { + authenticationType: 'AMAZON_COGNITO_USER_POOLS', + }, + additionalAuthenticationProviders: [], + }; + const validSchema = ` + type Todo @model(subscriptions: null) @auth(rules: [{ allow: owner }]) { + owner: String + content: String + } + `; + + const out = testTransform({ + schema: validSchema, + authConfig, + transformers: [new ModelTransformer(), new AuthTransformer()], + }); + expect(out).toBeDefined(); + + validateModelSchema(parse(out.schema)); + parse(out.schema); + expect(out.schema).toMatchSnapshot(); + }); + describe('with identity claim feature flag disabled', () => { test('auth transformer validation happy case', () => { const authConfig: AppSyncAuthConfiguration = { diff --git a/packages/amplify-graphql-auth-transformer/src/graphql-auth-transformer.ts b/packages/amplify-graphql-auth-transformer/src/graphql-auth-transformer.ts index e81155e570..9da63ec785 100644 --- a/packages/amplify-graphql-auth-transformer/src/graphql-auth-transformer.ts +++ b/packages/amplify-graphql-auth-transformer/src/graphql-auth-transformer.ts @@ -10,6 +10,12 @@ import { isSqlModel, getModelDataSourceNameForTypeName, isModelType, + getFilterInputName, + getConditionInputName, + getSubscriptionFilterInputName, + getConnectionName, + InputFieldWrapper, + isDynamoDbModel, } from '@aws-amplify/graphql-transformer-core'; import { DataSourceProvider, @@ -42,6 +48,7 @@ import { getBaseType, makeDirective, makeField, + makeInputValueDefinition, makeNamedType, ResourceConstants, ModelResourceIDs, @@ -334,8 +341,41 @@ export class AuthTransformer extends TransformerAuthBase implements TransformerA this.authModelConfig.forEach((acm, modelName) => { const def = context.output.getObject(modelName)!; const modelHasSearchable = def.directives.some((dir) => dir.name.value === 'searchable'); + const ownerFields = getOwnerFields(acm); + if (isDynamoDbModel(context, modelName)) { + const filterInput = context.output.getInput(getFilterInputName(modelName)); + if (filterInput) { + const updatedFilterInput = { ...filterInput, fields: [...filterInput.fields] }; + ownerFields.forEach((ownerField) => { + if (!filterInput.fields.some((field) => field.name.value === ownerField)) { + updatedFilterInput.fields.push(makeInputValueDefinition(ownerField, makeNamedType('ModelStringInput'))); + } + }); + context.output.updateInput(updatedFilterInput); + } + const conditionInput = context.output.getInput(getConditionInputName(modelName)); + if (conditionInput) { + const updatedConditionInput = { ...conditionInput, fields: [...conditionInput.fields] }; + ownerFields.forEach((ownerField) => { + if (!conditionInput.fields.some((field) => field.name.value === ownerField)) { + updatedConditionInput.fields.push(makeInputValueDefinition(ownerField, makeNamedType('ModelStringInput'))); + } + }); + context.output.updateInput(updatedConditionInput); + } + const subscriptionFilterInput = context.output.getInput(getSubscriptionFilterInputName(modelName)); + if (subscriptionFilterInput) { + const updatedSubscriptionFilterInput = { ...subscriptionFilterInput, fields: [...subscriptionFilterInput.fields] }; + ownerFields.forEach((ownerField) => { + if (!subscriptionFilterInput.fields.some((field) => field.name.value === ownerField)) { + updatedSubscriptionFilterInput.fields.push(makeInputValueDefinition(ownerField, makeNamedType('ModelStringInput'))); + } + }); + context.output.updateInput(updatedSubscriptionFilterInput); + } + } // collect ownerFields and them in the model - this.addFieldsToObject(context, modelName, getOwnerFields(acm)); + this.addFieldsToObject(context, modelName, ownerFields); // Get the directives we need to add to the GraphQL nodes const providers = this.getAuthProviders(acm.getRoles()); const addDefaultIfNeeded = providers.length === 0 ? this.configuredAuthProviders.shouldAddDefaultServiceDirective : false; diff --git a/packages/amplify-graphql-default-value-transformer/src/__tests__/__snapshots__/amplify-grapphql-default-value-transformer.test.ts.snap b/packages/amplify-graphql-default-value-transformer/src/__tests__/__snapshots__/amplify-grapphql-default-value-transformer.test.ts.snap index 13f6150766..320a27b4e9 100644 --- a/packages/amplify-graphql-default-value-transformer/src/__tests__/__snapshots__/amplify-grapphql-default-value-transformer.test.ts.snap +++ b/packages/amplify-graphql-default-value-transformer/src/__tests__/__snapshots__/amplify-grapphql-default-value-transformer.test.ts.snap @@ -166,6 +166,8 @@ type ModelTestConnection { input ModelTestFilterInput { id: ModelIDInput stringValue: ModelStringInput + createdAt: ModelStringInput + updatedAt: ModelStringInput and: [ModelTestFilterInput] or: [ModelTestFilterInput] not: ModelTestFilterInput @@ -181,6 +183,8 @@ input ModelTestConditionInput { and: [ModelTestConditionInput] or: [ModelTestConditionInput] not: ModelTestConditionInput + createdAt: ModelStringInput + updatedAt: ModelStringInput } input CreateTestInput { @@ -206,6 +210,8 @@ type Mutation { input ModelSubscriptionTestFilterInput { id: ModelSubscriptionIDInput stringValue: ModelSubscriptionStringInput + createdAt: ModelSubscriptionStringInput + updatedAt: ModelSubscriptionStringInput and: [ModelSubscriptionTestFilterInput] or: [ModelSubscriptionTestFilterInput] } @@ -429,6 +435,8 @@ input ModelPostFilterInput { enumValue: ModelTagInput awsTimeValue: ModelStringInput awsDateTime: ModelStringInput + createdAt: ModelStringInput + updatedAt: ModelStringInput and: [ModelPostFilterInput] or: [ModelPostFilterInput] not: ModelPostFilterInput @@ -458,6 +466,8 @@ input ModelPostConditionInput { and: [ModelPostConditionInput] or: [ModelPostConditionInput] not: ModelPostConditionInput + createdAt: ModelStringInput + updatedAt: ModelStringInput } input CreatePostInput { @@ -525,6 +535,8 @@ input ModelSubscriptionPostFilterInput { enumValue: ModelSubscriptionStringInput awsTimeValue: ModelSubscriptionStringInput awsDateTime: ModelSubscriptionStringInput + createdAt: ModelSubscriptionStringInput + updatedAt: ModelSubscriptionStringInput and: [ModelSubscriptionPostFilterInput] or: [ModelSubscriptionPostFilterInput] } diff --git a/packages/amplify-graphql-model-transformer/API.md b/packages/amplify-graphql-model-transformer/API.md index 1e47418f6a..267904ff2d 100644 --- a/packages/amplify-graphql-model-transformer/API.md +++ b/packages/amplify-graphql-model-transformer/API.md @@ -120,7 +120,7 @@ export function makeModelScalarFilterInputObject(type: string, supportsCondition export const makeModelSortDirectionEnumObject: () => EnumTypeDefinitionNode; // @public (undocumented) -export const makeMutationConditionInput: (ctx: TransformerTransformSchemaStepContextProvider, name: string, object: ObjectTypeDefinitionNode) => InputObjectTypeDefinitionNode; +export const makeMutationConditionInput: (ctx: TransformerTransformSchemaStepContextProvider, name: string, object: ObjectTypeDefinitionNode, modelDirectiveConfig: ModelDirectiveConfiguration) => InputObjectTypeDefinitionNode; // @public (undocumented) export function makeSizeInputType(): InputObjectTypeDefinitionNode; diff --git a/packages/amplify-graphql-model-transformer/src/__tests__/__snapshots__/model-transformer.test.ts.snap b/packages/amplify-graphql-model-transformer/src/__tests__/__snapshots__/model-transformer.test.ts.snap index 6e64fab85b..e2ff2b6981 100644 --- a/packages/amplify-graphql-model-transformer/src/__tests__/__snapshots__/model-transformer.test.ts.snap +++ b/packages/amplify-graphql-model-transformer/src/__tests__/__snapshots__/model-transformer.test.ts.snap @@ -166,6 +166,8 @@ type ModelTaskConnection { input ModelTaskFilterInput { id: ModelIntInput title: ModelStringInput + createdAt: ModelStringInput + updatedAt: ModelStringInput and: [ModelTaskFilterInput] or: [ModelTaskFilterInput] not: ModelTaskFilterInput @@ -182,6 +184,8 @@ input ModelTaskConditionInput { and: [ModelTaskConditionInput] or: [ModelTaskConditionInput] not: ModelTaskConditionInput + createdAt: ModelStringInput + updatedAt: ModelStringInput } input CreateTaskInput { @@ -207,6 +211,8 @@ type Mutation { input ModelSubscriptionTaskFilterInput { id: ModelSubscriptionIntInput title: ModelSubscriptionStringInput + createdAt: ModelSubscriptionStringInput + updatedAt: ModelSubscriptionStringInput and: [ModelSubscriptionTaskFilterInput] or: [ModelSubscriptionTaskFilterInput] } @@ -397,6 +403,8 @@ type ModelTestConnection { input ModelTestFilterInput { id: ModelIDInput + createdAt: ModelStringInput + updatedAt: ModelStringInput and: [ModelTestFilterInput] or: [ModelTestFilterInput] not: ModelTestFilterInput @@ -417,6 +425,8 @@ input ModelTestConditionInput { or: [ModelTestConditionInput] not: ModelTestConditionInput _deleted: ModelBooleanInput + createdAt: ModelStringInput + updatedAt: ModelStringInput } input CreateTestInput { @@ -445,6 +455,8 @@ type Mutation { input ModelSubscriptionTestFilterInput { id: ModelSubscriptionIDInput + createdAt: ModelSubscriptionStringInput + updatedAt: ModelSubscriptionStringInput and: [ModelSubscriptionTestFilterInput] or: [ModelSubscriptionTestFilterInput] _deleted: ModelBooleanInput @@ -467,6 +479,8 @@ type ModelEmailConnection { input ModelEmailFilterInput { id: ModelIDInput + createdAt: ModelStringInput + updatedAt: ModelStringInput and: [ModelEmailFilterInput] or: [ModelEmailFilterInput] not: ModelEmailFilterInput @@ -478,6 +492,8 @@ input ModelEmailConditionInput { or: [ModelEmailConditionInput] not: ModelEmailConditionInput _deleted: ModelBooleanInput + createdAt: ModelStringInput + updatedAt: ModelStringInput } input CreateEmailInput { @@ -497,6 +513,8 @@ input DeleteEmailInput { input ModelSubscriptionEmailFilterInput { id: ModelSubscriptionIDInput + createdAt: ModelSubscriptionStringInput + updatedAt: ModelSubscriptionStringInput and: [ModelSubscriptionEmailFilterInput] or: [ModelSubscriptionEmailFilterInput] _deleted: ModelBooleanInput @@ -873,6 +891,8 @@ type ModelAuthorConnection { input ModelAuthorFilterInput { id: ModelIDInput name: ModelStringInput + createdAt: ModelStringInput + updatedAt: ModelStringInput and: [ModelAuthorFilterInput] or: [ModelAuthorFilterInput] not: ModelAuthorFilterInput @@ -885,6 +905,8 @@ input ModelAuthorConditionInput { or: [ModelAuthorConditionInput] not: ModelAuthorConditionInput _deleted: ModelBooleanInput + createdAt: ModelStringInput + updatedAt: ModelStringInput } input CreateAuthorInput { @@ -911,6 +933,8 @@ input DeleteAuthorInput { input ModelSubscriptionAuthorFilterInput { id: ModelSubscriptionIDInput name: ModelSubscriptionStringInput + createdAt: ModelSubscriptionStringInput + updatedAt: ModelSubscriptionStringInput and: [ModelSubscriptionAuthorFilterInput] or: [ModelSubscriptionAuthorFilterInput] _deleted: ModelBooleanInput @@ -926,6 +950,8 @@ input ModelRequireFilterInput { id: ModelIDInput requiredField: ModelStringInput notRequiredField: ModelStringInput + createdAt: ModelStringInput + updatedAt: ModelStringInput and: [ModelRequireFilterInput] or: [ModelRequireFilterInput] not: ModelRequireFilterInput @@ -939,6 +965,8 @@ input ModelRequireConditionInput { or: [ModelRequireConditionInput] not: ModelRequireConditionInput _deleted: ModelBooleanInput + createdAt: ModelStringInput + updatedAt: ModelStringInput } input CreateRequireInput { @@ -964,6 +992,8 @@ input ModelSubscriptionRequireFilterInput { id: ModelSubscriptionIDInput requiredField: ModelSubscriptionStringInput notRequiredField: ModelSubscriptionStringInput + createdAt: ModelSubscriptionStringInput + updatedAt: ModelSubscriptionStringInput and: [ModelSubscriptionRequireFilterInput] or: [ModelSubscriptionRequireFilterInput] _deleted: ModelBooleanInput @@ -980,6 +1010,7 @@ input ModelCommentFilterInput { title: ModelStringInput content: ModelStringInput updatedOn: ModelIntInput + createdOn: ModelStringInput and: [ModelCommentFilterInput] or: [ModelCommentFilterInput] not: ModelCommentFilterInput @@ -994,6 +1025,7 @@ input ModelCommentConditionInput { or: [ModelCommentConditionInput] not: ModelCommentConditionInput _deleted: ModelBooleanInput + createdOn: ModelStringInput } input CreateCommentInput { @@ -1022,6 +1054,7 @@ input ModelSubscriptionCommentFilterInput { title: ModelSubscriptionStringInput content: ModelSubscriptionStringInput updatedOn: ModelSubscriptionIntInput + createdOn: ModelSubscriptionStringInput and: [ModelSubscriptionCommentFilterInput] or: [ModelSubscriptionCommentFilterInput] _deleted: ModelBooleanInput @@ -4093,6 +4126,8 @@ input ModelPostConditionInput { or: [ModelPostConditionInput] not: ModelPostConditionInput _deleted: ModelBooleanInput + createdAt: ModelStringInput + updatedAt: ModelStringInput } input CreatePostInput { @@ -5732,6 +5767,8 @@ type ModelModelTypeConnection { input ModelModelTypeFilterInput { id: ModelIDInput title: ModelStringInput + createdAt: ModelStringInput + updatedAt: ModelStringInput and: [ModelModelTypeFilterInput] or: [ModelModelTypeFilterInput] not: ModelModelTypeFilterInput @@ -5750,6 +5787,8 @@ input ModelModelTypeConditionInput { or: [ModelModelTypeConditionInput] not: ModelModelTypeConditionInput _deleted: ModelBooleanInput + createdAt: ModelStringInput + updatedAt: ModelStringInput } input CreateModelTypeInput { @@ -5780,6 +5819,8 @@ type Mutation { input ModelSubscriptionModelTypeFilterInput { id: ModelSubscriptionIDInput title: ModelSubscriptionStringInput + createdAt: ModelSubscriptionStringInput + updatedAt: ModelSubscriptionStringInput and: [ModelSubscriptionModelTypeFilterInput] or: [ModelSubscriptionModelTypeFilterInput] _deleted: ModelBooleanInput @@ -5963,6 +6004,8 @@ type ModelPostConnection { input ModelPostFilterInput { id: ModelIDInput str: ModelStringInput + createdOn: ModelStringInput + updatedOn: ModelStringInput and: [ModelPostFilterInput] or: [ModelPostFilterInput] not: ModelPostFilterInput @@ -5981,6 +6024,8 @@ input ModelPostConditionInput { or: [ModelPostConditionInput] not: ModelPostConditionInput _deleted: ModelBooleanInput + createdOn: ModelStringInput + updatedOn: ModelStringInput } input CreatePostInput { @@ -6009,6 +6054,8 @@ type Mutation { input ModelSubscriptionPostFilterInput { id: ModelSubscriptionIDInput str: ModelSubscriptionStringInput + createdOn: ModelSubscriptionStringInput + updatedOn: ModelSubscriptionStringInput and: [ModelSubscriptionPostFilterInput] or: [ModelSubscriptionPostFilterInput] _deleted: ModelBooleanInput diff --git a/packages/amplify-graphql-model-transformer/src/graphql-model-transformer.ts b/packages/amplify-graphql-model-transformer/src/graphql-model-transformer.ts index acbb3d854a..ea2e71c67e 100644 --- a/packages/amplify-graphql-model-transformer/src/graphql-model-transformer.ts +++ b/packages/amplify-graphql-model-transformer/src/graphql-model-transformer.ts @@ -14,6 +14,10 @@ import { ObjectDefinitionWrapper, SyncUtils, TransformerModelBase, + getFilterInputName, + getConditionInputName, + getSubscriptionFilterInputName, + getConnectionName, } from '@aws-amplify/graphql-transformer-core'; import { AppSyncDataSourceType, @@ -51,7 +55,6 @@ import { makeNamedType, makeNonNullType, makeValueNode, - toPascalCase, toUpper, } from 'graphql-transformer-common'; import { @@ -287,6 +290,13 @@ export class ModelTransformer extends TransformerModelBase implements Transforme this.ensureModelSortDirectionEnum(ctx); this.typesWithModelDirective.forEach((type) => { + const defBeforeImplicitFields = ctx.output.getObject(type)!; + const typeName = defBeforeImplicitFields.name.value; + if (isDynamoDbModel(ctx, typeName)) { + // Update the field with auto generatable Fields + this.addAutoGeneratableFields(ctx, type); + } + // get def after implict timestamp fields have been added const def = ctx.output.getObject(type)!; const hasAuth = def.directives!.some((dir) => dir.name.value === 'auth'); @@ -296,17 +306,14 @@ export class ModelTransformer extends TransformerModelBase implements Transforme const queryFields = this.createQueryFields(ctx, def); ctx.output.addQueryFields(queryFields); - const mutationFields = this.createMutationFields(ctx, def); + // use def before implicit timestamp fields are added so that mutation inputs do no include the implicit timestamp fields + const mutationFields = this.createMutationFields(ctx, defBeforeImplicitFields); ctx.output.addMutationFields(mutationFields); const subscriptionsFields = this.createSubscriptionFields(ctx, def!); ctx.output.addSubscriptionFields(subscriptionsFields); - const typeName = def.name.value; if (isDynamoDbModel(ctx, typeName)) { - // Update the field with auto generatable Fields - this.addAutoGeneratableFields(ctx, type); - if (ctx.isProjectUsingDataStore()) { this.addModelSyncFields(ctx, type); } @@ -604,10 +611,10 @@ export class ModelTransformer extends TransformerModelBase implements Transforme const knownModels = this.typesWithModelDirective; let conditionInput: InputObjectTypeDefinitionNode; if ([MutationFieldType.CREATE, MutationFieldType.DELETE, MutationFieldType.UPDATE].includes(operation.type as MutationFieldType)) { - const conditionTypeName = toPascalCase(['Model', type.name.value, 'ConditionInput']); + const conditionTypeName = getConditionInputName(type.name.value); const filterInputs = createEnumModelFilters(ctx, type); - conditionInput = makeMutationConditionInput(ctx, conditionTypeName, type); + conditionInput = makeMutationConditionInput(ctx, conditionTypeName, type, this.modelDirectiveConfig.get(type.name.value)!); filterInputs.push(conditionInput); filterInputs.forEach((input) => { const conditionInputName = input.name.value; @@ -621,7 +628,7 @@ export class ModelTransformer extends TransformerModelBase implements Transforme return [makeInputValueDefinition('id', makeNonNullType(makeNamedType('ID')))]; case QueryFieldType.LIST: { - const filterInputName = toPascalCase(['Model', type.name.value, 'FilterInput']); + const filterInputName = getFilterInputName(type.name.value); const filterInputs = createEnumModelFilters(ctx, type); filterInputs.push(makeListQueryFilterInput(ctx, filterInputName, type)); filterInputs.forEach((input) => { @@ -638,7 +645,7 @@ export class ModelTransformer extends TransformerModelBase implements Transforme ]; } case QueryFieldType.SYNC: { - const syncFilterInputName = toPascalCase(['Model', type.name.value, 'FilterInput']); + const syncFilterInputName = getFilterInputName(type.name.value); const syncFilterInputs = makeListQueryFilterInput(ctx, syncFilterInputName, type); const conditionInputName = syncFilterInputs.name.value; if (!ctx.output.getType(conditionInputName)) { @@ -699,7 +706,7 @@ export class ModelTransformer extends TransformerModelBase implements Transforme case SubscriptionFieldType.ON_CREATE: case SubscriptionFieldType.ON_DELETE: case SubscriptionFieldType.ON_UPDATE: { - const filterInputName = toPascalCase(['ModelSubscription', type.name.value, 'FilterInput']); + const filterInputName = getSubscriptionFilterInputName(type.name.value); const filterInputs = createEnumModelFilters(ctx, type); filterInputs.push(makeSubscriptionQueryFilterInput(ctx, filterInputName, type)); filterInputs.forEach((input) => { @@ -740,7 +747,7 @@ export class ModelTransformer extends TransformerModelBase implements Transforme case QueryFieldType.SYNC: case QueryFieldType.LIST: { const isSyncEnabled = ctx.isProjectUsingDataStore(); - const connectionFieldName = toPascalCase(['Model', type.name.value, 'Connection']); + const connectionFieldName = getConnectionName(type.name.value); outputType = makeListQueryModel(type, connectionFieldName, isSyncEnabled); break; } diff --git a/packages/amplify-graphql-model-transformer/src/graphql-types/common.ts b/packages/amplify-graphql-model-transformer/src/graphql-types/common.ts index 5a084092a1..e6de8e2816 100644 --- a/packages/amplify-graphql-model-transformer/src/graphql-types/common.ts +++ b/packages/amplify-graphql-model-transformer/src/graphql-types/common.ts @@ -22,6 +22,7 @@ import { makeValueNode, ModelResourceIDs, STANDARD_SCALARS, + APPSYNC_DEFINED_SCALARS, toPascalCase, } from 'graphql-transformer-common'; import { diff --git a/packages/amplify-graphql-model-transformer/src/graphql-types/mutation.ts b/packages/amplify-graphql-model-transformer/src/graphql-types/mutation.ts index af039d8bce..772932ab64 100644 --- a/packages/amplify-graphql-model-transformer/src/graphql-types/mutation.ts +++ b/packages/amplify-graphql-model-transformer/src/graphql-types/mutation.ts @@ -1,7 +1,12 @@ import { TransformerTransformSchemaStepContextProvider } from '@aws-amplify/graphql-transformer-interfaces'; import { DocumentNode, InputObjectTypeDefinitionNode, ObjectTypeDefinitionNode } from 'graphql'; import { ModelResourceIDs, getBaseType, toPascalCase } from 'graphql-transformer-common'; -import { InputFieldWrapper, InputObjectDefinitionWrapper, ObjectDefinitionWrapper } from '@aws-amplify/graphql-transformer-core'; +import { + InputFieldWrapper, + InputObjectDefinitionWrapper, + ObjectDefinitionWrapper, + isDynamoDbModel, +} from '@aws-amplify/graphql-transformer-core'; import { ModelDirectiveConfiguration } from '../directive'; import { makeConditionFilterInput } from './common'; @@ -162,11 +167,25 @@ export const makeMutationConditionInput = ( ctx: TransformerTransformSchemaStepContextProvider, name: string, object: ObjectTypeDefinitionNode, + modelDirectiveConfig: ModelDirectiveConfiguration, ): InputObjectTypeDefinitionNode => { const input = makeConditionFilterInput(ctx, name, object); const idField = input.fields.find((f) => f.name === 'id' && f.getTypeName() === 'ModelIDInput'); if (idField) { input.removeField(idField); } + + // add implicit timestamp fields to filter + if (isDynamoDbModel(ctx, object.name.value)) { + Object.values({ createdAt: 'createdAt', updatedAt: 'updatedAt', ...(modelDirectiveConfig?.timestamps || {}) }).forEach( + (timeStampFieldName) => { + if (!input.hasField(timeStampFieldName!)) { + const field = InputFieldWrapper.create(timeStampFieldName, 'ModelStringInput', true); + input.addField(field); + } + }, + ); + } + return input.serialize(); }; diff --git a/packages/amplify-graphql-relational-transformer/src/__tests__/__snapshots__/amplify-graphql-has-many-transformer.test.ts.snap b/packages/amplify-graphql-relational-transformer/src/__tests__/__snapshots__/amplify-graphql-has-many-transformer.test.ts.snap index d20cfd4f4f..4efe62951d 100644 --- a/packages/amplify-graphql-relational-transformer/src/__tests__/__snapshots__/amplify-graphql-has-many-transformer.test.ts.snap +++ b/packages/amplify-graphql-relational-transformer/src/__tests__/__snapshots__/amplify-graphql-has-many-transformer.test.ts.snap @@ -6111,28 +6111,94 @@ Object { "name": Object { "kind": "Name", "loc": Object { - "end": 3085, + "end": 3091, "start": 3082, }, + "value": "createdAt", + }, + "type": Object { + "kind": "NamedType", + "loc": Object { + "end": 3109, + "start": 3093, + }, + "name": Object { + "kind": "Name", + "loc": Object { + "end": 3109, + "start": 3093, + }, + "value": "ModelStringInput", + }, + }, + }, + Object { + "defaultValue": undefined, + "description": undefined, + "directives": Array [], + "kind": "InputValueDefinition", + "loc": Object { + "end": 3139, + "start": 3112, + }, + "name": Object { + "kind": "Name", + "loc": Object { + "end": 3121, + "start": 3112, + }, + "value": "updatedAt", + }, + "type": Object { + "kind": "NamedType", + "loc": Object { + "end": 3139, + "start": 3123, + }, + "name": Object { + "kind": "Name", + "loc": Object { + "end": 3139, + "start": 3123, + }, + "value": "ModelStringInput", + }, + }, + }, + Object { + "defaultValue": undefined, + "description": undefined, + "directives": Array [], + "kind": "InputValueDefinition", + "loc": Object { + "end": 3169, + "start": 3142, + }, + "name": Object { + "kind": "Name", + "loc": Object { + "end": 3145, + "start": 3142, + }, "value": "and", }, "type": Object { "kind": "ListType", "loc": Object { - "end": 3109, - "start": 3087, + "end": 3169, + "start": 3147, }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 3108, - "start": 3088, + "end": 3168, + "start": 3148, }, "name": Object { "kind": "Name", "loc": Object { - "end": 3108, - "start": 3088, + "end": 3168, + "start": 3148, }, "value": "ModelPostFilterInput", }, @@ -6145,34 +6211,34 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 3138, - "start": 3112, + "end": 3198, + "start": 3172, }, "name": Object { "kind": "Name", "loc": Object { - "end": 3114, - "start": 3112, + "end": 3174, + "start": 3172, }, "value": "or", }, "type": Object { "kind": "ListType", "loc": Object { - "end": 3138, - "start": 3116, + "end": 3198, + "start": 3176, }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 3137, - "start": 3117, + "end": 3197, + "start": 3177, }, "name": Object { "kind": "Name", "loc": Object { - "end": 3137, - "start": 3117, + "end": 3197, + "start": 3177, }, "value": "ModelPostFilterInput", }, @@ -6185,28 +6251,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 3166, - "start": 3141, + "end": 3226, + "start": 3201, }, "name": Object { "kind": "Name", "loc": Object { - "end": 3144, - "start": 3141, + "end": 3204, + "start": 3201, }, "value": "not", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 3166, - "start": 3146, + "end": 3226, + "start": 3206, }, "name": Object { "kind": "Name", "loc": Object { - "end": 3166, - "start": 3146, + "end": 3226, + "start": 3206, }, "value": "ModelPostFilterInput", }, @@ -6218,28 +6284,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 3196, - "start": 3169, + "end": 3256, + "start": 3229, }, "name": Object { "kind": "Name", "loc": Object { - "end": 3177, - "start": 3169, + "end": 3237, + "start": 3229, }, "value": "_deleted", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 3196, - "start": 3179, + "end": 3256, + "start": 3239, }, "name": Object { "kind": "Name", "loc": Object { - "end": 3196, - "start": 3179, + "end": 3256, + "start": 3239, }, "value": "ModelBooleanInput", }, @@ -6248,7 +6314,7 @@ Object { ], "kind": "InputObjectTypeDefinition", "loc": Object { - "end": 3198, + "end": 3258, "start": 3006, }, "name": Object { @@ -6272,34 +6338,34 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 3230, - "start": 3223, + "end": 3290, + "start": 3283, }, "name": Object { "kind": "Name", "loc": Object { - "end": 3225, - "start": 3223, + "end": 3285, + "start": 3283, }, "value": "id", }, "type": Object { "kind": "NonNullType", "loc": Object { - "end": 3230, - "start": 3227, + "end": 3290, + "start": 3287, }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 3229, - "start": 3227, + "end": 3289, + "start": 3287, }, "name": Object { "kind": "Name", "loc": Object { - "end": 3229, - "start": 3227, + "end": 3289, + "start": 3287, }, "value": "ID", }, @@ -6311,28 +6377,28 @@ Object { "directives": Array [], "kind": "FieldDefinition", "loc": Object { - "end": 3237, - "start": 3215, + "end": 3297, + "start": 3275, }, "name": Object { "kind": "Name", "loc": Object { - "end": 3222, - "start": 3215, + "end": 3282, + "start": 3275, }, "value": "getPost", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 3237, - "start": 3233, + "end": 3297, + "start": 3293, }, "name": Object { "kind": "Name", "loc": Object { - "end": 3237, - "start": 3233, + "end": 3297, + "start": 3293, }, "value": "Post", }, @@ -6346,28 +6412,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 3278, - "start": 3250, + "end": 3338, + "start": 3310, }, "name": Object { "kind": "Name", "loc": Object { - "end": 3256, - "start": 3250, + "end": 3316, + "start": 3310, }, "value": "filter", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 3278, - "start": 3258, + "end": 3338, + "start": 3318, }, "name": Object { "kind": "Name", "loc": Object { - "end": 3278, - "start": 3258, + "end": 3338, + "start": 3318, }, "value": "ModelPostFilterInput", }, @@ -6379,28 +6445,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 3290, - "start": 3280, + "end": 3350, + "start": 3340, }, "name": Object { "kind": "Name", "loc": Object { - "end": 3285, - "start": 3280, + "end": 3345, + "start": 3340, }, "value": "limit", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 3290, - "start": 3287, + "end": 3350, + "start": 3347, }, "name": Object { "kind": "Name", "loc": Object { - "end": 3290, - "start": 3287, + "end": 3350, + "start": 3347, }, "value": "Int", }, @@ -6412,28 +6478,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 3309, - "start": 3292, + "end": 3369, + "start": 3352, }, "name": Object { "kind": "Name", "loc": Object { - "end": 3301, - "start": 3292, + "end": 3361, + "start": 3352, }, "value": "nextToken", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 3309, - "start": 3303, + "end": 3369, + "start": 3363, }, "name": Object { "kind": "Name", "loc": Object { - "end": 3309, - "start": 3303, + "end": 3369, + "start": 3363, }, "value": "String", }, @@ -6444,28 +6510,28 @@ Object { "directives": Array [], "kind": "FieldDefinition", "loc": Object { - "end": 3331, - "start": 3240, + "end": 3391, + "start": 3300, }, "name": Object { "kind": "Name", "loc": Object { - "end": 3249, - "start": 3240, + "end": 3309, + "start": 3300, }, "value": "listPosts", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 3331, - "start": 3312, + "end": 3391, + "start": 3372, }, "name": Object { "kind": "Name", "loc": Object { - "end": 3331, - "start": 3312, + "end": 3391, + "start": 3372, }, "value": "ModelPostConnection", }, @@ -6479,28 +6545,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 3372, - "start": 3344, + "end": 3432, + "start": 3404, }, "name": Object { "kind": "Name", "loc": Object { - "end": 3350, - "start": 3344, + "end": 3410, + "start": 3404, }, "value": "filter", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 3372, - "start": 3352, + "end": 3432, + "start": 3412, }, "name": Object { "kind": "Name", "loc": Object { - "end": 3372, - "start": 3352, + "end": 3432, + "start": 3412, }, "value": "ModelPostFilterInput", }, @@ -6512,28 +6578,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 3384, - "start": 3374, + "end": 3444, + "start": 3434, }, "name": Object { "kind": "Name", "loc": Object { - "end": 3379, - "start": 3374, + "end": 3439, + "start": 3434, }, "value": "limit", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 3384, - "start": 3381, + "end": 3444, + "start": 3441, }, "name": Object { "kind": "Name", "loc": Object { - "end": 3384, - "start": 3381, + "end": 3444, + "start": 3441, }, "value": "Int", }, @@ -6545,28 +6611,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 3403, - "start": 3386, + "end": 3463, + "start": 3446, }, "name": Object { "kind": "Name", "loc": Object { - "end": 3395, - "start": 3386, + "end": 3455, + "start": 3446, }, "value": "nextToken", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 3403, - "start": 3397, + "end": 3463, + "start": 3457, }, "name": Object { "kind": "Name", "loc": Object { - "end": 3403, - "start": 3397, + "end": 3463, + "start": 3457, }, "value": "String", }, @@ -6578,28 +6644,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 3427, - "start": 3405, + "end": 3487, + "start": 3465, }, "name": Object { "kind": "Name", "loc": Object { - "end": 3413, - "start": 3405, + "end": 3473, + "start": 3465, }, "value": "lastSync", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 3427, - "start": 3415, + "end": 3487, + "start": 3475, }, "name": Object { "kind": "Name", "loc": Object { - "end": 3427, - "start": 3415, + "end": 3487, + "start": 3475, }, "value": "AWSTimestamp", }, @@ -6610,28 +6676,28 @@ Object { "directives": Array [], "kind": "FieldDefinition", "loc": Object { - "end": 3449, - "start": 3334, + "end": 3509, + "start": 3394, }, "name": Object { "kind": "Name", "loc": Object { - "end": 3343, - "start": 3334, + "end": 3403, + "start": 3394, }, "value": "syncPosts", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 3449, - "start": 3430, + "end": 3509, + "start": 3490, }, "name": Object { "kind": "Name", "loc": Object { - "end": 3449, - "start": 3430, + "end": 3509, + "start": 3490, }, "value": "ModelPostConnection", }, @@ -6645,34 +6711,34 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 3467, - "start": 3460, + "end": 3527, + "start": 3520, }, "name": Object { "kind": "Name", "loc": Object { - "end": 3462, - "start": 3460, + "end": 3522, + "start": 3520, }, "value": "id", }, "type": Object { "kind": "NonNullType", "loc": Object { - "end": 3467, - "start": 3464, + "end": 3527, + "start": 3524, }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 3466, - "start": 3464, + "end": 3526, + "start": 3524, }, "name": Object { "kind": "Name", "loc": Object { - "end": 3466, - "start": 3464, + "end": 3526, + "start": 3524, }, "value": "ID", }, @@ -6684,28 +6750,28 @@ Object { "directives": Array [], "kind": "FieldDefinition", "loc": Object { - "end": 3474, - "start": 3452, + "end": 3534, + "start": 3512, }, "name": Object { "kind": "Name", "loc": Object { - "end": 3459, - "start": 3452, + "end": 3519, + "start": 3512, }, "value": "getUser", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 3474, - "start": 3470, + "end": 3534, + "start": 3530, }, "name": Object { "kind": "Name", "loc": Object { - "end": 3474, - "start": 3470, + "end": 3534, + "start": 3530, }, "value": "User", }, @@ -6719,28 +6785,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 3515, - "start": 3487, + "end": 3575, + "start": 3547, }, "name": Object { "kind": "Name", "loc": Object { - "end": 3493, - "start": 3487, + "end": 3553, + "start": 3547, }, "value": "filter", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 3515, - "start": 3495, + "end": 3575, + "start": 3555, }, "name": Object { "kind": "Name", "loc": Object { - "end": 3515, - "start": 3495, + "end": 3575, + "start": 3555, }, "value": "ModelUserFilterInput", }, @@ -6752,28 +6818,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 3527, - "start": 3517, + "end": 3587, + "start": 3577, }, "name": Object { "kind": "Name", "loc": Object { - "end": 3522, - "start": 3517, + "end": 3582, + "start": 3577, }, "value": "limit", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 3527, - "start": 3524, + "end": 3587, + "start": 3584, }, "name": Object { "kind": "Name", "loc": Object { - "end": 3527, - "start": 3524, + "end": 3587, + "start": 3584, }, "value": "Int", }, @@ -6785,28 +6851,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 3546, - "start": 3529, + "end": 3606, + "start": 3589, }, "name": Object { "kind": "Name", "loc": Object { - "end": 3538, - "start": 3529, + "end": 3598, + "start": 3589, }, "value": "nextToken", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 3546, - "start": 3540, + "end": 3606, + "start": 3600, }, "name": Object { "kind": "Name", "loc": Object { - "end": 3546, - "start": 3540, + "end": 3606, + "start": 3600, }, "value": "String", }, @@ -6817,28 +6883,28 @@ Object { "directives": Array [], "kind": "FieldDefinition", "loc": Object { - "end": 3568, - "start": 3477, + "end": 3628, + "start": 3537, }, "name": Object { "kind": "Name", "loc": Object { - "end": 3486, - "start": 3477, + "end": 3546, + "start": 3537, }, "value": "listUsers", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 3568, - "start": 3549, + "end": 3628, + "start": 3609, }, "name": Object { "kind": "Name", "loc": Object { - "end": 3568, - "start": 3549, + "end": 3628, + "start": 3609, }, "value": "ModelUserConnection", }, @@ -6852,28 +6918,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 3609, - "start": 3581, + "end": 3669, + "start": 3641, }, "name": Object { "kind": "Name", "loc": Object { - "end": 3587, - "start": 3581, + "end": 3647, + "start": 3641, }, "value": "filter", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 3609, - "start": 3589, + "end": 3669, + "start": 3649, }, "name": Object { "kind": "Name", "loc": Object { - "end": 3609, - "start": 3589, + "end": 3669, + "start": 3649, }, "value": "ModelUserFilterInput", }, @@ -6885,28 +6951,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 3621, - "start": 3611, + "end": 3681, + "start": 3671, }, "name": Object { "kind": "Name", "loc": Object { - "end": 3616, - "start": 3611, + "end": 3676, + "start": 3671, }, "value": "limit", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 3621, - "start": 3618, + "end": 3681, + "start": 3678, }, "name": Object { "kind": "Name", "loc": Object { - "end": 3621, - "start": 3618, + "end": 3681, + "start": 3678, }, "value": "Int", }, @@ -6918,28 +6984,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 3640, - "start": 3623, + "end": 3700, + "start": 3683, }, "name": Object { "kind": "Name", "loc": Object { - "end": 3632, - "start": 3623, + "end": 3692, + "start": 3683, }, "value": "nextToken", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 3640, - "start": 3634, + "end": 3700, + "start": 3694, }, "name": Object { "kind": "Name", "loc": Object { - "end": 3640, - "start": 3634, + "end": 3700, + "start": 3694, }, "value": "String", }, @@ -6951,28 +7017,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 3664, - "start": 3642, + "end": 3724, + "start": 3702, }, "name": Object { "kind": "Name", "loc": Object { - "end": 3650, - "start": 3642, + "end": 3710, + "start": 3702, }, "value": "lastSync", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 3664, - "start": 3652, + "end": 3724, + "start": 3712, }, "name": Object { "kind": "Name", "loc": Object { - "end": 3664, - "start": 3652, + "end": 3724, + "start": 3712, }, "value": "AWSTimestamp", }, @@ -6983,28 +7049,28 @@ Object { "directives": Array [], "kind": "FieldDefinition", "loc": Object { - "end": 3686, - "start": 3571, + "end": 3746, + "start": 3631, }, "name": Object { "kind": "Name", "loc": Object { - "end": 3580, - "start": 3571, + "end": 3640, + "start": 3631, }, "value": "syncUsers", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 3686, - "start": 3667, + "end": 3746, + "start": 3727, }, "name": Object { "kind": "Name", "loc": Object { - "end": 3686, - "start": 3667, + "end": 3746, + "start": 3727, }, "value": "ModelUserConnection", }, @@ -7014,14 +7080,14 @@ Object { "interfaces": Array [], "kind": "ObjectTypeDefinition", "loc": Object { - "end": 3688, - "start": 3200, + "end": 3748, + "start": 3260, }, "name": Object { "kind": "Name", "loc": Object { - "end": 3210, - "start": 3205, + "end": 3270, + "start": 3265, }, "value": "Query", }, @@ -7036,28 +7102,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 3747, - "start": 3724, + "end": 3807, + "start": 3784, }, "name": Object { "kind": "Name", "loc": Object { - "end": 3729, - "start": 3724, + "end": 3789, + "start": 3784, }, "value": "title", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 3747, - "start": 3731, + "end": 3807, + "start": 3791, }, "name": Object { "kind": "Name", "loc": Object { - "end": 3747, - "start": 3731, + "end": 3807, + "start": 3791, }, "value": "ModelStringInput", }, @@ -7069,34 +7135,34 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 3780, - "start": 3750, + "end": 3840, + "start": 3810, }, "name": Object { "kind": "Name", "loc": Object { - "end": 3753, - "start": 3750, + "end": 3813, + "start": 3810, }, "value": "and", }, "type": Object { "kind": "ListType", "loc": Object { - "end": 3780, - "start": 3755, + "end": 3840, + "start": 3815, }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 3779, - "start": 3756, + "end": 3839, + "start": 3816, }, "name": Object { "kind": "Name", "loc": Object { - "end": 3779, - "start": 3756, + "end": 3839, + "start": 3816, }, "value": "ModelPostConditionInput", }, @@ -7109,34 +7175,34 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 3812, - "start": 3783, + "end": 3872, + "start": 3843, }, "name": Object { "kind": "Name", "loc": Object { - "end": 3785, - "start": 3783, + "end": 3845, + "start": 3843, }, "value": "or", }, "type": Object { "kind": "ListType", "loc": Object { - "end": 3812, - "start": 3787, + "end": 3872, + "start": 3847, }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 3811, - "start": 3788, + "end": 3871, + "start": 3848, }, "name": Object { "kind": "Name", "loc": Object { - "end": 3811, - "start": 3788, + "end": 3871, + "start": 3848, }, "value": "ModelPostConditionInput", }, @@ -7149,28 +7215,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 3843, - "start": 3815, + "end": 3903, + "start": 3875, }, "name": Object { "kind": "Name", "loc": Object { - "end": 3818, - "start": 3815, + "end": 3878, + "start": 3875, }, "value": "not", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 3843, - "start": 3820, + "end": 3903, + "start": 3880, }, "name": Object { "kind": "Name", "loc": Object { - "end": 3843, - "start": 3820, + "end": 3903, + "start": 3880, }, "value": "ModelPostConditionInput", }, @@ -7182,44 +7248,110 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 3873, - "start": 3846, + "end": 3933, + "start": 3906, }, "name": Object { "kind": "Name", "loc": Object { - "end": 3854, - "start": 3846, + "end": 3914, + "start": 3906, }, "value": "_deleted", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 3873, - "start": 3856, + "end": 3933, + "start": 3916, }, "name": Object { "kind": "Name", "loc": Object { - "end": 3873, - "start": 3856, + "end": 3933, + "start": 3916, }, "value": "ModelBooleanInput", }, }, }, + Object { + "defaultValue": undefined, + "description": undefined, + "directives": Array [], + "kind": "InputValueDefinition", + "loc": Object { + "end": 3963, + "start": 3936, + }, + "name": Object { + "kind": "Name", + "loc": Object { + "end": 3945, + "start": 3936, + }, + "value": "createdAt", + }, + "type": Object { + "kind": "NamedType", + "loc": Object { + "end": 3963, + "start": 3947, + }, + "name": Object { + "kind": "Name", + "loc": Object { + "end": 3963, + "start": 3947, + }, + "value": "ModelStringInput", + }, + }, + }, + Object { + "defaultValue": undefined, + "description": undefined, + "directives": Array [], + "kind": "InputValueDefinition", + "loc": Object { + "end": 3993, + "start": 3966, + }, + "name": Object { + "kind": "Name", + "loc": Object { + "end": 3975, + "start": 3966, + }, + "value": "updatedAt", + }, + "type": Object { + "kind": "NamedType", + "loc": Object { + "end": 3993, + "start": 3977, + }, + "name": Object { + "kind": "Name", + "loc": Object { + "end": 3993, + "start": 3977, + }, + "value": "ModelStringInput", + }, + }, + }, ], "kind": "InputObjectTypeDefinition", "loc": Object { - "end": 3875, - "start": 3690, + "end": 3995, + "start": 3750, }, "name": Object { "kind": "Name", "loc": Object { - "end": 3719, - "start": 3696, + "end": 3779, + "start": 3756, }, "value": "ModelPostConditionInput", }, @@ -7234,28 +7366,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 3909, - "start": 3903, + "end": 4029, + "start": 4023, }, "name": Object { "kind": "Name", "loc": Object { - "end": 3905, - "start": 3903, + "end": 4025, + "start": 4023, }, "value": "id", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 3909, - "start": 3907, + "end": 4029, + "start": 4027, }, "name": Object { "kind": "Name", "loc": Object { - "end": 3909, - "start": 3907, + "end": 4029, + "start": 4027, }, "value": "ID", }, @@ -7267,34 +7399,34 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 3926, - "start": 3912, + "end": 4046, + "start": 4032, }, "name": Object { "kind": "Name", "loc": Object { - "end": 3917, - "start": 3912, + "end": 4037, + "start": 4032, }, "value": "title", }, "type": Object { "kind": "NonNullType", "loc": Object { - "end": 3926, - "start": 3919, + "end": 4046, + "start": 4039, }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 3925, - "start": 3919, + "end": 4045, + "start": 4039, }, "name": Object { "kind": "Name", "loc": Object { - "end": 3925, - "start": 3919, + "end": 4045, + "start": 4039, }, "value": "String", }, @@ -7307,28 +7439,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 3942, - "start": 3929, + "end": 4062, + "start": 4049, }, "name": Object { "kind": "Name", "loc": Object { - "end": 3937, - "start": 3929, + "end": 4057, + "start": 4049, }, "value": "_version", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 3942, - "start": 3939, + "end": 4062, + "start": 4059, }, "name": Object { "kind": "Name", "loc": Object { - "end": 3942, - "start": 3939, + "end": 4062, + "start": 4059, }, "value": "Int", }, @@ -7337,14 +7469,14 @@ Object { ], "kind": "InputObjectTypeDefinition", "loc": Object { - "end": 3944, - "start": 3877, + "end": 4064, + "start": 3997, }, "name": Object { "kind": "Name", "loc": Object { - "end": 3898, - "start": 3883, + "end": 4018, + "start": 4003, }, "value": "CreatePostInput", }, @@ -7359,34 +7491,34 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 3979, - "start": 3972, + "end": 4099, + "start": 4092, }, "name": Object { "kind": "Name", "loc": Object { - "end": 3974, - "start": 3972, + "end": 4094, + "start": 4092, }, "value": "id", }, "type": Object { "kind": "NonNullType", "loc": Object { - "end": 3979, - "start": 3976, + "end": 4099, + "start": 4096, }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 3978, - "start": 3976, + "end": 4098, + "start": 4096, }, "name": Object { "kind": "Name", "loc": Object { - "end": 3978, - "start": 3976, + "end": 4098, + "start": 4096, }, "value": "ID", }, @@ -7399,28 +7531,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 3995, - "start": 3982, + "end": 4115, + "start": 4102, }, "name": Object { "kind": "Name", "loc": Object { - "end": 3987, - "start": 3982, + "end": 4107, + "start": 4102, }, "value": "title", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 3995, - "start": 3989, + "end": 4115, + "start": 4109, }, "name": Object { "kind": "Name", "loc": Object { - "end": 3995, - "start": 3989, + "end": 4115, + "start": 4109, }, "value": "String", }, @@ -7432,28 +7564,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 4011, - "start": 3998, + "end": 4131, + "start": 4118, }, "name": Object { "kind": "Name", "loc": Object { - "end": 4006, - "start": 3998, + "end": 4126, + "start": 4118, }, "value": "_version", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 4011, - "start": 4008, + "end": 4131, + "start": 4128, }, "name": Object { "kind": "Name", "loc": Object { - "end": 4011, - "start": 4008, + "end": 4131, + "start": 4128, }, "value": "Int", }, @@ -7462,14 +7594,14 @@ Object { ], "kind": "InputObjectTypeDefinition", "loc": Object { - "end": 4013, - "start": 3946, + "end": 4133, + "start": 4066, }, "name": Object { "kind": "Name", "loc": Object { - "end": 3967, - "start": 3952, + "end": 4087, + "start": 4072, }, "value": "UpdatePostInput", }, @@ -7484,34 +7616,34 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 4048, - "start": 4041, + "end": 4168, + "start": 4161, }, "name": Object { "kind": "Name", "loc": Object { - "end": 4043, - "start": 4041, + "end": 4163, + "start": 4161, }, "value": "id", }, "type": Object { "kind": "NonNullType", "loc": Object { - "end": 4048, - "start": 4045, + "end": 4168, + "start": 4165, }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 4047, - "start": 4045, + "end": 4167, + "start": 4165, }, "name": Object { "kind": "Name", "loc": Object { - "end": 4047, - "start": 4045, + "end": 4167, + "start": 4165, }, "value": "ID", }, @@ -7524,28 +7656,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 4064, - "start": 4051, + "end": 4184, + "start": 4171, }, "name": Object { "kind": "Name", "loc": Object { - "end": 4059, - "start": 4051, + "end": 4179, + "start": 4171, }, "value": "_version", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 4064, - "start": 4061, + "end": 4184, + "start": 4181, }, "name": Object { "kind": "Name", "loc": Object { - "end": 4064, - "start": 4061, + "end": 4184, + "start": 4181, }, "value": "Int", }, @@ -7554,14 +7686,14 @@ Object { ], "kind": "InputObjectTypeDefinition", "loc": Object { - "end": 4066, - "start": 4015, + "end": 4186, + "start": 4135, }, "name": Object { "kind": "Name", "loc": Object { - "end": 4036, - "start": 4021, + "end": 4156, + "start": 4141, }, "value": "DeletePostInput", }, @@ -7578,34 +7710,34 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 4120, - "start": 4097, + "end": 4240, + "start": 4217, }, "name": Object { "kind": "Name", "loc": Object { - "end": 4102, - "start": 4097, + "end": 4222, + "start": 4217, }, "value": "input", }, "type": Object { "kind": "NonNullType", "loc": Object { - "end": 4120, - "start": 4104, + "end": 4240, + "start": 4224, }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 4119, - "start": 4104, + "end": 4239, + "start": 4224, }, "name": Object { "kind": "Name", "loc": Object { - "end": 4119, - "start": 4104, + "end": 4239, + "start": 4224, }, "value": "CreatePostInput", }, @@ -7618,28 +7750,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 4156, - "start": 4122, + "end": 4276, + "start": 4242, }, "name": Object { "kind": "Name", "loc": Object { - "end": 4131, - "start": 4122, + "end": 4251, + "start": 4242, }, "value": "condition", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 4156, - "start": 4133, + "end": 4276, + "start": 4253, }, "name": Object { "kind": "Name", "loc": Object { - "end": 4156, - "start": 4133, + "end": 4276, + "start": 4253, }, "value": "ModelPostConditionInput", }, @@ -7650,28 +7782,28 @@ Object { "directives": Array [], "kind": "FieldDefinition", "loc": Object { - "end": 4163, - "start": 4086, + "end": 4283, + "start": 4206, }, "name": Object { "kind": "Name", "loc": Object { - "end": 4096, - "start": 4086, + "end": 4216, + "start": 4206, }, "value": "createPost", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 4163, - "start": 4159, + "end": 4283, + "start": 4279, }, "name": Object { "kind": "Name", "loc": Object { - "end": 4163, - "start": 4159, + "end": 4283, + "start": 4279, }, "value": "Post", }, @@ -7685,34 +7817,34 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 4200, - "start": 4177, + "end": 4320, + "start": 4297, }, "name": Object { "kind": "Name", "loc": Object { - "end": 4182, - "start": 4177, + "end": 4302, + "start": 4297, }, "value": "input", }, "type": Object { "kind": "NonNullType", "loc": Object { - "end": 4200, - "start": 4184, + "end": 4320, + "start": 4304, }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 4199, - "start": 4184, + "end": 4319, + "start": 4304, }, "name": Object { "kind": "Name", "loc": Object { - "end": 4199, - "start": 4184, + "end": 4319, + "start": 4304, }, "value": "UpdatePostInput", }, @@ -7725,28 +7857,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 4236, - "start": 4202, + "end": 4356, + "start": 4322, }, "name": Object { "kind": "Name", "loc": Object { - "end": 4211, - "start": 4202, + "end": 4331, + "start": 4322, }, "value": "condition", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 4236, - "start": 4213, + "end": 4356, + "start": 4333, }, "name": Object { "kind": "Name", "loc": Object { - "end": 4236, - "start": 4213, + "end": 4356, + "start": 4333, }, "value": "ModelPostConditionInput", }, @@ -7757,28 +7889,28 @@ Object { "directives": Array [], "kind": "FieldDefinition", "loc": Object { - "end": 4243, - "start": 4166, + "end": 4363, + "start": 4286, }, "name": Object { "kind": "Name", "loc": Object { - "end": 4176, - "start": 4166, + "end": 4296, + "start": 4286, }, "value": "updatePost", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 4243, - "start": 4239, + "end": 4363, + "start": 4359, }, "name": Object { "kind": "Name", "loc": Object { - "end": 4243, - "start": 4239, + "end": 4363, + "start": 4359, }, "value": "Post", }, @@ -7792,34 +7924,34 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 4280, - "start": 4257, + "end": 4400, + "start": 4377, }, "name": Object { "kind": "Name", "loc": Object { - "end": 4262, - "start": 4257, + "end": 4382, + "start": 4377, }, "value": "input", }, "type": Object { "kind": "NonNullType", "loc": Object { - "end": 4280, - "start": 4264, + "end": 4400, + "start": 4384, }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 4279, - "start": 4264, + "end": 4399, + "start": 4384, }, "name": Object { "kind": "Name", "loc": Object { - "end": 4279, - "start": 4264, + "end": 4399, + "start": 4384, }, "value": "DeletePostInput", }, @@ -7832,28 +7964,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 4316, - "start": 4282, + "end": 4436, + "start": 4402, }, "name": Object { "kind": "Name", "loc": Object { - "end": 4291, - "start": 4282, + "end": 4411, + "start": 4402, }, "value": "condition", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 4316, - "start": 4293, + "end": 4436, + "start": 4413, }, "name": Object { "kind": "Name", "loc": Object { - "end": 4316, - "start": 4293, + "end": 4436, + "start": 4413, }, "value": "ModelPostConditionInput", }, @@ -7864,28 +7996,28 @@ Object { "directives": Array [], "kind": "FieldDefinition", "loc": Object { - "end": 4323, - "start": 4246, + "end": 4443, + "start": 4366, }, "name": Object { "kind": "Name", "loc": Object { - "end": 4256, - "start": 4246, + "end": 4376, + "start": 4366, }, "value": "deletePost", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 4323, - "start": 4319, + "end": 4443, + "start": 4439, }, "name": Object { "kind": "Name", "loc": Object { - "end": 4323, - "start": 4319, + "end": 4443, + "start": 4439, }, "value": "Post", }, @@ -7899,34 +8031,34 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 4372, - "start": 4343, + "end": 4492, + "start": 4463, }, "name": Object { "kind": "Name", "loc": Object { - "end": 4348, - "start": 4343, + "end": 4468, + "start": 4463, }, "value": "input", }, "type": Object { "kind": "NonNullType", "loc": Object { - "end": 4372, - "start": 4350, + "end": 4492, + "start": 4470, }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 4371, - "start": 4350, + "end": 4491, + "start": 4470, }, "name": Object { "kind": "Name", "loc": Object { - "end": 4371, - "start": 4350, + "end": 4491, + "start": 4470, }, "value": "CreatePostEditorInput", }, @@ -7939,28 +8071,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 4414, - "start": 4374, + "end": 4534, + "start": 4494, }, "name": Object { "kind": "Name", "loc": Object { - "end": 4383, - "start": 4374, + "end": 4503, + "start": 4494, }, "value": "condition", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 4414, - "start": 4385, + "end": 4534, + "start": 4505, }, "name": Object { "kind": "Name", "loc": Object { - "end": 4414, - "start": 4385, + "end": 4534, + "start": 4505, }, "value": "ModelPostEditorConditionInput", }, @@ -7971,28 +8103,28 @@ Object { "directives": Array [], "kind": "FieldDefinition", "loc": Object { - "end": 4427, - "start": 4326, + "end": 4547, + "start": 4446, }, "name": Object { "kind": "Name", "loc": Object { - "end": 4342, - "start": 4326, + "end": 4462, + "start": 4446, }, "value": "createPostEditor", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 4427, - "start": 4417, + "end": 4547, + "start": 4537, }, "name": Object { "kind": "Name", "loc": Object { - "end": 4427, - "start": 4417, + "end": 4547, + "start": 4537, }, "value": "PostEditor", }, @@ -8006,34 +8138,34 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 4476, - "start": 4447, + "end": 4596, + "start": 4567, }, "name": Object { "kind": "Name", "loc": Object { - "end": 4452, - "start": 4447, + "end": 4572, + "start": 4567, }, "value": "input", }, "type": Object { "kind": "NonNullType", "loc": Object { - "end": 4476, - "start": 4454, + "end": 4596, + "start": 4574, }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 4475, - "start": 4454, + "end": 4595, + "start": 4574, }, "name": Object { "kind": "Name", "loc": Object { - "end": 4475, - "start": 4454, + "end": 4595, + "start": 4574, }, "value": "UpdatePostEditorInput", }, @@ -8046,28 +8178,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 4518, - "start": 4478, + "end": 4638, + "start": 4598, }, "name": Object { "kind": "Name", "loc": Object { - "end": 4487, - "start": 4478, + "end": 4607, + "start": 4598, }, "value": "condition", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 4518, - "start": 4489, + "end": 4638, + "start": 4609, }, "name": Object { "kind": "Name", "loc": Object { - "end": 4518, - "start": 4489, + "end": 4638, + "start": 4609, }, "value": "ModelPostEditorConditionInput", }, @@ -8078,28 +8210,28 @@ Object { "directives": Array [], "kind": "FieldDefinition", "loc": Object { - "end": 4531, - "start": 4430, + "end": 4651, + "start": 4550, }, "name": Object { "kind": "Name", "loc": Object { - "end": 4446, - "start": 4430, + "end": 4566, + "start": 4550, }, "value": "updatePostEditor", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 4531, - "start": 4521, + "end": 4651, + "start": 4641, }, "name": Object { "kind": "Name", "loc": Object { - "end": 4531, - "start": 4521, + "end": 4651, + "start": 4641, }, "value": "PostEditor", }, @@ -8113,34 +8245,34 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 4580, - "start": 4551, + "end": 4700, + "start": 4671, }, "name": Object { "kind": "Name", "loc": Object { - "end": 4556, - "start": 4551, + "end": 4676, + "start": 4671, }, "value": "input", }, "type": Object { "kind": "NonNullType", "loc": Object { - "end": 4580, - "start": 4558, + "end": 4700, + "start": 4678, }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 4579, - "start": 4558, + "end": 4699, + "start": 4678, }, "name": Object { "kind": "Name", "loc": Object { - "end": 4579, - "start": 4558, + "end": 4699, + "start": 4678, }, "value": "DeletePostEditorInput", }, @@ -8153,28 +8285,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 4622, - "start": 4582, + "end": 4742, + "start": 4702, }, "name": Object { "kind": "Name", "loc": Object { - "end": 4591, - "start": 4582, + "end": 4711, + "start": 4702, }, "value": "condition", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 4622, - "start": 4593, + "end": 4742, + "start": 4713, }, "name": Object { "kind": "Name", "loc": Object { - "end": 4622, - "start": 4593, + "end": 4742, + "start": 4713, }, "value": "ModelPostEditorConditionInput", }, @@ -8185,28 +8317,28 @@ Object { "directives": Array [], "kind": "FieldDefinition", "loc": Object { - "end": 4635, - "start": 4534, + "end": 4755, + "start": 4654, }, "name": Object { "kind": "Name", "loc": Object { - "end": 4550, - "start": 4534, + "end": 4670, + "start": 4654, }, "value": "deletePostEditor", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 4635, - "start": 4625, + "end": 4755, + "start": 4745, }, "name": Object { "kind": "Name", "loc": Object { - "end": 4635, - "start": 4625, + "end": 4755, + "start": 4745, }, "value": "PostEditor", }, @@ -8220,34 +8352,34 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 4672, - "start": 4649, + "end": 4792, + "start": 4769, }, "name": Object { "kind": "Name", "loc": Object { - "end": 4654, - "start": 4649, + "end": 4774, + "start": 4769, }, "value": "input", }, "type": Object { "kind": "NonNullType", "loc": Object { - "end": 4672, - "start": 4656, + "end": 4792, + "start": 4776, }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 4671, - "start": 4656, + "end": 4791, + "start": 4776, }, "name": Object { "kind": "Name", "loc": Object { - "end": 4671, - "start": 4656, + "end": 4791, + "start": 4776, }, "value": "CreateUserInput", }, @@ -8260,28 +8392,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 4708, - "start": 4674, + "end": 4828, + "start": 4794, }, "name": Object { "kind": "Name", "loc": Object { - "end": 4683, - "start": 4674, + "end": 4803, + "start": 4794, }, "value": "condition", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 4708, - "start": 4685, + "end": 4828, + "start": 4805, }, "name": Object { "kind": "Name", "loc": Object { - "end": 4708, - "start": 4685, + "end": 4828, + "start": 4805, }, "value": "ModelUserConditionInput", }, @@ -8292,28 +8424,28 @@ Object { "directives": Array [], "kind": "FieldDefinition", "loc": Object { - "end": 4715, - "start": 4638, + "end": 4835, + "start": 4758, }, "name": Object { "kind": "Name", "loc": Object { - "end": 4648, - "start": 4638, + "end": 4768, + "start": 4758, }, "value": "createUser", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 4715, - "start": 4711, + "end": 4835, + "start": 4831, }, "name": Object { "kind": "Name", "loc": Object { - "end": 4715, - "start": 4711, + "end": 4835, + "start": 4831, }, "value": "User", }, @@ -8327,34 +8459,34 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 4752, - "start": 4729, + "end": 4872, + "start": 4849, }, "name": Object { "kind": "Name", "loc": Object { - "end": 4734, - "start": 4729, + "end": 4854, + "start": 4849, }, "value": "input", }, "type": Object { "kind": "NonNullType", "loc": Object { - "end": 4752, - "start": 4736, + "end": 4872, + "start": 4856, }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 4751, - "start": 4736, + "end": 4871, + "start": 4856, }, "name": Object { "kind": "Name", "loc": Object { - "end": 4751, - "start": 4736, + "end": 4871, + "start": 4856, }, "value": "UpdateUserInput", }, @@ -8367,28 +8499,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 4788, - "start": 4754, + "end": 4908, + "start": 4874, }, "name": Object { "kind": "Name", "loc": Object { - "end": 4763, - "start": 4754, + "end": 4883, + "start": 4874, }, "value": "condition", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 4788, - "start": 4765, + "end": 4908, + "start": 4885, }, "name": Object { "kind": "Name", "loc": Object { - "end": 4788, - "start": 4765, + "end": 4908, + "start": 4885, }, "value": "ModelUserConditionInput", }, @@ -8399,28 +8531,28 @@ Object { "directives": Array [], "kind": "FieldDefinition", "loc": Object { - "end": 4795, - "start": 4718, + "end": 4915, + "start": 4838, }, "name": Object { "kind": "Name", "loc": Object { - "end": 4728, - "start": 4718, + "end": 4848, + "start": 4838, }, "value": "updateUser", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 4795, - "start": 4791, + "end": 4915, + "start": 4911, }, "name": Object { "kind": "Name", "loc": Object { - "end": 4795, - "start": 4791, + "end": 4915, + "start": 4911, }, "value": "User", }, @@ -8434,34 +8566,34 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 4832, - "start": 4809, + "end": 4952, + "start": 4929, }, "name": Object { "kind": "Name", "loc": Object { - "end": 4814, - "start": 4809, + "end": 4934, + "start": 4929, }, "value": "input", }, "type": Object { "kind": "NonNullType", "loc": Object { - "end": 4832, - "start": 4816, + "end": 4952, + "start": 4936, }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 4831, - "start": 4816, + "end": 4951, + "start": 4936, }, "name": Object { "kind": "Name", "loc": Object { - "end": 4831, - "start": 4816, + "end": 4951, + "start": 4936, }, "value": "DeleteUserInput", }, @@ -8474,28 +8606,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 4868, - "start": 4834, + "end": 4988, + "start": 4954, }, "name": Object { "kind": "Name", "loc": Object { - "end": 4843, - "start": 4834, + "end": 4963, + "start": 4954, }, "value": "condition", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 4868, - "start": 4845, + "end": 4988, + "start": 4965, }, "name": Object { "kind": "Name", "loc": Object { - "end": 4868, - "start": 4845, + "end": 4988, + "start": 4965, }, "value": "ModelUserConditionInput", }, @@ -8506,28 +8638,28 @@ Object { "directives": Array [], "kind": "FieldDefinition", "loc": Object { - "end": 4875, - "start": 4798, + "end": 4995, + "start": 4918, }, "name": Object { "kind": "Name", "loc": Object { - "end": 4808, - "start": 4798, + "end": 4928, + "start": 4918, }, "value": "deleteUser", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 4875, - "start": 4871, + "end": 4995, + "start": 4991, }, "name": Object { "kind": "Name", "loc": Object { - "end": 4875, - "start": 4871, + "end": 4995, + "start": 4991, }, "value": "User", }, @@ -8537,14 +8669,14 @@ Object { "interfaces": Array [], "kind": "ObjectTypeDefinition", "loc": Object { - "end": 4877, - "start": 4068, + "end": 4997, + "start": 4188, }, "name": Object { "kind": "Name", "loc": Object { - "end": 4081, - "start": 4073, + "end": 4201, + "start": 4193, }, "value": "Mutation", }, @@ -8559,28 +8691,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 4950, - "start": 4922, + "end": 5070, + "start": 5042, }, "name": Object { "kind": "Name", "loc": Object { - "end": 4924, - "start": 4922, + "end": 5044, + "start": 5042, }, "value": "id", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 4950, - "start": 4926, + "end": 5070, + "start": 5046, }, "name": Object { "kind": "Name", "loc": Object { - "end": 4950, - "start": 4926, + "end": 5070, + "start": 5046, }, "value": "ModelSubscriptionIDInput", }, @@ -8592,28 +8724,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 4988, - "start": 4953, + "end": 5108, + "start": 5073, }, "name": Object { "kind": "Name", "loc": Object { - "end": 4958, - "start": 4953, + "end": 5078, + "start": 5073, }, "value": "title", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 4988, - "start": 4960, + "end": 5108, + "start": 5080, }, "name": Object { "kind": "Name", "loc": Object { - "end": 4988, - "start": 4960, + "end": 5108, + "start": 5080, }, "value": "ModelSubscriptionStringInput", }, @@ -8625,34 +8757,100 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 5030, - "start": 4991, + "end": 5150, + "start": 5111, }, "name": Object { "kind": "Name", "loc": Object { - "end": 4994, - "start": 4991, + "end": 5120, + "start": 5111, + }, + "value": "createdAt", + }, + "type": Object { + "kind": "NamedType", + "loc": Object { + "end": 5150, + "start": 5122, + }, + "name": Object { + "kind": "Name", + "loc": Object { + "end": 5150, + "start": 5122, + }, + "value": "ModelSubscriptionStringInput", + }, + }, + }, + Object { + "defaultValue": undefined, + "description": undefined, + "directives": Array [], + "kind": "InputValueDefinition", + "loc": Object { + "end": 5192, + "start": 5153, + }, + "name": Object { + "kind": "Name", + "loc": Object { + "end": 5162, + "start": 5153, + }, + "value": "updatedAt", + }, + "type": Object { + "kind": "NamedType", + "loc": Object { + "end": 5192, + "start": 5164, + }, + "name": Object { + "kind": "Name", + "loc": Object { + "end": 5192, + "start": 5164, + }, + "value": "ModelSubscriptionStringInput", + }, + }, + }, + Object { + "defaultValue": undefined, + "description": undefined, + "directives": Array [], + "kind": "InputValueDefinition", + "loc": Object { + "end": 5234, + "start": 5195, + }, + "name": Object { + "kind": "Name", + "loc": Object { + "end": 5198, + "start": 5195, }, "value": "and", }, "type": Object { "kind": "ListType", "loc": Object { - "end": 5030, - "start": 4996, + "end": 5234, + "start": 5200, }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 5029, - "start": 4997, + "end": 5233, + "start": 5201, }, "name": Object { "kind": "Name", "loc": Object { - "end": 5029, - "start": 4997, + "end": 5233, + "start": 5201, }, "value": "ModelSubscriptionPostFilterInput", }, @@ -8665,34 +8863,34 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 5071, - "start": 5033, + "end": 5275, + "start": 5237, }, "name": Object { "kind": "Name", "loc": Object { - "end": 5035, - "start": 5033, + "end": 5239, + "start": 5237, }, "value": "or", }, "type": Object { "kind": "ListType", "loc": Object { - "end": 5071, - "start": 5037, + "end": 5275, + "start": 5241, }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 5070, - "start": 5038, + "end": 5274, + "start": 5242, }, "name": Object { "kind": "Name", "loc": Object { - "end": 5070, - "start": 5038, + "end": 5274, + "start": 5242, }, "value": "ModelSubscriptionPostFilterInput", }, @@ -8705,28 +8903,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 5101, - "start": 5074, + "end": 5305, + "start": 5278, }, "name": Object { "kind": "Name", "loc": Object { - "end": 5082, - "start": 5074, + "end": 5286, + "start": 5278, }, "value": "_deleted", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 5101, - "start": 5084, + "end": 5305, + "start": 5288, }, "name": Object { "kind": "Name", "loc": Object { - "end": 5101, - "start": 5084, + "end": 5305, + "start": 5288, }, "value": "ModelBooleanInput", }, @@ -8735,14 +8933,14 @@ Object { ], "kind": "InputObjectTypeDefinition", "loc": Object { - "end": 5103, - "start": 4879, + "end": 5307, + "start": 4999, }, "name": Object { "kind": "Name", "loc": Object { - "end": 4917, - "start": 4885, + "end": 5037, + "start": 5005, }, "value": "ModelSubscriptionPostFilterInput", }, @@ -8759,28 +8957,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 5180, - "start": 5140, + "end": 5384, + "start": 5344, }, "name": Object { "kind": "Name", "loc": Object { - "end": 5146, - "start": 5140, + "end": 5350, + "start": 5344, }, "value": "filter", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 5180, - "start": 5148, + "end": 5384, + "start": 5352, }, "name": Object { "kind": "Name", "loc": Object { - "end": 5180, - "start": 5148, + "end": 5384, + "start": 5352, }, "value": "ModelSubscriptionPostFilterInput", }, @@ -8794,30 +8992,30 @@ Object { Object { "kind": "Argument", "loc": Object { - "end": 5228, - "start": 5203, + "end": 5432, + "start": 5407, }, "name": Object { "kind": "Name", "loc": Object { - "end": 5212, - "start": 5203, + "end": 5416, + "start": 5407, }, "value": "mutations", }, "value": Object { "kind": "ListValue", "loc": Object { - "end": 5228, - "start": 5214, + "end": 5432, + "start": 5418, }, "values": Array [ Object { "block": false, "kind": "StringValue", "loc": Object { - "end": 5227, - "start": 5215, + "end": 5431, + "start": 5419, }, "value": "createPost", }, @@ -8827,14 +9025,14 @@ Object { ], "kind": "Directive", "loc": Object { - "end": 5229, - "start": 5188, + "end": 5433, + "start": 5392, }, "name": Object { "kind": "Name", "loc": Object { - "end": 5202, - "start": 5189, + "end": 5406, + "start": 5393, }, "value": "aws_subscribe", }, @@ -8842,28 +9040,28 @@ Object { ], "kind": "FieldDefinition", "loc": Object { - "end": 5229, - "start": 5127, + "end": 5433, + "start": 5331, }, "name": Object { "kind": "Name", "loc": Object { - "end": 5139, - "start": 5127, + "end": 5343, + "start": 5331, }, "value": "onCreatePost", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 5187, - "start": 5183, + "end": 5391, + "start": 5387, }, "name": Object { "kind": "Name", "loc": Object { - "end": 5187, - "start": 5183, + "end": 5391, + "start": 5387, }, "value": "Post", }, @@ -8877,28 +9075,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 5285, - "start": 5245, + "end": 5489, + "start": 5449, }, "name": Object { "kind": "Name", "loc": Object { - "end": 5251, - "start": 5245, + "end": 5455, + "start": 5449, }, "value": "filter", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 5285, - "start": 5253, + "end": 5489, + "start": 5457, }, "name": Object { "kind": "Name", "loc": Object { - "end": 5285, - "start": 5253, + "end": 5489, + "start": 5457, }, "value": "ModelSubscriptionPostFilterInput", }, @@ -8912,30 +9110,30 @@ Object { Object { "kind": "Argument", "loc": Object { - "end": 5333, - "start": 5308, + "end": 5537, + "start": 5512, }, "name": Object { "kind": "Name", "loc": Object { - "end": 5317, - "start": 5308, + "end": 5521, + "start": 5512, }, "value": "mutations", }, "value": Object { "kind": "ListValue", "loc": Object { - "end": 5333, - "start": 5319, + "end": 5537, + "start": 5523, }, "values": Array [ Object { "block": false, "kind": "StringValue", "loc": Object { - "end": 5332, - "start": 5320, + "end": 5536, + "start": 5524, }, "value": "updatePost", }, @@ -8945,14 +9143,14 @@ Object { ], "kind": "Directive", "loc": Object { - "end": 5334, - "start": 5293, + "end": 5538, + "start": 5497, }, "name": Object { "kind": "Name", "loc": Object { - "end": 5307, - "start": 5294, + "end": 5511, + "start": 5498, }, "value": "aws_subscribe", }, @@ -8960,28 +9158,28 @@ Object { ], "kind": "FieldDefinition", "loc": Object { - "end": 5334, - "start": 5232, + "end": 5538, + "start": 5436, }, "name": Object { "kind": "Name", "loc": Object { - "end": 5244, - "start": 5232, + "end": 5448, + "start": 5436, }, "value": "onUpdatePost", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 5292, - "start": 5288, + "end": 5496, + "start": 5492, }, "name": Object { "kind": "Name", "loc": Object { - "end": 5292, - "start": 5288, + "end": 5496, + "start": 5492, }, "value": "Post", }, @@ -8995,28 +9193,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 5390, - "start": 5350, + "end": 5594, + "start": 5554, }, "name": Object { "kind": "Name", "loc": Object { - "end": 5356, - "start": 5350, + "end": 5560, + "start": 5554, }, "value": "filter", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 5390, - "start": 5358, + "end": 5594, + "start": 5562, }, "name": Object { "kind": "Name", "loc": Object { - "end": 5390, - "start": 5358, + "end": 5594, + "start": 5562, }, "value": "ModelSubscriptionPostFilterInput", }, @@ -9030,30 +9228,30 @@ Object { Object { "kind": "Argument", "loc": Object { - "end": 5438, - "start": 5413, + "end": 5642, + "start": 5617, }, "name": Object { "kind": "Name", "loc": Object { - "end": 5422, - "start": 5413, + "end": 5626, + "start": 5617, }, "value": "mutations", }, "value": Object { "kind": "ListValue", "loc": Object { - "end": 5438, - "start": 5424, + "end": 5642, + "start": 5628, }, "values": Array [ Object { "block": false, "kind": "StringValue", "loc": Object { - "end": 5437, - "start": 5425, + "end": 5641, + "start": 5629, }, "value": "deletePost", }, @@ -9063,14 +9261,14 @@ Object { ], "kind": "Directive", "loc": Object { - "end": 5439, - "start": 5398, + "end": 5643, + "start": 5602, }, "name": Object { "kind": "Name", "loc": Object { - "end": 5412, - "start": 5399, + "end": 5616, + "start": 5603, }, "value": "aws_subscribe", }, @@ -9078,28 +9276,28 @@ Object { ], "kind": "FieldDefinition", "loc": Object { - "end": 5439, - "start": 5337, + "end": 5643, + "start": 5541, }, "name": Object { "kind": "Name", "loc": Object { - "end": 5349, - "start": 5337, + "end": 5553, + "start": 5541, }, "value": "onDeletePost", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 5397, - "start": 5393, + "end": 5601, + "start": 5597, }, "name": Object { "kind": "Name", "loc": Object { - "end": 5397, - "start": 5393, + "end": 5601, + "start": 5597, }, "value": "Post", }, @@ -9113,28 +9311,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 5507, - "start": 5461, + "end": 5711, + "start": 5665, }, "name": Object { "kind": "Name", "loc": Object { - "end": 5467, - "start": 5461, + "end": 5671, + "start": 5665, }, "value": "filter", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 5507, - "start": 5469, + "end": 5711, + "start": 5673, }, "name": Object { "kind": "Name", "loc": Object { - "end": 5507, - "start": 5469, + "end": 5711, + "start": 5673, }, "value": "ModelSubscriptionPostEditorFilterInput", }, @@ -9148,30 +9346,30 @@ Object { Object { "kind": "Argument", "loc": Object { - "end": 5567, - "start": 5536, + "end": 5771, + "start": 5740, }, "name": Object { "kind": "Name", "loc": Object { - "end": 5545, - "start": 5536, + "end": 5749, + "start": 5740, }, "value": "mutations", }, "value": Object { "kind": "ListValue", "loc": Object { - "end": 5567, - "start": 5547, + "end": 5771, + "start": 5751, }, "values": Array [ Object { "block": false, "kind": "StringValue", "loc": Object { - "end": 5566, - "start": 5548, + "end": 5770, + "start": 5752, }, "value": "createPostEditor", }, @@ -9181,14 +9379,14 @@ Object { ], "kind": "Directive", "loc": Object { - "end": 5568, - "start": 5521, + "end": 5772, + "start": 5725, }, "name": Object { "kind": "Name", "loc": Object { - "end": 5535, - "start": 5522, + "end": 5739, + "start": 5726, }, "value": "aws_subscribe", }, @@ -9196,28 +9394,28 @@ Object { ], "kind": "FieldDefinition", "loc": Object { - "end": 5568, - "start": 5442, + "end": 5772, + "start": 5646, }, "name": Object { "kind": "Name", "loc": Object { - "end": 5460, - "start": 5442, + "end": 5664, + "start": 5646, }, "value": "onCreatePostEditor", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 5520, - "start": 5510, + "end": 5724, + "start": 5714, }, "name": Object { "kind": "Name", "loc": Object { - "end": 5520, - "start": 5510, + "end": 5724, + "start": 5714, }, "value": "PostEditor", }, @@ -9231,28 +9429,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 5636, - "start": 5590, + "end": 5840, + "start": 5794, }, "name": Object { "kind": "Name", "loc": Object { - "end": 5596, - "start": 5590, + "end": 5800, + "start": 5794, }, "value": "filter", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 5636, - "start": 5598, + "end": 5840, + "start": 5802, }, "name": Object { "kind": "Name", "loc": Object { - "end": 5636, - "start": 5598, + "end": 5840, + "start": 5802, }, "value": "ModelSubscriptionPostEditorFilterInput", }, @@ -9266,30 +9464,30 @@ Object { Object { "kind": "Argument", "loc": Object { - "end": 5696, - "start": 5665, + "end": 5900, + "start": 5869, }, "name": Object { "kind": "Name", "loc": Object { - "end": 5674, - "start": 5665, + "end": 5878, + "start": 5869, }, "value": "mutations", }, "value": Object { "kind": "ListValue", "loc": Object { - "end": 5696, - "start": 5676, + "end": 5900, + "start": 5880, }, "values": Array [ Object { "block": false, "kind": "StringValue", "loc": Object { - "end": 5695, - "start": 5677, + "end": 5899, + "start": 5881, }, "value": "updatePostEditor", }, @@ -9299,14 +9497,14 @@ Object { ], "kind": "Directive", "loc": Object { - "end": 5697, - "start": 5650, + "end": 5901, + "start": 5854, }, "name": Object { "kind": "Name", "loc": Object { - "end": 5664, - "start": 5651, + "end": 5868, + "start": 5855, }, "value": "aws_subscribe", }, @@ -9314,28 +9512,28 @@ Object { ], "kind": "FieldDefinition", "loc": Object { - "end": 5697, - "start": 5571, + "end": 5901, + "start": 5775, }, "name": Object { "kind": "Name", "loc": Object { - "end": 5589, - "start": 5571, + "end": 5793, + "start": 5775, }, "value": "onUpdatePostEditor", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 5649, - "start": 5639, + "end": 5853, + "start": 5843, }, "name": Object { "kind": "Name", "loc": Object { - "end": 5649, - "start": 5639, + "end": 5853, + "start": 5843, }, "value": "PostEditor", }, @@ -9349,28 +9547,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 5765, - "start": 5719, + "end": 5969, + "start": 5923, }, "name": Object { "kind": "Name", "loc": Object { - "end": 5725, - "start": 5719, + "end": 5929, + "start": 5923, }, "value": "filter", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 5765, - "start": 5727, + "end": 5969, + "start": 5931, }, "name": Object { "kind": "Name", "loc": Object { - "end": 5765, - "start": 5727, + "end": 5969, + "start": 5931, }, "value": "ModelSubscriptionPostEditorFilterInput", }, @@ -9384,30 +9582,30 @@ Object { Object { "kind": "Argument", "loc": Object { - "end": 5825, - "start": 5794, + "end": 6029, + "start": 5998, }, "name": Object { "kind": "Name", "loc": Object { - "end": 5803, - "start": 5794, + "end": 6007, + "start": 5998, }, "value": "mutations", }, "value": Object { "kind": "ListValue", "loc": Object { - "end": 5825, - "start": 5805, + "end": 6029, + "start": 6009, }, "values": Array [ Object { "block": false, "kind": "StringValue", "loc": Object { - "end": 5824, - "start": 5806, + "end": 6028, + "start": 6010, }, "value": "deletePostEditor", }, @@ -9417,14 +9615,14 @@ Object { ], "kind": "Directive", "loc": Object { - "end": 5826, - "start": 5779, + "end": 6030, + "start": 5983, }, "name": Object { "kind": "Name", "loc": Object { - "end": 5793, - "start": 5780, + "end": 5997, + "start": 5984, }, "value": "aws_subscribe", }, @@ -9432,28 +9630,28 @@ Object { ], "kind": "FieldDefinition", "loc": Object { - "end": 5826, - "start": 5700, + "end": 6030, + "start": 5904, }, "name": Object { "kind": "Name", "loc": Object { - "end": 5718, - "start": 5700, + "end": 5922, + "start": 5904, }, "value": "onDeletePostEditor", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 5778, - "start": 5768, + "end": 5982, + "start": 5972, }, "name": Object { "kind": "Name", "loc": Object { - "end": 5778, - "start": 5768, + "end": 5982, + "start": 5972, }, "value": "PostEditor", }, @@ -9467,28 +9665,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 5882, - "start": 5842, + "end": 6086, + "start": 6046, }, "name": Object { "kind": "Name", "loc": Object { - "end": 5848, - "start": 5842, + "end": 6052, + "start": 6046, }, "value": "filter", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 5882, - "start": 5850, + "end": 6086, + "start": 6054, }, "name": Object { "kind": "Name", "loc": Object { - "end": 5882, - "start": 5850, + "end": 6086, + "start": 6054, }, "value": "ModelSubscriptionUserFilterInput", }, @@ -9502,30 +9700,30 @@ Object { Object { "kind": "Argument", "loc": Object { - "end": 5930, - "start": 5905, + "end": 6134, + "start": 6109, }, "name": Object { "kind": "Name", "loc": Object { - "end": 5914, - "start": 5905, + "end": 6118, + "start": 6109, }, "value": "mutations", }, "value": Object { "kind": "ListValue", "loc": Object { - "end": 5930, - "start": 5916, + "end": 6134, + "start": 6120, }, "values": Array [ Object { "block": false, "kind": "StringValue", "loc": Object { - "end": 5929, - "start": 5917, + "end": 6133, + "start": 6121, }, "value": "createUser", }, @@ -9535,14 +9733,14 @@ Object { ], "kind": "Directive", "loc": Object { - "end": 5931, - "start": 5890, + "end": 6135, + "start": 6094, }, "name": Object { "kind": "Name", "loc": Object { - "end": 5904, - "start": 5891, + "end": 6108, + "start": 6095, }, "value": "aws_subscribe", }, @@ -9550,28 +9748,28 @@ Object { ], "kind": "FieldDefinition", "loc": Object { - "end": 5931, - "start": 5829, + "end": 6135, + "start": 6033, }, "name": Object { "kind": "Name", "loc": Object { - "end": 5841, - "start": 5829, + "end": 6045, + "start": 6033, }, "value": "onCreateUser", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 5889, - "start": 5885, + "end": 6093, + "start": 6089, }, "name": Object { "kind": "Name", "loc": Object { - "end": 5889, - "start": 5885, + "end": 6093, + "start": 6089, }, "value": "User", }, @@ -9585,28 +9783,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 5987, - "start": 5947, + "end": 6191, + "start": 6151, }, "name": Object { "kind": "Name", "loc": Object { - "end": 5953, - "start": 5947, + "end": 6157, + "start": 6151, }, "value": "filter", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 5987, - "start": 5955, + "end": 6191, + "start": 6159, }, "name": Object { "kind": "Name", "loc": Object { - "end": 5987, - "start": 5955, + "end": 6191, + "start": 6159, }, "value": "ModelSubscriptionUserFilterInput", }, @@ -9620,30 +9818,30 @@ Object { Object { "kind": "Argument", "loc": Object { - "end": 6035, - "start": 6010, + "end": 6239, + "start": 6214, }, "name": Object { "kind": "Name", "loc": Object { - "end": 6019, - "start": 6010, + "end": 6223, + "start": 6214, }, "value": "mutations", }, "value": Object { "kind": "ListValue", "loc": Object { - "end": 6035, - "start": 6021, + "end": 6239, + "start": 6225, }, "values": Array [ Object { "block": false, "kind": "StringValue", "loc": Object { - "end": 6034, - "start": 6022, + "end": 6238, + "start": 6226, }, "value": "updateUser", }, @@ -9653,14 +9851,14 @@ Object { ], "kind": "Directive", "loc": Object { - "end": 6036, - "start": 5995, + "end": 6240, + "start": 6199, }, "name": Object { "kind": "Name", "loc": Object { - "end": 6009, - "start": 5996, + "end": 6213, + "start": 6200, }, "value": "aws_subscribe", }, @@ -9668,28 +9866,28 @@ Object { ], "kind": "FieldDefinition", "loc": Object { - "end": 6036, - "start": 5934, + "end": 6240, + "start": 6138, }, "name": Object { "kind": "Name", "loc": Object { - "end": 5946, - "start": 5934, + "end": 6150, + "start": 6138, }, "value": "onUpdateUser", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 5994, - "start": 5990, + "end": 6198, + "start": 6194, }, "name": Object { "kind": "Name", "loc": Object { - "end": 5994, - "start": 5990, + "end": 6198, + "start": 6194, }, "value": "User", }, @@ -9703,28 +9901,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 6092, - "start": 6052, + "end": 6296, + "start": 6256, }, "name": Object { "kind": "Name", "loc": Object { - "end": 6058, - "start": 6052, + "end": 6262, + "start": 6256, }, "value": "filter", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 6092, - "start": 6060, + "end": 6296, + "start": 6264, }, "name": Object { "kind": "Name", "loc": Object { - "end": 6092, - "start": 6060, + "end": 6296, + "start": 6264, }, "value": "ModelSubscriptionUserFilterInput", }, @@ -9738,30 +9936,30 @@ Object { Object { "kind": "Argument", "loc": Object { - "end": 6140, - "start": 6115, + "end": 6344, + "start": 6319, }, "name": Object { "kind": "Name", "loc": Object { - "end": 6124, - "start": 6115, + "end": 6328, + "start": 6319, }, "value": "mutations", }, "value": Object { "kind": "ListValue", "loc": Object { - "end": 6140, - "start": 6126, + "end": 6344, + "start": 6330, }, "values": Array [ Object { "block": false, "kind": "StringValue", "loc": Object { - "end": 6139, - "start": 6127, + "end": 6343, + "start": 6331, }, "value": "deleteUser", }, @@ -9771,14 +9969,14 @@ Object { ], "kind": "Directive", "loc": Object { - "end": 6141, - "start": 6100, + "end": 6345, + "start": 6304, }, "name": Object { "kind": "Name", "loc": Object { - "end": 6114, - "start": 6101, + "end": 6318, + "start": 6305, }, "value": "aws_subscribe", }, @@ -9786,28 +9984,28 @@ Object { ], "kind": "FieldDefinition", "loc": Object { - "end": 6141, - "start": 6039, + "end": 6345, + "start": 6243, }, "name": Object { "kind": "Name", "loc": Object { - "end": 6051, - "start": 6039, + "end": 6255, + "start": 6243, }, "value": "onDeleteUser", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 6099, - "start": 6095, + "end": 6303, + "start": 6299, }, "name": Object { "kind": "Name", "loc": Object { - "end": 6099, - "start": 6095, + "end": 6303, + "start": 6299, }, "value": "User", }, @@ -9817,14 +10015,14 @@ Object { "interfaces": Array [], "kind": "ObjectTypeDefinition", "loc": Object { - "end": 6143, - "start": 5105, + "end": 6347, + "start": 5309, }, "name": Object { "kind": "Name", "loc": Object { - "end": 5122, - "start": 5110, + "end": 5326, + "start": 5314, }, "value": "Subscription", }, @@ -9839,28 +10037,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 6205, - "start": 6185, + "end": 6409, + "start": 6389, }, "name": Object { "kind": "Name", "loc": Object { - "end": 6191, - "start": 6185, + "end": 6395, + "start": 6389, }, "value": "postID", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 6205, - "start": 6193, + "end": 6409, + "start": 6397, }, "name": Object { "kind": "Name", "loc": Object { - "end": 6205, - "start": 6193, + "end": 6409, + "start": 6397, }, "value": "ModelIDInput", }, @@ -9872,28 +10070,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 6230, - "start": 6208, + "end": 6434, + "start": 6412, }, "name": Object { "kind": "Name", "loc": Object { - "end": 6216, - "start": 6208, + "end": 6420, + "start": 6412, }, "value": "editorID", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 6230, - "start": 6218, + "end": 6434, + "start": 6422, }, "name": Object { "kind": "Name", "loc": Object { - "end": 6230, - "start": 6218, + "end": 6434, + "start": 6422, }, "value": "ModelIDInput", }, @@ -9905,34 +10103,34 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 6269, - "start": 6233, + "end": 6473, + "start": 6437, }, "name": Object { "kind": "Name", "loc": Object { - "end": 6236, - "start": 6233, + "end": 6440, + "start": 6437, }, "value": "and", }, "type": Object { "kind": "ListType", "loc": Object { - "end": 6269, - "start": 6238, + "end": 6473, + "start": 6442, }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 6268, - "start": 6239, + "end": 6472, + "start": 6443, }, "name": Object { "kind": "Name", "loc": Object { - "end": 6268, - "start": 6239, + "end": 6472, + "start": 6443, }, "value": "ModelPostEditorConditionInput", }, @@ -9945,34 +10143,34 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 6307, - "start": 6272, + "end": 6511, + "start": 6476, }, "name": Object { "kind": "Name", "loc": Object { - "end": 6274, - "start": 6272, + "end": 6478, + "start": 6476, }, "value": "or", }, "type": Object { "kind": "ListType", "loc": Object { - "end": 6307, - "start": 6276, + "end": 6511, + "start": 6480, }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 6306, - "start": 6277, + "end": 6510, + "start": 6481, }, "name": Object { "kind": "Name", "loc": Object { - "end": 6306, - "start": 6277, + "end": 6510, + "start": 6481, }, "value": "ModelPostEditorConditionInput", }, @@ -9985,28 +10183,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 6344, - "start": 6310, + "end": 6548, + "start": 6514, }, "name": Object { "kind": "Name", "loc": Object { - "end": 6313, - "start": 6310, + "end": 6517, + "start": 6514, }, "value": "not", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 6344, - "start": 6315, + "end": 6548, + "start": 6519, }, "name": Object { "kind": "Name", "loc": Object { - "end": 6344, - "start": 6315, + "end": 6548, + "start": 6519, }, "value": "ModelPostEditorConditionInput", }, @@ -10018,44 +10216,110 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 6374, - "start": 6347, + "end": 6578, + "start": 6551, }, "name": Object { "kind": "Name", "loc": Object { - "end": 6355, - "start": 6347, + "end": 6559, + "start": 6551, }, "value": "_deleted", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 6374, - "start": 6357, + "end": 6578, + "start": 6561, }, "name": Object { "kind": "Name", "loc": Object { - "end": 6374, - "start": 6357, + "end": 6578, + "start": 6561, }, "value": "ModelBooleanInput", }, }, }, + Object { + "defaultValue": undefined, + "description": undefined, + "directives": Array [], + "kind": "InputValueDefinition", + "loc": Object { + "end": 6608, + "start": 6581, + }, + "name": Object { + "kind": "Name", + "loc": Object { + "end": 6590, + "start": 6581, + }, + "value": "createdAt", + }, + "type": Object { + "kind": "NamedType", + "loc": Object { + "end": 6608, + "start": 6592, + }, + "name": Object { + "kind": "Name", + "loc": Object { + "end": 6608, + "start": 6592, + }, + "value": "ModelStringInput", + }, + }, + }, + Object { + "defaultValue": undefined, + "description": undefined, + "directives": Array [], + "kind": "InputValueDefinition", + "loc": Object { + "end": 6638, + "start": 6611, + }, + "name": Object { + "kind": "Name", + "loc": Object { + "end": 6620, + "start": 6611, + }, + "value": "updatedAt", + }, + "type": Object { + "kind": "NamedType", + "loc": Object { + "end": 6638, + "start": 6622, + }, + "name": Object { + "kind": "Name", + "loc": Object { + "end": 6638, + "start": 6622, + }, + "value": "ModelStringInput", + }, + }, + }, ], "kind": "InputObjectTypeDefinition", "loc": Object { - "end": 6376, - "start": 6145, + "end": 6640, + "start": 6349, }, "name": Object { "kind": "Name", "loc": Object { - "end": 6180, - "start": 6151, + "end": 6384, + "start": 6355, }, "value": "ModelPostEditorConditionInput", }, @@ -10070,28 +10334,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 6416, - "start": 6410, + "end": 6680, + "start": 6674, }, "name": Object { "kind": "Name", "loc": Object { - "end": 6412, - "start": 6410, + "end": 6676, + "start": 6674, }, "value": "id", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 6416, - "start": 6414, + "end": 6680, + "start": 6678, }, "name": Object { "kind": "Name", "loc": Object { - "end": 6416, - "start": 6414, + "end": 6680, + "start": 6678, }, "value": "ID", }, @@ -10103,34 +10367,34 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 6430, - "start": 6419, + "end": 6694, + "start": 6683, }, "name": Object { "kind": "Name", "loc": Object { - "end": 6425, - "start": 6419, + "end": 6689, + "start": 6683, }, "value": "postID", }, "type": Object { "kind": "NonNullType", "loc": Object { - "end": 6430, - "start": 6427, + "end": 6694, + "start": 6691, }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 6429, - "start": 6427, + "end": 6693, + "start": 6691, }, "name": Object { "kind": "Name", "loc": Object { - "end": 6429, - "start": 6427, + "end": 6693, + "start": 6691, }, "value": "ID", }, @@ -10143,34 +10407,34 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 6446, - "start": 6433, + "end": 6710, + "start": 6697, }, "name": Object { "kind": "Name", "loc": Object { - "end": 6441, - "start": 6433, + "end": 6705, + "start": 6697, }, "value": "editorID", }, "type": Object { "kind": "NonNullType", "loc": Object { - "end": 6446, - "start": 6443, + "end": 6710, + "start": 6707, }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 6445, - "start": 6443, + "end": 6709, + "start": 6707, }, "name": Object { "kind": "Name", "loc": Object { - "end": 6445, - "start": 6443, + "end": 6709, + "start": 6707, }, "value": "ID", }, @@ -10183,28 +10447,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 6462, - "start": 6449, + "end": 6726, + "start": 6713, }, "name": Object { "kind": "Name", "loc": Object { - "end": 6457, - "start": 6449, + "end": 6721, + "start": 6713, }, "value": "_version", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 6462, - "start": 6459, + "end": 6726, + "start": 6723, }, "name": Object { "kind": "Name", "loc": Object { - "end": 6462, - "start": 6459, + "end": 6726, + "start": 6723, }, "value": "Int", }, @@ -10213,14 +10477,14 @@ Object { ], "kind": "InputObjectTypeDefinition", "loc": Object { - "end": 6464, - "start": 6378, + "end": 6728, + "start": 6642, }, "name": Object { "kind": "Name", "loc": Object { - "end": 6405, - "start": 6384, + "end": 6669, + "start": 6648, }, "value": "CreatePostEditorInput", }, @@ -10235,34 +10499,34 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 6505, - "start": 6498, + "end": 6769, + "start": 6762, }, "name": Object { "kind": "Name", "loc": Object { - "end": 6500, - "start": 6498, + "end": 6764, + "start": 6762, }, "value": "id", }, "type": Object { "kind": "NonNullType", "loc": Object { - "end": 6505, - "start": 6502, + "end": 6769, + "start": 6766, }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 6504, - "start": 6502, + "end": 6768, + "start": 6766, }, "name": Object { "kind": "Name", "loc": Object { - "end": 6504, - "start": 6502, + "end": 6768, + "start": 6766, }, "value": "ID", }, @@ -10275,28 +10539,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 6518, - "start": 6508, + "end": 6782, + "start": 6772, }, "name": Object { "kind": "Name", "loc": Object { - "end": 6514, - "start": 6508, + "end": 6778, + "start": 6772, }, "value": "postID", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 6518, - "start": 6516, + "end": 6782, + "start": 6780, }, "name": Object { "kind": "Name", "loc": Object { - "end": 6518, - "start": 6516, + "end": 6782, + "start": 6780, }, "value": "ID", }, @@ -10308,28 +10572,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 6533, - "start": 6521, + "end": 6797, + "start": 6785, }, "name": Object { "kind": "Name", "loc": Object { - "end": 6529, - "start": 6521, + "end": 6793, + "start": 6785, }, "value": "editorID", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 6533, - "start": 6531, + "end": 6797, + "start": 6795, }, "name": Object { "kind": "Name", "loc": Object { - "end": 6533, - "start": 6531, + "end": 6797, + "start": 6795, }, "value": "ID", }, @@ -10341,28 +10605,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 6549, - "start": 6536, + "end": 6813, + "start": 6800, }, "name": Object { "kind": "Name", "loc": Object { - "end": 6544, - "start": 6536, + "end": 6808, + "start": 6800, }, "value": "_version", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 6549, - "start": 6546, + "end": 6813, + "start": 6810, }, "name": Object { "kind": "Name", "loc": Object { - "end": 6549, - "start": 6546, + "end": 6813, + "start": 6810, }, "value": "Int", }, @@ -10371,14 +10635,14 @@ Object { ], "kind": "InputObjectTypeDefinition", "loc": Object { - "end": 6551, - "start": 6466, + "end": 6815, + "start": 6730, }, "name": Object { "kind": "Name", "loc": Object { - "end": 6493, - "start": 6472, + "end": 6757, + "start": 6736, }, "value": "UpdatePostEditorInput", }, @@ -10393,34 +10657,34 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 6592, - "start": 6585, + "end": 6856, + "start": 6849, }, "name": Object { "kind": "Name", "loc": Object { - "end": 6587, - "start": 6585, + "end": 6851, + "start": 6849, }, "value": "id", }, "type": Object { "kind": "NonNullType", "loc": Object { - "end": 6592, - "start": 6589, + "end": 6856, + "start": 6853, }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 6591, - "start": 6589, + "end": 6855, + "start": 6853, }, "name": Object { "kind": "Name", "loc": Object { - "end": 6591, - "start": 6589, + "end": 6855, + "start": 6853, }, "value": "ID", }, @@ -10433,28 +10697,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 6608, - "start": 6595, + "end": 6872, + "start": 6859, }, "name": Object { "kind": "Name", "loc": Object { - "end": 6603, - "start": 6595, + "end": 6867, + "start": 6859, }, "value": "_version", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 6608, - "start": 6605, + "end": 6872, + "start": 6869, }, "name": Object { "kind": "Name", "loc": Object { - "end": 6608, - "start": 6605, + "end": 6872, + "start": 6869, }, "value": "Int", }, @@ -10463,14 +10727,14 @@ Object { ], "kind": "InputObjectTypeDefinition", "loc": Object { - "end": 6610, - "start": 6553, + "end": 6874, + "start": 6817, }, "name": Object { "kind": "Name", "loc": Object { - "end": 6580, - "start": 6559, + "end": 6844, + "start": 6823, }, "value": "DeletePostEditorInput", }, @@ -10485,28 +10749,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 6689, - "start": 6661, + "end": 6953, + "start": 6925, }, "name": Object { "kind": "Name", "loc": Object { - "end": 6663, - "start": 6661, + "end": 6927, + "start": 6925, }, "value": "id", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 6689, - "start": 6665, + "end": 6953, + "start": 6929, }, "name": Object { "kind": "Name", "loc": Object { - "end": 6689, - "start": 6665, + "end": 6953, + "start": 6929, }, "value": "ModelSubscriptionIDInput", }, @@ -10518,28 +10782,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 6724, - "start": 6692, + "end": 6988, + "start": 6956, }, "name": Object { "kind": "Name", "loc": Object { - "end": 6698, - "start": 6692, + "end": 6962, + "start": 6956, }, "value": "postID", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 6724, - "start": 6700, + "end": 6988, + "start": 6964, }, "name": Object { "kind": "Name", "loc": Object { - "end": 6724, - "start": 6700, + "end": 6988, + "start": 6964, }, "value": "ModelSubscriptionIDInput", }, @@ -10551,28 +10815,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 6761, - "start": 6727, + "end": 7025, + "start": 6991, }, "name": Object { "kind": "Name", "loc": Object { - "end": 6735, - "start": 6727, + "end": 6999, + "start": 6991, }, "value": "editorID", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 6761, - "start": 6737, + "end": 7025, + "start": 7001, }, "name": Object { "kind": "Name", "loc": Object { - "end": 6761, - "start": 6737, + "end": 7025, + "start": 7001, }, "value": "ModelSubscriptionIDInput", }, @@ -10584,34 +10848,100 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 6809, - "start": 6764, + "end": 7067, + "start": 7028, + }, + "name": Object { + "kind": "Name", + "loc": Object { + "end": 7037, + "start": 7028, + }, + "value": "createdAt", + }, + "type": Object { + "kind": "NamedType", + "loc": Object { + "end": 7067, + "start": 7039, + }, + "name": Object { + "kind": "Name", + "loc": Object { + "end": 7067, + "start": 7039, + }, + "value": "ModelSubscriptionStringInput", + }, + }, + }, + Object { + "defaultValue": undefined, + "description": undefined, + "directives": Array [], + "kind": "InputValueDefinition", + "loc": Object { + "end": 7109, + "start": 7070, }, "name": Object { "kind": "Name", "loc": Object { - "end": 6767, - "start": 6764, + "end": 7079, + "start": 7070, + }, + "value": "updatedAt", + }, + "type": Object { + "kind": "NamedType", + "loc": Object { + "end": 7109, + "start": 7081, + }, + "name": Object { + "kind": "Name", + "loc": Object { + "end": 7109, + "start": 7081, + }, + "value": "ModelSubscriptionStringInput", + }, + }, + }, + Object { + "defaultValue": undefined, + "description": undefined, + "directives": Array [], + "kind": "InputValueDefinition", + "loc": Object { + "end": 7157, + "start": 7112, + }, + "name": Object { + "kind": "Name", + "loc": Object { + "end": 7115, + "start": 7112, }, "value": "and", }, "type": Object { "kind": "ListType", "loc": Object { - "end": 6809, - "start": 6769, + "end": 7157, + "start": 7117, }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 6808, - "start": 6770, + "end": 7156, + "start": 7118, }, "name": Object { "kind": "Name", "loc": Object { - "end": 6808, - "start": 6770, + "end": 7156, + "start": 7118, }, "value": "ModelSubscriptionPostEditorFilterInput", }, @@ -10624,34 +10954,34 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 6856, - "start": 6812, + "end": 7204, + "start": 7160, }, "name": Object { "kind": "Name", "loc": Object { - "end": 6814, - "start": 6812, + "end": 7162, + "start": 7160, }, "value": "or", }, "type": Object { "kind": "ListType", "loc": Object { - "end": 6856, - "start": 6816, + "end": 7204, + "start": 7164, }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 6855, - "start": 6817, + "end": 7203, + "start": 7165, }, "name": Object { "kind": "Name", "loc": Object { - "end": 6855, - "start": 6817, + "end": 7203, + "start": 7165, }, "value": "ModelSubscriptionPostEditorFilterInput", }, @@ -10664,28 +10994,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 6886, - "start": 6859, + "end": 7234, + "start": 7207, }, "name": Object { "kind": "Name", "loc": Object { - "end": 6867, - "start": 6859, + "end": 7215, + "start": 7207, }, "value": "_deleted", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 6886, - "start": 6869, + "end": 7234, + "start": 7217, }, "name": Object { "kind": "Name", "loc": Object { - "end": 6886, - "start": 6869, + "end": 7234, + "start": 7217, }, "value": "ModelBooleanInput", }, @@ -10694,14 +11024,14 @@ Object { ], "kind": "InputObjectTypeDefinition", "loc": Object { - "end": 6888, - "start": 6612, + "end": 7236, + "start": 6876, }, "name": Object { "kind": "Name", "loc": Object { - "end": 6656, - "start": 6618, + "end": 6920, + "start": 6882, }, "value": "ModelSubscriptionPostEditorFilterInput", }, @@ -10716,40 +11046,40 @@ Object { "directives": Array [], "kind": "FieldDefinition", "loc": Object { - "end": 6933, - "start": 6919, + "end": 7281, + "start": 7267, }, "name": Object { "kind": "Name", "loc": Object { - "end": 6924, - "start": 6919, + "end": 7272, + "start": 7267, }, "value": "items", }, "type": Object { "kind": "NonNullType", "loc": Object { - "end": 6933, - "start": 6926, + "end": 7281, + "start": 7274, }, "type": Object { "kind": "ListType", "loc": Object { - "end": 6932, - "start": 6926, + "end": 7280, + "start": 7274, }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 6931, - "start": 6927, + "end": 7279, + "start": 7275, }, "name": Object { "kind": "Name", "loc": Object { - "end": 6931, - "start": 6927, + "end": 7279, + "start": 7275, }, "value": "User", }, @@ -10763,28 +11093,28 @@ Object { "directives": Array [], "kind": "FieldDefinition", "loc": Object { - "end": 6953, - "start": 6936, + "end": 7301, + "start": 7284, }, "name": Object { "kind": "Name", "loc": Object { - "end": 6945, - "start": 6936, + "end": 7293, + "start": 7284, }, "value": "nextToken", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 6953, - "start": 6947, + "end": 7301, + "start": 7295, }, "name": Object { "kind": "Name", "loc": Object { - "end": 6953, - "start": 6947, + "end": 7301, + "start": 7295, }, "value": "String", }, @@ -10796,28 +11126,28 @@ Object { "directives": Array [], "kind": "FieldDefinition", "loc": Object { - "end": 6979, - "start": 6956, + "end": 7327, + "start": 7304, }, "name": Object { "kind": "Name", "loc": Object { - "end": 6965, - "start": 6956, + "end": 7313, + "start": 7304, }, "value": "startedAt", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 6979, - "start": 6967, + "end": 7327, + "start": 7315, }, "name": Object { "kind": "Name", "loc": Object { - "end": 6979, - "start": 6967, + "end": 7327, + "start": 7315, }, "value": "AWSTimestamp", }, @@ -10827,14 +11157,14 @@ Object { "interfaces": Array [], "kind": "ObjectTypeDefinition", "loc": Object { - "end": 6981, - "start": 6890, + "end": 7329, + "start": 7238, }, "name": Object { "kind": "Name", "loc": Object { - "end": 6914, - "start": 6895, + "end": 7262, + "start": 7243, }, "value": "ModelUserConnection", }, @@ -10849,28 +11179,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 7030, - "start": 7014, + "end": 7378, + "start": 7362, }, "name": Object { "kind": "Name", "loc": Object { - "end": 7016, - "start": 7014, + "end": 7364, + "start": 7362, }, "value": "id", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 7030, - "start": 7018, + "end": 7378, + "start": 7366, }, "name": Object { "kind": "Name", "loc": Object { - "end": 7030, - "start": 7018, + "end": 7378, + "start": 7366, }, "value": "ModelIDInput", }, @@ -10882,28 +11212,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 7059, - "start": 7033, + "end": 7407, + "start": 7381, }, "name": Object { "kind": "Name", "loc": Object { - "end": 7041, - "start": 7033, + "end": 7389, + "start": 7381, }, "value": "username", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 7059, - "start": 7043, + "end": 7407, + "start": 7391, }, "name": Object { "kind": "Name", "loc": Object { - "end": 7059, - "start": 7043, + "end": 7407, + "start": 7391, }, "value": "ModelStringInput", }, @@ -10915,34 +11245,100 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 7089, - "start": 7062, + "end": 7437, + "start": 7410, }, "name": Object { "kind": "Name", "loc": Object { - "end": 7065, - "start": 7062, + "end": 7419, + "start": 7410, + }, + "value": "createdAt", + }, + "type": Object { + "kind": "NamedType", + "loc": Object { + "end": 7437, + "start": 7421, + }, + "name": Object { + "kind": "Name", + "loc": Object { + "end": 7437, + "start": 7421, + }, + "value": "ModelStringInput", + }, + }, + }, + Object { + "defaultValue": undefined, + "description": undefined, + "directives": Array [], + "kind": "InputValueDefinition", + "loc": Object { + "end": 7467, + "start": 7440, + }, + "name": Object { + "kind": "Name", + "loc": Object { + "end": 7449, + "start": 7440, + }, + "value": "updatedAt", + }, + "type": Object { + "kind": "NamedType", + "loc": Object { + "end": 7467, + "start": 7451, + }, + "name": Object { + "kind": "Name", + "loc": Object { + "end": 7467, + "start": 7451, + }, + "value": "ModelStringInput", + }, + }, + }, + Object { + "defaultValue": undefined, + "description": undefined, + "directives": Array [], + "kind": "InputValueDefinition", + "loc": Object { + "end": 7497, + "start": 7470, + }, + "name": Object { + "kind": "Name", + "loc": Object { + "end": 7473, + "start": 7470, }, "value": "and", }, "type": Object { "kind": "ListType", "loc": Object { - "end": 7089, - "start": 7067, + "end": 7497, + "start": 7475, }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 7088, - "start": 7068, + "end": 7496, + "start": 7476, }, "name": Object { "kind": "Name", "loc": Object { - "end": 7088, - "start": 7068, + "end": 7496, + "start": 7476, }, "value": "ModelUserFilterInput", }, @@ -10955,34 +11351,34 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 7118, - "start": 7092, + "end": 7526, + "start": 7500, }, "name": Object { "kind": "Name", "loc": Object { - "end": 7094, - "start": 7092, + "end": 7502, + "start": 7500, }, "value": "or", }, "type": Object { "kind": "ListType", "loc": Object { - "end": 7118, - "start": 7096, + "end": 7526, + "start": 7504, }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 7117, - "start": 7097, + "end": 7525, + "start": 7505, }, "name": Object { "kind": "Name", "loc": Object { - "end": 7117, - "start": 7097, + "end": 7525, + "start": 7505, }, "value": "ModelUserFilterInput", }, @@ -10995,28 +11391,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 7146, - "start": 7121, + "end": 7554, + "start": 7529, }, "name": Object { "kind": "Name", "loc": Object { - "end": 7124, - "start": 7121, + "end": 7532, + "start": 7529, }, "value": "not", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 7146, - "start": 7126, + "end": 7554, + "start": 7534, }, "name": Object { "kind": "Name", "loc": Object { - "end": 7146, - "start": 7126, + "end": 7554, + "start": 7534, }, "value": "ModelUserFilterInput", }, @@ -11028,28 +11424,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 7176, - "start": 7149, + "end": 7584, + "start": 7557, }, "name": Object { "kind": "Name", "loc": Object { - "end": 7157, - "start": 7149, + "end": 7565, + "start": 7557, }, "value": "_deleted", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 7176, - "start": 7159, + "end": 7584, + "start": 7567, }, "name": Object { "kind": "Name", "loc": Object { - "end": 7176, - "start": 7159, + "end": 7584, + "start": 7567, }, "value": "ModelBooleanInput", }, @@ -11058,14 +11454,14 @@ Object { ], "kind": "InputObjectTypeDefinition", "loc": Object { - "end": 7178, - "start": 6983, + "end": 7586, + "start": 7331, }, "name": Object { "kind": "Name", "loc": Object { - "end": 7009, - "start": 6989, + "end": 7357, + "start": 7337, }, "value": "ModelUserFilterInput", }, @@ -11080,28 +11476,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 7240, - "start": 7214, + "end": 7648, + "start": 7622, }, "name": Object { "kind": "Name", "loc": Object { - "end": 7222, - "start": 7214, + "end": 7630, + "start": 7622, }, "value": "username", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 7240, - "start": 7224, + "end": 7648, + "start": 7632, }, "name": Object { "kind": "Name", "loc": Object { - "end": 7240, - "start": 7224, + "end": 7648, + "start": 7632, }, "value": "ModelStringInput", }, @@ -11113,34 +11509,34 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 7273, - "start": 7243, + "end": 7681, + "start": 7651, }, "name": Object { "kind": "Name", "loc": Object { - "end": 7246, - "start": 7243, + "end": 7654, + "start": 7651, }, "value": "and", }, "type": Object { "kind": "ListType", "loc": Object { - "end": 7273, - "start": 7248, + "end": 7681, + "start": 7656, }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 7272, - "start": 7249, + "end": 7680, + "start": 7657, }, "name": Object { "kind": "Name", "loc": Object { - "end": 7272, - "start": 7249, + "end": 7680, + "start": 7657, }, "value": "ModelUserConditionInput", }, @@ -11153,34 +11549,34 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 7305, - "start": 7276, + "end": 7713, + "start": 7684, }, "name": Object { "kind": "Name", "loc": Object { - "end": 7278, - "start": 7276, + "end": 7686, + "start": 7684, }, "value": "or", }, "type": Object { "kind": "ListType", "loc": Object { - "end": 7305, - "start": 7280, + "end": 7713, + "start": 7688, }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 7304, - "start": 7281, + "end": 7712, + "start": 7689, }, "name": Object { "kind": "Name", "loc": Object { - "end": 7304, - "start": 7281, + "end": 7712, + "start": 7689, }, "value": "ModelUserConditionInput", }, @@ -11193,28 +11589,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 7336, - "start": 7308, + "end": 7744, + "start": 7716, }, "name": Object { "kind": "Name", "loc": Object { - "end": 7311, - "start": 7308, + "end": 7719, + "start": 7716, }, "value": "not", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 7336, - "start": 7313, + "end": 7744, + "start": 7721, }, "name": Object { "kind": "Name", "loc": Object { - "end": 7336, - "start": 7313, + "end": 7744, + "start": 7721, }, "value": "ModelUserConditionInput", }, @@ -11226,44 +11622,110 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 7366, - "start": 7339, + "end": 7774, + "start": 7747, }, "name": Object { "kind": "Name", "loc": Object { - "end": 7347, - "start": 7339, + "end": 7755, + "start": 7747, }, "value": "_deleted", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 7366, - "start": 7349, + "end": 7774, + "start": 7757, }, "name": Object { "kind": "Name", "loc": Object { - "end": 7366, - "start": 7349, + "end": 7774, + "start": 7757, }, "value": "ModelBooleanInput", }, }, }, + Object { + "defaultValue": undefined, + "description": undefined, + "directives": Array [], + "kind": "InputValueDefinition", + "loc": Object { + "end": 7804, + "start": 7777, + }, + "name": Object { + "kind": "Name", + "loc": Object { + "end": 7786, + "start": 7777, + }, + "value": "createdAt", + }, + "type": Object { + "kind": "NamedType", + "loc": Object { + "end": 7804, + "start": 7788, + }, + "name": Object { + "kind": "Name", + "loc": Object { + "end": 7804, + "start": 7788, + }, + "value": "ModelStringInput", + }, + }, + }, + Object { + "defaultValue": undefined, + "description": undefined, + "directives": Array [], + "kind": "InputValueDefinition", + "loc": Object { + "end": 7834, + "start": 7807, + }, + "name": Object { + "kind": "Name", + "loc": Object { + "end": 7816, + "start": 7807, + }, + "value": "updatedAt", + }, + "type": Object { + "kind": "NamedType", + "loc": Object { + "end": 7834, + "start": 7818, + }, + "name": Object { + "kind": "Name", + "loc": Object { + "end": 7834, + "start": 7818, + }, + "value": "ModelStringInput", + }, + }, + }, ], "kind": "InputObjectTypeDefinition", "loc": Object { - "end": 7368, - "start": 7180, + "end": 7836, + "start": 7588, }, "name": Object { "kind": "Name", "loc": Object { - "end": 7209, - "start": 7186, + "end": 7617, + "start": 7594, }, "value": "ModelUserConditionInput", }, @@ -11278,28 +11740,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 7402, - "start": 7396, + "end": 7870, + "start": 7864, }, "name": Object { "kind": "Name", "loc": Object { - "end": 7398, - "start": 7396, + "end": 7866, + "start": 7864, }, "value": "id", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 7402, - "start": 7400, + "end": 7870, + "start": 7868, }, "name": Object { "kind": "Name", "loc": Object { - "end": 7402, - "start": 7400, + "end": 7870, + "start": 7868, }, "value": "ID", }, @@ -11311,34 +11773,34 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 7422, - "start": 7405, + "end": 7890, + "start": 7873, }, "name": Object { "kind": "Name", "loc": Object { - "end": 7413, - "start": 7405, + "end": 7881, + "start": 7873, }, "value": "username", }, "type": Object { "kind": "NonNullType", "loc": Object { - "end": 7422, - "start": 7415, + "end": 7890, + "start": 7883, }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 7421, - "start": 7415, + "end": 7889, + "start": 7883, }, "name": Object { "kind": "Name", "loc": Object { - "end": 7421, - "start": 7415, + "end": 7889, + "start": 7883, }, "value": "String", }, @@ -11351,28 +11813,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 7438, - "start": 7425, + "end": 7906, + "start": 7893, }, "name": Object { "kind": "Name", "loc": Object { - "end": 7433, - "start": 7425, + "end": 7901, + "start": 7893, }, "value": "_version", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 7438, - "start": 7435, + "end": 7906, + "start": 7903, }, "name": Object { "kind": "Name", "loc": Object { - "end": 7438, - "start": 7435, + "end": 7906, + "start": 7903, }, "value": "Int", }, @@ -11381,14 +11843,14 @@ Object { ], "kind": "InputObjectTypeDefinition", "loc": Object { - "end": 7440, - "start": 7370, + "end": 7908, + "start": 7838, }, "name": Object { "kind": "Name", "loc": Object { - "end": 7391, - "start": 7376, + "end": 7859, + "start": 7844, }, "value": "CreateUserInput", }, @@ -11403,34 +11865,34 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 7475, - "start": 7468, + "end": 7943, + "start": 7936, }, "name": Object { "kind": "Name", "loc": Object { - "end": 7470, - "start": 7468, + "end": 7938, + "start": 7936, }, "value": "id", }, "type": Object { "kind": "NonNullType", "loc": Object { - "end": 7475, - "start": 7472, + "end": 7943, + "start": 7940, }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 7474, - "start": 7472, + "end": 7942, + "start": 7940, }, "name": Object { "kind": "Name", "loc": Object { - "end": 7474, - "start": 7472, + "end": 7942, + "start": 7940, }, "value": "ID", }, @@ -11443,28 +11905,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 7494, - "start": 7478, + "end": 7962, + "start": 7946, }, "name": Object { "kind": "Name", "loc": Object { - "end": 7486, - "start": 7478, + "end": 7954, + "start": 7946, }, "value": "username", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 7494, - "start": 7488, + "end": 7962, + "start": 7956, }, "name": Object { "kind": "Name", "loc": Object { - "end": 7494, - "start": 7488, + "end": 7962, + "start": 7956, }, "value": "String", }, @@ -11476,28 +11938,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 7510, - "start": 7497, + "end": 7978, + "start": 7965, }, "name": Object { "kind": "Name", "loc": Object { - "end": 7505, - "start": 7497, + "end": 7973, + "start": 7965, }, "value": "_version", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 7510, - "start": 7507, + "end": 7978, + "start": 7975, }, "name": Object { "kind": "Name", "loc": Object { - "end": 7510, - "start": 7507, + "end": 7978, + "start": 7975, }, "value": "Int", }, @@ -11506,14 +11968,14 @@ Object { ], "kind": "InputObjectTypeDefinition", "loc": Object { - "end": 7512, - "start": 7442, + "end": 7980, + "start": 7910, }, "name": Object { "kind": "Name", "loc": Object { - "end": 7463, - "start": 7448, + "end": 7931, + "start": 7916, }, "value": "UpdateUserInput", }, @@ -11528,34 +11990,34 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 7547, - "start": 7540, + "end": 8015, + "start": 8008, }, "name": Object { "kind": "Name", "loc": Object { - "end": 7542, - "start": 7540, + "end": 8010, + "start": 8008, }, "value": "id", }, "type": Object { "kind": "NonNullType", "loc": Object { - "end": 7547, - "start": 7544, + "end": 8015, + "start": 8012, }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 7546, - "start": 7544, + "end": 8014, + "start": 8012, }, "name": Object { "kind": "Name", "loc": Object { - "end": 7546, - "start": 7544, + "end": 8014, + "start": 8012, }, "value": "ID", }, @@ -11568,28 +12030,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 7563, - "start": 7550, + "end": 8031, + "start": 8018, }, "name": Object { "kind": "Name", "loc": Object { - "end": 7558, - "start": 7550, + "end": 8026, + "start": 8018, }, "value": "_version", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 7563, - "start": 7560, + "end": 8031, + "start": 8028, }, "name": Object { "kind": "Name", "loc": Object { - "end": 7563, - "start": 7560, + "end": 8031, + "start": 8028, }, "value": "Int", }, @@ -11598,14 +12060,14 @@ Object { ], "kind": "InputObjectTypeDefinition", "loc": Object { - "end": 7565, - "start": 7514, + "end": 8033, + "start": 7982, }, "name": Object { "kind": "Name", "loc": Object { - "end": 7535, - "start": 7520, + "end": 8003, + "start": 7988, }, "value": "DeleteUserInput", }, @@ -11620,28 +12082,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 7638, - "start": 7610, + "end": 8106, + "start": 8078, }, "name": Object { "kind": "Name", "loc": Object { - "end": 7612, - "start": 7610, + "end": 8080, + "start": 8078, }, "value": "id", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 7638, - "start": 7614, + "end": 8106, + "start": 8082, }, "name": Object { "kind": "Name", "loc": Object { - "end": 7638, - "start": 7614, + "end": 8106, + "start": 8082, }, "value": "ModelSubscriptionIDInput", }, @@ -11653,28 +12115,61 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 7679, - "start": 7641, + "end": 8147, + "start": 8109, }, "name": Object { "kind": "Name", "loc": Object { - "end": 7649, - "start": 7641, + "end": 8117, + "start": 8109, }, "value": "username", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 7679, - "start": 7651, + "end": 8147, + "start": 8119, + }, + "name": Object { + "kind": "Name", + "loc": Object { + "end": 8147, + "start": 8119, + }, + "value": "ModelSubscriptionStringInput", + }, + }, + }, + Object { + "defaultValue": undefined, + "description": undefined, + "directives": Array [], + "kind": "InputValueDefinition", + "loc": Object { + "end": 8189, + "start": 8150, + }, + "name": Object { + "kind": "Name", + "loc": Object { + "end": 8159, + "start": 8150, + }, + "value": "createdAt", + }, + "type": Object { + "kind": "NamedType", + "loc": Object { + "end": 8189, + "start": 8161, }, "name": Object { "kind": "Name", "loc": Object { - "end": 7679, - "start": 7651, + "end": 8189, + "start": 8161, }, "value": "ModelSubscriptionStringInput", }, @@ -11686,34 +12181,67 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 7721, - "start": 7682, + "end": 8231, + "start": 8192, }, "name": Object { "kind": "Name", "loc": Object { - "end": 7685, - "start": 7682, + "end": 8201, + "start": 8192, + }, + "value": "updatedAt", + }, + "type": Object { + "kind": "NamedType", + "loc": Object { + "end": 8231, + "start": 8203, + }, + "name": Object { + "kind": "Name", + "loc": Object { + "end": 8231, + "start": 8203, + }, + "value": "ModelSubscriptionStringInput", + }, + }, + }, + Object { + "defaultValue": undefined, + "description": undefined, + "directives": Array [], + "kind": "InputValueDefinition", + "loc": Object { + "end": 8273, + "start": 8234, + }, + "name": Object { + "kind": "Name", + "loc": Object { + "end": 8237, + "start": 8234, }, "value": "and", }, "type": Object { "kind": "ListType", "loc": Object { - "end": 7721, - "start": 7687, + "end": 8273, + "start": 8239, }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 7720, - "start": 7688, + "end": 8272, + "start": 8240, }, "name": Object { "kind": "Name", "loc": Object { - "end": 7720, - "start": 7688, + "end": 8272, + "start": 8240, }, "value": "ModelSubscriptionUserFilterInput", }, @@ -11726,34 +12254,34 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 7762, - "start": 7724, + "end": 8314, + "start": 8276, }, "name": Object { "kind": "Name", "loc": Object { - "end": 7726, - "start": 7724, + "end": 8278, + "start": 8276, }, "value": "or", }, "type": Object { "kind": "ListType", "loc": Object { - "end": 7762, - "start": 7728, + "end": 8314, + "start": 8280, }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 7761, - "start": 7729, + "end": 8313, + "start": 8281, }, "name": Object { "kind": "Name", "loc": Object { - "end": 7761, - "start": 7729, + "end": 8313, + "start": 8281, }, "value": "ModelSubscriptionUserFilterInput", }, @@ -11766,28 +12294,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 7792, - "start": 7765, + "end": 8344, + "start": 8317, }, "name": Object { "kind": "Name", "loc": Object { - "end": 7773, - "start": 7765, + "end": 8325, + "start": 8317, }, "value": "_deleted", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 7792, - "start": 7775, + "end": 8344, + "start": 8327, }, "name": Object { "kind": "Name", "loc": Object { - "end": 7792, - "start": 7775, + "end": 8344, + "start": 8327, }, "value": "ModelBooleanInput", }, @@ -11796,14 +12324,14 @@ Object { ], "kind": "InputObjectTypeDefinition", "loc": Object { - "end": 7794, - "start": 7567, + "end": 8346, + "start": 8035, }, "name": Object { "kind": "Name", "loc": Object { - "end": 7605, - "start": 7573, + "end": 8073, + "start": 8041, }, "value": "ModelSubscriptionUserFilterInput", }, @@ -11818,28 +12346,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 7837, - "start": 7831, + "end": 8389, + "start": 8383, }, "name": Object { "kind": "Name", "loc": Object { - "end": 7833, - "start": 7831, + "end": 8385, + "start": 8383, }, "value": "eq", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 7837, - "start": 7835, + "end": 8389, + "start": 8387, }, "name": Object { "kind": "Name", "loc": Object { - "end": 7837, - "start": 7835, + "end": 8389, + "start": 8387, }, "value": "ID", }, @@ -11851,28 +12379,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 7846, - "start": 7840, + "end": 8398, + "start": 8392, }, "name": Object { "kind": "Name", "loc": Object { - "end": 7842, - "start": 7840, + "end": 8394, + "start": 8392, }, "value": "le", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 7846, - "start": 7844, + "end": 8398, + "start": 8396, }, "name": Object { "kind": "Name", "loc": Object { - "end": 7846, - "start": 7844, + "end": 8398, + "start": 8396, }, "value": "ID", }, @@ -11884,28 +12412,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 7855, - "start": 7849, + "end": 8407, + "start": 8401, }, "name": Object { "kind": "Name", "loc": Object { - "end": 7851, - "start": 7849, + "end": 8403, + "start": 8401, }, "value": "lt", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 7855, - "start": 7853, + "end": 8407, + "start": 8405, }, "name": Object { "kind": "Name", "loc": Object { - "end": 7855, - "start": 7853, + "end": 8407, + "start": 8405, }, "value": "ID", }, @@ -11917,28 +12445,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 7864, - "start": 7858, + "end": 8416, + "start": 8410, }, "name": Object { "kind": "Name", "loc": Object { - "end": 7860, - "start": 7858, + "end": 8412, + "start": 8410, }, "value": "ge", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 7864, - "start": 7862, + "end": 8416, + "start": 8414, }, "name": Object { "kind": "Name", "loc": Object { - "end": 7864, - "start": 7862, + "end": 8416, + "start": 8414, }, "value": "ID", }, @@ -11950,28 +12478,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 7873, - "start": 7867, + "end": 8425, + "start": 8419, }, "name": Object { "kind": "Name", "loc": Object { - "end": 7869, - "start": 7867, + "end": 8421, + "start": 8419, }, "value": "gt", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 7873, - "start": 7871, + "end": 8425, + "start": 8423, }, "name": Object { "kind": "Name", "loc": Object { - "end": 7873, - "start": 7871, + "end": 8425, + "start": 8423, }, "value": "ID", }, @@ -11983,34 +12511,34 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 7889, - "start": 7876, + "end": 8441, + "start": 8428, }, "name": Object { "kind": "Name", "loc": Object { - "end": 7883, - "start": 7876, + "end": 8435, + "start": 8428, }, "value": "between", }, "type": Object { "kind": "ListType", "loc": Object { - "end": 7889, - "start": 7885, + "end": 8441, + "start": 8437, }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 7888, - "start": 7886, + "end": 8440, + "start": 8438, }, "name": Object { "kind": "Name", "loc": Object { - "end": 7888, - "start": 7886, + "end": 8440, + "start": 8438, }, "value": "ID", }, @@ -12023,28 +12551,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 7906, - "start": 7892, + "end": 8458, + "start": 8444, }, "name": Object { "kind": "Name", "loc": Object { - "end": 7902, - "start": 7892, + "end": 8454, + "start": 8444, }, "value": "beginsWith", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 7906, - "start": 7904, + "end": 8458, + "start": 8456, }, "name": Object { "kind": "Name", "loc": Object { - "end": 7906, - "start": 7904, + "end": 8458, + "start": 8456, }, "value": "ID", }, @@ -12053,14 +12581,14 @@ Object { ], "kind": "InputObjectTypeDefinition", "loc": Object { - "end": 7908, - "start": 7796, + "end": 8460, + "start": 8348, }, "name": Object { "kind": "Name", "loc": Object { - "end": 7826, - "start": 7802, + "end": 8378, + "start": 8354, }, "value": "ModelIDKeyConditionInput", }, @@ -12075,40 +12603,40 @@ Object { "directives": Array [], "kind": "FieldDefinition", "loc": Object { - "end": 7965, - "start": 7945, + "end": 8517, + "start": 8497, }, "name": Object { "kind": "Name", "loc": Object { - "end": 7950, - "start": 7945, + "end": 8502, + "start": 8497, }, "value": "items", }, "type": Object { "kind": "NonNullType", "loc": Object { - "end": 7965, - "start": 7952, + "end": 8517, + "start": 8504, }, "type": Object { "kind": "ListType", "loc": Object { - "end": 7964, - "start": 7952, + "end": 8516, + "start": 8504, }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 7963, - "start": 7953, + "end": 8515, + "start": 8505, }, "name": Object { "kind": "Name", "loc": Object { - "end": 7963, - "start": 7953, + "end": 8515, + "start": 8505, }, "value": "PostEditor", }, @@ -12122,28 +12650,28 @@ Object { "directives": Array [], "kind": "FieldDefinition", "loc": Object { - "end": 7985, - "start": 7968, + "end": 8537, + "start": 8520, }, "name": Object { "kind": "Name", "loc": Object { - "end": 7977, - "start": 7968, + "end": 8529, + "start": 8520, }, "value": "nextToken", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 7985, - "start": 7979, + "end": 8537, + "start": 8531, }, "name": Object { "kind": "Name", "loc": Object { - "end": 7985, - "start": 7979, + "end": 8537, + "start": 8531, }, "value": "String", }, @@ -12153,14 +12681,14 @@ Object { "interfaces": Array [], "kind": "ObjectTypeDefinition", "loc": Object { - "end": 7987, - "start": 7910, + "end": 8539, + "start": 8462, }, "name": Object { "kind": "Name", "loc": Object { - "end": 7940, - "start": 7915, + "end": 8492, + "start": 8467, }, "value": "ModelPostEditorConnection", }, @@ -12175,28 +12703,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 8042, - "start": 8026, + "end": 8594, + "start": 8578, }, "name": Object { "kind": "Name", "loc": Object { - "end": 8028, - "start": 8026, + "end": 8580, + "start": 8578, }, "value": "id", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 8042, - "start": 8030, + "end": 8594, + "start": 8582, }, "name": Object { "kind": "Name", "loc": Object { - "end": 8042, - "start": 8030, + "end": 8594, + "start": 8582, }, "value": "ModelIDInput", }, @@ -12208,28 +12736,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 8065, - "start": 8045, + "end": 8617, + "start": 8597, }, "name": Object { "kind": "Name", "loc": Object { - "end": 8051, - "start": 8045, + "end": 8603, + "start": 8597, }, "value": "postID", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 8065, - "start": 8053, + "end": 8617, + "start": 8605, }, "name": Object { "kind": "Name", "loc": Object { - "end": 8065, - "start": 8053, + "end": 8617, + "start": 8605, }, "value": "ModelIDInput", }, @@ -12241,28 +12769,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 8090, - "start": 8068, + "end": 8642, + "start": 8620, }, "name": Object { "kind": "Name", "loc": Object { - "end": 8076, - "start": 8068, + "end": 8628, + "start": 8620, }, "value": "editorID", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 8090, - "start": 8078, + "end": 8642, + "start": 8630, }, "name": Object { "kind": "Name", "loc": Object { - "end": 8090, - "start": 8078, + "end": 8642, + "start": 8630, }, "value": "ModelIDInput", }, @@ -12274,34 +12802,34 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 8126, - "start": 8093, + "end": 8678, + "start": 8645, }, "name": Object { "kind": "Name", "loc": Object { - "end": 8096, - "start": 8093, + "end": 8648, + "start": 8645, }, "value": "and", }, "type": Object { "kind": "ListType", "loc": Object { - "end": 8126, - "start": 8098, + "end": 8678, + "start": 8650, }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 8125, - "start": 8099, + "end": 8677, + "start": 8651, }, "name": Object { "kind": "Name", "loc": Object { - "end": 8125, - "start": 8099, + "end": 8677, + "start": 8651, }, "value": "ModelPostEditorFilterInput", }, @@ -12314,34 +12842,34 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 8161, - "start": 8129, + "end": 8713, + "start": 8681, }, "name": Object { "kind": "Name", "loc": Object { - "end": 8131, - "start": 8129, + "end": 8683, + "start": 8681, }, "value": "or", }, "type": Object { "kind": "ListType", "loc": Object { - "end": 8161, - "start": 8133, + "end": 8713, + "start": 8685, }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 8160, - "start": 8134, + "end": 8712, + "start": 8686, }, "name": Object { "kind": "Name", "loc": Object { - "end": 8160, - "start": 8134, + "end": 8712, + "start": 8686, }, "value": "ModelPostEditorFilterInput", }, @@ -12354,28 +12882,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 8195, - "start": 8164, + "end": 8747, + "start": 8716, }, "name": Object { "kind": "Name", "loc": Object { - "end": 8167, - "start": 8164, + "end": 8719, + "start": 8716, }, "value": "not", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 8195, - "start": 8169, + "end": 8747, + "start": 8721, }, "name": Object { "kind": "Name", "loc": Object { - "end": 8195, - "start": 8169, + "end": 8747, + "start": 8721, }, "value": "ModelPostEditorFilterInput", }, @@ -12387,28 +12915,28 @@ Object { "directives": Array [], "kind": "InputValueDefinition", "loc": Object { - "end": 8225, - "start": 8198, + "end": 8777, + "start": 8750, }, "name": Object { "kind": "Name", "loc": Object { - "end": 8206, - "start": 8198, + "end": 8758, + "start": 8750, }, "value": "_deleted", }, "type": Object { "kind": "NamedType", "loc": Object { - "end": 8225, - "start": 8208, + "end": 8777, + "start": 8760, }, "name": Object { "kind": "Name", "loc": Object { - "end": 8225, - "start": 8208, + "end": 8777, + "start": 8760, }, "value": "ModelBooleanInput", }, @@ -12417,14 +12945,14 @@ Object { ], "kind": "InputObjectTypeDefinition", "loc": Object { - "end": 8227, - "start": 7989, + "end": 8779, + "start": 8541, }, "name": Object { "kind": "Name", "loc": Object { - "end": 8021, - "start": 7995, + "end": 8573, + "start": 8547, }, "value": "ModelPostEditorFilterInput", }, @@ -12432,7 +12960,7 @@ Object { ], "kind": "Document", "loc": Object { - "end": 8228, + "end": 8780, "start": 0, }, } diff --git a/packages/amplify-graphql-relational-transformer/src/__tests__/__snapshots__/amplify-graphql-many-to-many-transformer.test.ts.snap b/packages/amplify-graphql-relational-transformer/src/__tests__/__snapshots__/amplify-graphql-many-to-many-transformer.test.ts.snap index 24d972096b..a33560f6c9 100644 --- a/packages/amplify-graphql-relational-transformer/src/__tests__/__snapshots__/amplify-graphql-many-to-many-transformer.test.ts.snap +++ b/packages/amplify-graphql-relational-transformer/src/__tests__/__snapshots__/amplify-graphql-many-to-many-transformer.test.ts.snap @@ -187,6 +187,8 @@ type ModelModelAConnection { input ModelModelAFilterInput { id: ModelIDInput sortId: ModelIDInput + createdAt: ModelStringInput + updatedAt: ModelStringInput and: [ModelModelAFilterInput] or: [ModelModelAFilterInput] not: ModelModelAFilterInput @@ -205,6 +207,8 @@ input ModelModelAConditionInput { and: [ModelModelAConditionInput] or: [ModelModelAConditionInput] not: ModelModelAConditionInput + createdAt: ModelStringInput + updatedAt: ModelStringInput } input CreateModelAInput { @@ -237,6 +241,8 @@ type Mutation { input ModelSubscriptionModelAFilterInput { id: ModelSubscriptionIDInput sortId: ModelSubscriptionIDInput + createdAt: ModelSubscriptionStringInput + updatedAt: ModelSubscriptionStringInput and: [ModelSubscriptionModelAFilterInput] or: [ModelSubscriptionModelAFilterInput] } @@ -261,6 +267,8 @@ type ModelModelBConnection { input ModelModelBFilterInput { id: ModelIDInput sortId: ModelIDInput + createdAt: ModelStringInput + updatedAt: ModelStringInput and: [ModelModelBFilterInput] or: [ModelModelBFilterInput] not: ModelModelBFilterInput @@ -270,6 +278,8 @@ input ModelModelBConditionInput { and: [ModelModelBConditionInput] or: [ModelModelBConditionInput] not: ModelModelBConditionInput + createdAt: ModelStringInput + updatedAt: ModelStringInput } input CreateModelBInput { @@ -290,6 +300,8 @@ input DeleteModelBInput { input ModelSubscriptionModelBFilterInput { id: ModelSubscriptionIDInput sortId: ModelSubscriptionIDInput + createdAt: ModelSubscriptionStringInput + updatedAt: ModelSubscriptionStringInput and: [ModelSubscriptionModelBFilterInput] or: [ModelSubscriptionModelBFilterInput] } @@ -305,6 +317,8 @@ input ModelModelAModelBFilterInput { modelAsortId: ModelIDInput modelBID: ModelIDInput modelBsortId: ModelIDInput + createdAt: ModelStringInput + updatedAt: ModelStringInput and: [ModelModelAModelBFilterInput] or: [ModelModelAModelBFilterInput] not: ModelModelAModelBFilterInput @@ -318,6 +332,8 @@ input ModelModelAModelBConditionInput { and: [ModelModelAModelBConditionInput] or: [ModelModelAModelBConditionInput] not: ModelModelAModelBConditionInput + createdAt: ModelStringInput + updatedAt: ModelStringInput } input CreateModelAModelBInput { @@ -346,6 +362,8 @@ input ModelSubscriptionModelAModelBFilterInput { modelAsortId: ModelSubscriptionIDInput modelBID: ModelSubscriptionIDInput modelBsortId: ModelSubscriptionIDInput + createdAt: ModelSubscriptionStringInput + updatedAt: ModelSubscriptionStringInput and: [ModelSubscriptionModelAModelBFilterInput] or: [ModelSubscriptionModelAModelBFilterInput] } @@ -3471,6 +3489,8 @@ input ModelModelAFilterInput { id: ModelIDInput sortId: ModelIDInput secondSortId: ModelIDInput + createdAt: ModelStringInput + updatedAt: ModelStringInput and: [ModelModelAFilterInput] or: [ModelModelAFilterInput] not: ModelModelAFilterInput @@ -3489,6 +3509,8 @@ input ModelModelAConditionInput { and: [ModelModelAConditionInput] or: [ModelModelAConditionInput] not: ModelModelAConditionInput + createdAt: ModelStringInput + updatedAt: ModelStringInput } input CreateModelAInput { @@ -3525,6 +3547,8 @@ input ModelSubscriptionModelAFilterInput { id: ModelSubscriptionIDInput sortId: ModelSubscriptionIDInput secondSortId: ModelSubscriptionIDInput + createdAt: ModelSubscriptionStringInput + updatedAt: ModelSubscriptionStringInput and: [ModelSubscriptionModelAFilterInput] or: [ModelSubscriptionModelAFilterInput] } @@ -3549,6 +3573,8 @@ type ModelModelBConnection { input ModelModelBFilterInput { id: ModelIDInput sortId: ModelIDInput + createdAt: ModelStringInput + updatedAt: ModelStringInput and: [ModelModelBFilterInput] or: [ModelModelBFilterInput] not: ModelModelBFilterInput @@ -3558,6 +3584,8 @@ input ModelModelBConditionInput { and: [ModelModelBConditionInput] or: [ModelModelBConditionInput] not: ModelModelBConditionInput + createdAt: ModelStringInput + updatedAt: ModelStringInput } input CreateModelBInput { @@ -3578,6 +3606,8 @@ input DeleteModelBInput { input ModelSubscriptionModelBFilterInput { id: ModelSubscriptionIDInput sortId: ModelSubscriptionIDInput + createdAt: ModelSubscriptionStringInput + updatedAt: ModelSubscriptionStringInput and: [ModelSubscriptionModelBFilterInput] or: [ModelSubscriptionModelBFilterInput] } @@ -3594,6 +3624,8 @@ input ModelModelAModelBFilterInput { modelAsecondSortId: ModelIDInput modelBID: ModelIDInput modelBsortId: ModelIDInput + createdAt: ModelStringInput + updatedAt: ModelStringInput and: [ModelModelAModelBFilterInput] or: [ModelModelAModelBFilterInput] not: ModelModelAModelBFilterInput @@ -3608,6 +3640,8 @@ input ModelModelAModelBConditionInput { and: [ModelModelAModelBConditionInput] or: [ModelModelAModelBConditionInput] not: ModelModelAModelBConditionInput + createdAt: ModelStringInput + updatedAt: ModelStringInput } input CreateModelAModelBInput { @@ -3639,6 +3673,8 @@ input ModelSubscriptionModelAModelBFilterInput { modelAsecondSortId: ModelSubscriptionIDInput modelBID: ModelSubscriptionIDInput modelBsortId: ModelSubscriptionIDInput + createdAt: ModelSubscriptionStringInput + updatedAt: ModelSubscriptionStringInput and: [ModelSubscriptionModelAModelBFilterInput] or: [ModelSubscriptionModelAModelBFilterInput] } @@ -3870,6 +3906,8 @@ type ModelModelAConnection { input ModelModelAFilterInput { id: ModelIDInput sortId: ModelIDInput + createdAt: ModelStringInput + updatedAt: ModelStringInput and: [ModelModelAFilterInput] or: [ModelModelAFilterInput] not: ModelModelAFilterInput @@ -3888,6 +3926,8 @@ input ModelModelAConditionInput { and: [ModelModelAConditionInput] or: [ModelModelAConditionInput] not: ModelModelAConditionInput + createdAt: ModelStringInput + updatedAt: ModelStringInput } input CreateModelAInput { @@ -3920,6 +3960,8 @@ type Mutation { input ModelSubscriptionModelAFilterInput { id: ModelSubscriptionIDInput sortId: ModelSubscriptionIDInput + createdAt: ModelSubscriptionStringInput + updatedAt: ModelSubscriptionStringInput and: [ModelSubscriptionModelAFilterInput] or: [ModelSubscriptionModelAFilterInput] } @@ -3943,6 +3985,8 @@ type ModelModelBConnection { input ModelModelBFilterInput { id: ModelIDInput + createdAt: ModelStringInput + updatedAt: ModelStringInput and: [ModelModelBFilterInput] or: [ModelModelBFilterInput] not: ModelModelBFilterInput @@ -3952,6 +3996,8 @@ input ModelModelBConditionInput { and: [ModelModelBConditionInput] or: [ModelModelBConditionInput] not: ModelModelBConditionInput + createdAt: ModelStringInput + updatedAt: ModelStringInput } input CreateModelBInput { @@ -3968,6 +4014,8 @@ input DeleteModelBInput { input ModelSubscriptionModelBFilterInput { id: ModelSubscriptionIDInput + createdAt: ModelSubscriptionStringInput + updatedAt: ModelSubscriptionStringInput and: [ModelSubscriptionModelBFilterInput] or: [ModelSubscriptionModelBFilterInput] } @@ -3982,6 +4030,8 @@ input ModelModelAModelBFilterInput { modelAID: ModelIDInput modelAsortId: ModelIDInput modelBID: ModelIDInput + createdAt: ModelStringInput + updatedAt: ModelStringInput and: [ModelModelAModelBFilterInput] or: [ModelModelAModelBFilterInput] not: ModelModelAModelBFilterInput @@ -3994,6 +4044,8 @@ input ModelModelAModelBConditionInput { and: [ModelModelAModelBConditionInput] or: [ModelModelAModelBConditionInput] not: ModelModelAModelBConditionInput + createdAt: ModelStringInput + updatedAt: ModelStringInput } input CreateModelAModelBInput { @@ -4019,6 +4071,8 @@ input ModelSubscriptionModelAModelBFilterInput { modelAID: ModelSubscriptionIDInput modelAsortId: ModelSubscriptionIDInput modelBID: ModelSubscriptionIDInput + createdAt: ModelSubscriptionStringInput + updatedAt: ModelSubscriptionStringInput and: [ModelSubscriptionModelAModelBFilterInput] or: [ModelSubscriptionModelAModelBFilterInput] } @@ -4217,6 +4271,8 @@ type ModelFooConnection { input ModelFooFilterInput { id: ModelIDInput + createdAt: ModelStringInput + updatedAt: ModelStringInput and: [ModelFooFilterInput] or: [ModelFooFilterInput] not: ModelFooFilterInput @@ -4235,6 +4291,8 @@ input ModelFooConditionInput { and: [ModelFooConditionInput] or: [ModelFooConditionInput] not: ModelFooConditionInput + createdAt: ModelStringInput + updatedAt: ModelStringInput } input CreateFooInput { @@ -4263,6 +4321,8 @@ type Mutation { input ModelSubscriptionFooFilterInput { id: ModelSubscriptionIDInput + createdAt: ModelSubscriptionStringInput + updatedAt: ModelSubscriptionStringInput and: [ModelSubscriptionFooFilterInput] or: [ModelSubscriptionFooFilterInput] } @@ -4286,6 +4346,8 @@ type ModelBarConnection { input ModelBarFilterInput { id: ModelIDInput + createdAt: ModelStringInput + updatedAt: ModelStringInput and: [ModelBarFilterInput] or: [ModelBarFilterInput] not: ModelBarFilterInput @@ -4295,6 +4357,8 @@ input ModelBarConditionInput { and: [ModelBarConditionInput] or: [ModelBarConditionInput] not: ModelBarConditionInput + createdAt: ModelStringInput + updatedAt: ModelStringInput } input CreateBarInput { @@ -4311,6 +4375,8 @@ input DeleteBarInput { input ModelSubscriptionBarFilterInput { id: ModelSubscriptionIDInput + createdAt: ModelSubscriptionStringInput + updatedAt: ModelSubscriptionStringInput and: [ModelSubscriptionBarFilterInput] or: [ModelSubscriptionBarFilterInput] } @@ -4324,6 +4390,8 @@ input ModelFooBarFilterInput { id: ModelIDInput fooID: ModelIDInput barID: ModelIDInput + createdAt: ModelStringInput + updatedAt: ModelStringInput and: [ModelFooBarFilterInput] or: [ModelFooBarFilterInput] not: ModelFooBarFilterInput @@ -4335,6 +4403,8 @@ input ModelFooBarConditionInput { and: [ModelFooBarConditionInput] or: [ModelFooBarConditionInput] not: ModelFooBarConditionInput + createdAt: ModelStringInput + updatedAt: ModelStringInput } input CreateFooBarInput { @@ -4357,6 +4427,8 @@ input ModelSubscriptionFooBarFilterInput { id: ModelSubscriptionIDInput fooID: ModelSubscriptionIDInput barID: ModelSubscriptionIDInput + createdAt: ModelSubscriptionStringInput + updatedAt: ModelSubscriptionStringInput and: [ModelSubscriptionFooBarFilterInput] or: [ModelSubscriptionFooBarFilterInput] } diff --git a/packages/amplify-graphql-relational-transformer/src/__tests__/amplify-graphql-relations-with-custom-primary-key.test.ts b/packages/amplify-graphql-relational-transformer/src/__tests__/amplify-graphql-relations-with-custom-primary-key.test.ts index ab03e15958..09dcd1b2f9 100644 --- a/packages/amplify-graphql-relational-transformer/src/__tests__/amplify-graphql-relations-with-custom-primary-key.test.ts +++ b/packages/amplify-graphql-relational-transformer/src/__tests__/amplify-graphql-relations-with-custom-primary-key.test.ts @@ -208,11 +208,15 @@ describe('custom primary key and relational directives', () => { const medicalAppointmentUpdateInput = schema.definitions.find( (def: any) => def.name && def.name.value === 'UpdateMedicalAppointmentInput', ) as any; + const medicalAppointmentSubscriptionFilterInput = schema.definitions.find( + (def: any) => def.name && def.name.value === 'ModelSubscriptionMedicalAppointmentFilterInput', + ) as any; expect(medicalAppointmentFilterInput).toBeDefined(); expect(medicalAppointmentConditionInput).toBeDefined(); expect(medicalAppointmentCreateInput).toBeDefined(); expect(medicalAppointmentUpdateInput).toBeDefined(); + expect(medicalAppointmentSubscriptionFilterInput).toBeDefined(); const inputs = [ medicalAppointmentFilterInput, @@ -230,6 +234,24 @@ describe('custom primary key and relational directives', () => { expect(givenNameInputField).toBeDefined(); expect(familyNameInputField).toBeDefined(); }); + + // test subscription filter input has correct types + const ssnInputField = medicalAppointmentSubscriptionFilterInput.fields.find( + (f: any) => f.name.value === 'medicalAppointmentPatientSsn', + ); + const givenNameInputField = medicalAppointmentSubscriptionFilterInput.fields.find( + (f: any) => f.name.value === 'medicalAppointmentPatientGivenName', + ); + const familyNameInputField = medicalAppointmentSubscriptionFilterInput.fields.find( + (f: any) => f.name.value === 'medicalAppointmentPatientFamilyName', + ); + + expect(ssnInputField).toBeDefined(); + expect(ssnInputField.type.name.value).toEqual('ModelSubscriptionIDInput'); + expect(givenNameInputField).toBeDefined(); + expect(givenNameInputField.type.name.value).toEqual('ModelSubscriptionStringInput'); + expect(familyNameInputField).toBeDefined(); + expect(familyNameInputField.type.name.value).toEqual('ModelSubscriptionStringInput'); }); it('adds belongsTo sortKeyFields connection fields', () => { @@ -285,11 +307,15 @@ describe('custom primary key and relational directives', () => { const patientConditionInput = schema.definitions.find((def: any) => def.name && def.name.value === 'ModelPatientConditionInput') as any; const patientCreateInput = schema.definitions.find((def: any) => def.name && def.name.value === 'CreatePatientInput') as any; const patientUpdateInput = schema.definitions.find((def: any) => def.name && def.name.value === 'UpdatePatientInput') as any; + const patientSubscriptionFilterInput = schema.definitions.find( + (def: any) => def.name && def.name.value === 'ModelSubscriptionPatientFilterInput', + ) as any; expect(patientFilterInput).toBeDefined(); expect(patientConditionInput).toBeDefined(); expect(patientCreateInput).toBeDefined(); expect(patientUpdateInput).toBeDefined(); + expect(patientSubscriptionFilterInput).toBeDefined(); const inputs = [patientFilterInput, patientConditionInput, patientCreateInput, patientUpdateInput]; @@ -300,6 +326,19 @@ describe('custom primary key and relational directives', () => { expect(primaryKeyConnectionField).toBeDefined(); expect(sortKeyConnectionField).toBeDefined(); }); + + // test subscription filter input has correct types + const primaryKeyConnectionField = patientSubscriptionFilterInput.fields.find( + (f: any) => f.name.value === 'patientMedicalAppointmentAppointmentReference', + ); + const sortKeyConnectionField = patientSubscriptionFilterInput.fields.find( + (f: any) => f.name.value === 'patientMedicalAppointmentProvider', + ); + + expect(primaryKeyConnectionField).toBeDefined(); + expect(primaryKeyConnectionField.type.name.value).toEqual('ModelSubscriptionIDInput'); + expect(sortKeyConnectionField).toBeDefined(); + expect(sortKeyConnectionField.type.name.value).toEqual('ModelSubscriptionStringInput'); }); it('adds hasMany sortKeyFields connection fields', () => { @@ -357,11 +396,15 @@ describe('custom primary key and relational directives', () => { const medicalAppointmentUpdateInput = schema.definitions.find( (def: any) => def.name && def.name.value === 'UpdateMedicalAppointmentInput', ) as any; + const medicalAppointmentSubscriptionFilterInput = schema.definitions.find( + (def: any) => def.name && def.name.value === 'ModelSubscriptionPatientFilterInput', + ) as any; expect(medicalAppointmentFilterInput).toBeDefined(); expect(medicalAppointmentConditionInput).toBeDefined(); expect(medicalAppointmentCreateInput).toBeDefined(); expect(medicalAppointmentUpdateInput).toBeDefined(); + expect(medicalAppointmentSubscriptionFilterInput).toBeDefined(); const inputs = [ medicalAppointmentFilterInput, @@ -379,6 +422,24 @@ describe('custom primary key and relational directives', () => { expect(givenNameInputField).toBeDefined(); expect(familyNameInputField).toBeDefined(); }); + + // test subscription filter input has correct types + const ssnInputField = medicalAppointmentSubscriptionFilterInput.fields.find( + (f: any) => f.name.value === 'patientMedicalAppointmentsSsn', + ); + const givenNameInputField = medicalAppointmentSubscriptionFilterInput.fields.find( + (f: any) => f.name.value === 'patientMedicalAppointmentsGivenName', + ); + const familyNameInputField = medicalAppointmentSubscriptionFilterInput.fields.find( + (f: any) => f.name.value === 'patientMedicalAppointmentsFamilyName', + ); + + expect(ssnInputField).toBeDefined(); + expect(ssnInputField.type.name.value).toEqual('ModelSubscriptionIDInput'); + expect(givenNameInputField).toBeDefined(); + expect(givenNameInputField.type.name.value).toEqual('ModelSubscriptionStringInput'); + expect(familyNameInputField).toBeDefined(); + expect(familyNameInputField.type.name.value).toEqual('ModelSubscriptionStringInput'); }); it('uses primary key name for hasOne relational connection field old naming convention', () => { diff --git a/packages/amplify-graphql-relational-transformer/src/schema.ts b/packages/amplify-graphql-relational-transformer/src/schema.ts index ecdf2d1106..af54edf575 100644 --- a/packages/amplify-graphql-relational-transformer/src/schema.ts +++ b/packages/amplify-graphql-relational-transformer/src/schema.ts @@ -33,7 +33,7 @@ import { toUpper, wrapNonNull, } from 'graphql-transformer-common'; -import { getSortKeyFieldNames } from '@aws-amplify/graphql-transformer-core'; +import { getSortKeyFieldNames, getSubscriptionFilterInputName } from '@aws-amplify/graphql-transformer-core'; import { WritableDraft } from 'immer/dist/types/types-external'; import { BelongsToDirectiveConfiguration, @@ -226,6 +226,21 @@ export const ensureHasOneConnectionField = (config: HasOneDirectiveConfiguration ); } + const subscriptionFilterInputName = getSubscriptionFilterInputName(object.name.value); + const filterSubscriptionInput = ctx.output.getType(subscriptionFilterInputName) as InputObjectTypeDefinitionNode; + if (filterSubscriptionInput) { + updateFilterConnectionInputWithConnectionFields( + ctx, + filterSubscriptionInput, + object, + connectionAttributeName, + primaryKeyConnectionFieldType, + field, + sortKeyFields, + true, + ); + } + config.connectionFields.push(connectionAttributeName); config.connectionFields.push( ...getSortKeyFieldNames(relatedType).map((it) => getSortKeyConnectionAttributeName(object.name.value, field.name.value, it)), @@ -366,6 +381,21 @@ export const ensureHasManyConnectionField = ( sortKeyFields, ); } + + const subscriptionFilterInputName = getSubscriptionFilterInputName(object.name.value); + const filterSubscriptionInput = ctx.output.getType(subscriptionFilterInputName) as InputObjectTypeDefinitionNode; + if (filterSubscriptionInput) { + updateFilterConnectionInputWithConnectionFields( + ctx, + filterSubscriptionInput, + object, + connectionAttributeName, + primaryKeyConnectionFieldType, + field, + sortKeyFields, + true, + ); + } }; const getTypeFieldsWithConnectionField = ( @@ -634,13 +664,14 @@ const updateFilterConnectionInputWithConnectionFields = ( primaryKeyConnectionFieldType: string, field: FieldDefinitionNode, sortKeyFields: FieldDefinitionNode[], + isSubscriptionFilter = false, ): void => { const updatedFields = [...input.fields!]; updatedFields.push( ...getFilterConnectionInputFieldsWithConnectionField( updatedFields, connectionAttributeName, - generateModelScalarFilterInputName(primaryKeyConnectionFieldType, false), + generateModelScalarFilterInputName(primaryKeyConnectionFieldType, false, isSubscriptionFilter), ), ); sortKeyFields.forEach((it) => { @@ -648,7 +679,7 @@ const updateFilterConnectionInputWithConnectionFields = ( ...getFilterConnectionInputFieldsWithConnectionField( updatedFields, getSortKeyConnectionAttributeName(object.name.value, field.name.value, it.name.value), - generateModelScalarFilterInputName(getBaseType(it.type), false), + generateModelScalarFilterInputName(getBaseType(it.type), false, isSubscriptionFilter), ), ); }); diff --git a/packages/amplify-graphql-searchable-transformer/src/__tests__/__snapshots__/amplify-graphql-searchable-transformer.test.ts.snap b/packages/amplify-graphql-searchable-transformer/src/__tests__/__snapshots__/amplify-graphql-searchable-transformer.test.ts.snap index ae6c2b49b9..0b8d85304f 100644 --- a/packages/amplify-graphql-searchable-transformer/src/__tests__/__snapshots__/amplify-graphql-searchable-transformer.test.ts.snap +++ b/packages/amplify-graphql-searchable-transformer/src/__tests__/__snapshots__/amplify-graphql-searchable-transformer.test.ts.snap @@ -213,6 +213,8 @@ input ModelEmployeeFilterInput { firstName: ModelStringInput lastName: ModelStringInput type: ModelEmploymentTypeInput + createdAt: ModelStringInput + updatedAt: ModelStringInput and: [ModelEmployeeFilterInput] or: [ModelEmployeeFilterInput] not: ModelEmployeeFilterInput @@ -225,6 +227,8 @@ input ModelEmployeeConditionInput { and: [ModelEmployeeConditionInput] or: [ModelEmployeeConditionInput] not: ModelEmployeeConditionInput + createdAt: ModelStringInput + updatedAt: ModelStringInput } input CreateEmployeeInput { @@ -256,6 +260,8 @@ input ModelSubscriptionEmployeeFilterInput { firstName: ModelSubscriptionStringInput lastName: ModelSubscriptionStringInput type: ModelSubscriptionStringInput + createdAt: ModelSubscriptionStringInput + updatedAt: ModelSubscriptionStringInput and: [ModelSubscriptionEmployeeFilterInput] or: [ModelSubscriptionEmployeeFilterInput] } @@ -1954,6 +1960,8 @@ type ModelUserConnection { input ModelUserFilterInput { id: ModelIDInput name: ModelStringInput + createdAt: ModelStringInput + updatedAt: ModelStringInput and: [ModelUserFilterInput] or: [ModelUserFilterInput] not: ModelUserFilterInput @@ -1964,6 +1972,8 @@ input ModelUserConditionInput { and: [ModelUserConditionInput] or: [ModelUserConditionInput] not: ModelUserConditionInput + createdAt: ModelStringInput + updatedAt: ModelStringInput } input CreateUserInput { @@ -1983,6 +1993,8 @@ input DeleteUserInput { input ModelSubscriptionUserFilterInput { id: ModelSubscriptionIDInput name: ModelSubscriptionStringInput + createdAt: ModelSubscriptionStringInput + updatedAt: ModelSubscriptionStringInput and: [ModelSubscriptionUserFilterInput] or: [ModelSubscriptionUserFilterInput] } diff --git a/packages/amplify-graphql-transformer-core/API.md b/packages/amplify-graphql-transformer-core/API.md index 5186151983..e151c4f13d 100644 --- a/packages/amplify-graphql-transformer-core/API.md +++ b/packages/amplify-graphql-transformer-core/API.md @@ -199,6 +199,12 @@ export type GetArgumentsOptions = { deepMergeArguments?: boolean; }; +// @public (undocumented) +export const getConditionInputName: (modelName: string) => string; + +// @public (undocumented) +export const getConnectionName: (modelName: string) => string; + // @public (undocumented) export const getDefaultStrategyNameForDbType: (dbType: ModelDataSourceStrategySqlDbType) => string; @@ -207,6 +213,9 @@ export const getDefaultStrategyNameForDbType: (dbType: ModelDataSourceStrategySq // @public (undocumented) export const getFieldNameFor: (op: Operation, typeName: string) => string; +// @public (undocumented) +export const getFilterInputName: (modelName: string) => string; + // @public (undocumented) export const getImportedRDSTypeFromStrategyDbType: (dbType: ModelDataSourceStrategyDbType) => ImportedRDSType; @@ -243,6 +252,9 @@ export const getSortKeyFieldNames: (type: ObjectTypeDefinitionNode) => string[]; // @public (undocumented) export const getStrategyDbTypeFromTypeNode: (type: TypeNode, ctx: TransformerContextProvider) => ModelDataSourceStrategyDbType; +// @public (undocumented) +export const getSubscriptionFilterInputName: (modelName: string) => string; + // @public (undocumented) function getSyncConfig(ctx: TransformerTransformSchemaStepContextProvider, typeName: string): SyncConfig | undefined; diff --git a/packages/amplify-graphql-transformer-core/src/__tests__/transformer-context/output.test.ts b/packages/amplify-graphql-transformer-core/src/__tests__/transformer-context/output.test.ts index 3b98248511..2a0c8eb85d 100644 --- a/packages/amplify-graphql-transformer-core/src/__tests__/transformer-context/output.test.ts +++ b/packages/amplify-graphql-transformer-core/src/__tests__/transformer-context/output.test.ts @@ -1,4 +1,6 @@ import { Kind, DocumentNode } from 'graphql'; +import { makeInputValueDefinition, makeNamedType } from 'graphql-transformer-common'; +import { InputObjectDefinitionWrapper, InputFieldWrapper } from '@aws-amplify/graphql-transformer-core'; import { TransformerOutput } from '../../transformer-context/output'; import { DEFAULT_SCHEMA_DEFINITION, @@ -106,19 +108,18 @@ describe('TransformerOutput', () => { }; expect(() => new TransformerOutput(inputDocument)).not.toThrow(); }); + const inputDocumentWithNoOperations: DocumentNode = { + kind: Kind.DOCUMENT, + definitions: [ + { + kind: Kind.SCHEMA_DEFINITION, + directives: [], + operationTypes: [], + }, + ], + }; describe('add default operations', () => { - const inputDocumentWithNoOperations: DocumentNode = { - kind: Kind.DOCUMENT, - definitions: [ - { - kind: Kind.SCHEMA_DEFINITION, - directives: [], - operationTypes: [], - }, - ], - }; - const inputDocumentWithAllOperations: DocumentNode = { kind: Kind.DOCUMENT, definitions: [DEFAULT_SCHEMA_DEFINITION], @@ -202,4 +203,33 @@ describe('TransformerOutput', () => { expect(output.getSubscriptionTypeName()).toEqual('Subscription'); }); }); + + test('adds and gets input', () => { + const output = new TransformerOutput(inputDocumentWithNoOperations); + const input = InputObjectDefinitionWrapper.create('myinput'); + const inputField = InputFieldWrapper.create('owner', 'ModelStringInput', true); + input.addField(inputField); + output.addInput(input.serialize()); + expect(output.getInput('myinput')?.fields?.[0]?.name.value).toEqual('owner'); + }); + + test('returns undefined if input does not exist', () => { + const output = new TransformerOutput(inputDocumentWithNoOperations); + expect(output.getInput('noinput')).toBeUndefined(); + }); + + test('updates input', () => { + const output = new TransformerOutput(inputDocumentWithNoOperations); + const input = InputObjectDefinitionWrapper.create('myinput'); + const inputField = InputFieldWrapper.create('owner', 'ModelStringInput', true); + input.addField(inputField); + output.addInput(input.serialize()); + expect(output.getInput('myinput')?.fields?.[0]?.name.value).toEqual('owner'); + + const newInput = InputObjectDefinitionWrapper.create('myinput'); + const newInputField = InputFieldWrapper.create('newowner', 'ModelStringInput', true); + newInput.addField(newInputField); + output.updateInput(newInput.serialize()); + expect(output.getInput('myinput')?.fields?.[0]?.name.value).toEqual('newowner'); + }); }); diff --git a/packages/amplify-graphql-transformer-core/src/index.ts b/packages/amplify-graphql-transformer-core/src/index.ts index 1ac914ca6f..f1c57b9cbd 100644 --- a/packages/amplify-graphql-transformer-core/src/index.ts +++ b/packages/amplify-graphql-transformer-core/src/index.ts @@ -57,6 +57,10 @@ export { normalizeDbType, setResourceName, SQLLambdaResourceNames, + getFilterInputName, + getConditionInputName, + getSubscriptionFilterInputName, + getConnectionName, } from './utils'; export type { SetResourceNameProps } from './utils'; export * from './utils/operation-names'; diff --git a/packages/amplify-graphql-transformer-core/src/transformer-context/output.ts b/packages/amplify-graphql-transformer-core/src/transformer-context/output.ts index 91a11d2cfb..f7d7a08ab8 100644 --- a/packages/amplify-graphql-transformer-core/src/transformer-context/output.ts +++ b/packages/amplify-graphql-transformer-core/src/transformer-context/output.ts @@ -597,6 +597,22 @@ export class TransformerOutput implements TransformerContextOutputProvider { this.nodeMap[inp.name.value] = inp; } + public updateInput(obj: InputObjectTypeDefinitionNode) { + if (!this.nodeMap[obj.name.value]) { + throw new Error(`Type ${obj.name.value} does not exist.`); + } + this.nodeMap[obj.name.value] = obj; + } + + public getInput(name: string): InputObjectTypeDefinitionNode | undefined { + if (this.nodeMap[name]) { + const node = this.nodeMap[name]; + if (node.kind === Kind.INPUT_OBJECT_TYPE_DEFINITION) { + return node as InputObjectTypeDefinitionNode; + } + } + } + /** * Add an enum type definition node to the context. * @param en The enum type definition node to add. diff --git a/packages/amplify-graphql-transformer-core/src/utils/index.ts b/packages/amplify-graphql-transformer-core/src/utils/index.ts index 6e1398e338..00f2247a73 100644 --- a/packages/amplify-graphql-transformer-core/src/utils/index.ts +++ b/packages/amplify-graphql-transformer-core/src/utils/index.ts @@ -1,4 +1,10 @@ -export { getPrimaryKeyFields } from './model-util'; +export { + getPrimaryKeyFields, + getFilterInputName, + getConditionInputName, + getSubscriptionFilterInputName, + getConnectionName, +} from './model-util'; export { DirectiveWrapper, GetArgumentsOptions, generateGetArgumentsInput } from './directive-wrapper'; export { collectDirectives, collectDirectivesByTypeNames } from './type-map-utils'; export { stripDirectives } from './strip-directives'; diff --git a/packages/amplify-graphql-transformer-core/src/utils/model-util.ts b/packages/amplify-graphql-transformer-core/src/utils/model-util.ts index 4687196830..99972a7bac 100644 --- a/packages/amplify-graphql-transformer-core/src/utils/model-util.ts +++ b/packages/amplify-graphql-transformer-core/src/utils/model-util.ts @@ -1,3 +1,4 @@ +import { toPascalCase } from 'graphql-transformer-common'; import { ListValueNode, ObjectTypeDefinitionNode, StringValueNode } from 'graphql'; export const getPrimaryKeyFields = (type: ObjectTypeDefinitionNode): string[] => { @@ -13,3 +14,19 @@ export const getPrimaryKeyFields = (type: ObjectTypeDefinitionNode): string[] => } return result; }; + +export const getFilterInputName = (modelName: string): string => { + return toPascalCase(['Model', modelName, 'FilterInput']); +}; + +export const getConditionInputName = (modelName: string): string => { + return toPascalCase(['Model', modelName, 'ConditionInput']); +}; + +export const getSubscriptionFilterInputName = (modelName: string): string => { + return toPascalCase(['ModelSubscription', modelName, 'FilterInput']); +}; + +export const getConnectionName = (modelName: string): string => { + return toPascalCase(['Model', modelName, 'Connection']); +}; diff --git a/packages/amplify-graphql-transformer-interfaces/API.md b/packages/amplify-graphql-transformer-interfaces/API.md index 256f17132a..a25be2a52b 100644 --- a/packages/amplify-graphql-transformer-interfaces/API.md +++ b/packages/amplify-graphql-transformer-interfaces/API.md @@ -477,6 +477,8 @@ export interface TransformerContextOutputProvider { // (undocumented) addUnionExtension(obj: UnionTypeExtensionNode): void; // (undocumented) + getInput(name: string): InputObjectTypeDefinitionNode | undefined; + // (undocumented) getMutation(): ObjectTypeDefinitionNode | undefined; // (undocumented) getMutationTypeName(): string | undefined; @@ -503,6 +505,8 @@ export interface TransformerContextOutputProvider { // (undocumented) putType(obj: TypeDefinitionNode): void; // (undocumented) + updateInput(obj: InputObjectTypeDefinitionNode): void; + // (undocumented) updateObject(obj: ObjectTypeDefinitionNode): void; } diff --git a/packages/amplify-graphql-transformer-interfaces/src/transformer-context/transformer-context-output-provider.ts b/packages/amplify-graphql-transformer-interfaces/src/transformer-context/transformer-context-output-provider.ts index 77f1f81fa8..1938449b25 100644 --- a/packages/amplify-graphql-transformer-interfaces/src/transformer-context/transformer-context-output-provider.ts +++ b/packages/amplify-graphql-transformer-interfaces/src/transformer-context/transformer-context-output-provider.ts @@ -144,6 +144,10 @@ export interface TransformerContextOutputProvider { */ addInput(inp: InputObjectTypeDefinitionNode): void; + updateInput(obj: InputObjectTypeDefinitionNode): void; + + getInput(name: string): InputObjectTypeDefinitionNode | undefined; + /** * Add an enum type definition node to the context. * @param en The enum type definition node to add.