Skip to content

Commit d791086

Browse files
authored
fix: use correct region in amplify configure (#939)
* fix: use correct region in amplify configure Signed-off-by: Kevin Shan <[email protected]> * chore: lint Signed-off-by: Kevin Shan <[email protected]> * chore: add comments Signed-off-by: Kevin Shan <[email protected]> --------- Signed-off-by: Kevin Shan <[email protected]>
1 parent f763085 commit d791086

File tree

8 files changed

+44
-47
lines changed

8 files changed

+44
-47
lines changed

.codebuild/android_canary_workflow.yml

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,6 @@ batch:
2222
compute-type: BUILD_GENERAL1_MEDIUM
2323
depend-on:
2424
- build_linux
25-
- identifier: build_app_android_ap_east_1
26-
buildspec: .codebuild/run_regionalized_android_modelgen_e2e_test.yml
27-
env:
28-
compute-type: BUILD_GENERAL1_LARGE
29-
variables:
30-
TEST_SUITE: src/__tests__/build-app-android.test.ts
31-
CLI_REGION: ap-east-1
32-
CANARY_METRIC_NAME: AndroidAppBuildCodegenSuccessRate
33-
depend-on:
34-
- publish_to_local_registry
3525
- identifier: build_app_android_ap_northeast_1
3626
buildspec: .codebuild/run_regionalized_android_modelgen_e2e_test.yml
3727
env:
@@ -227,4 +217,4 @@ batch:
227217
env:
228218
compute-type: BUILD_GENERAL1_MEDIUM
229219
depend-on:
230-
- build_app_android_ap_east_1
220+
- build_app_android_ap_northeast_1

.codebuild/e2e_workflow.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ batch:
107107
variables:
108108
TEST_SUITE: >-
109109
src/__tests__/add-codegen-ios.test.ts|src/__tests__/configure-codegen-android.test.ts|src/__tests__/configure-codegen-js.test.ts|src/__tests__/graphql-codegen-android.test.ts
110-
CLI_REGION: ap-east-1
110+
CLI_REGION: ap-northeast-1
111111
depend-on:
112112
- publish_to_local_registry
113113
- identifier: >-
@@ -118,7 +118,7 @@ batch:
118118
variables:
119119
TEST_SUITE: >-
120120
src/__tests__/graphql-codegen-js.test.ts|src/__tests__/remove-codegen-android.test.ts|src/__tests__/remove-codegen-ios.test.ts|src/__tests__/add-codegen-android.test.ts
121-
CLI_REGION: ap-northeast-1
121+
CLI_REGION: ap-northeast-2
122122
depend-on:
123123
- publish_to_local_registry
124124
- identifier: >-
@@ -129,7 +129,7 @@ batch:
129129
variables:
130130
TEST_SUITE: >-
131131
src/__tests__/configure-codegen-ios.test.ts|src/__tests__/datastore-modelgen-android.test.ts|src/__tests__/datastore-modelgen-js.test.ts|src/__tests__/feature-flags.test.ts
132-
CLI_REGION: ap-northeast-2
132+
CLI_REGION: ap-northeast-3
133133
depend-on:
134134
- publish_to_local_registry
135135
- identifier: >-
@@ -140,7 +140,7 @@ batch:
140140
variables:
141141
TEST_SUITE: >-
142142
src/__tests__/graphql-codegen-ios.test.ts|src/__tests__/add-codegen-js.test.ts|src/__tests__/datastore-modelgen-ios.test.ts|src/__tests__/remove-codegen-js.test.ts
143-
CLI_REGION: ap-northeast-3
143+
CLI_REGION: ap-south-1
144144
depend-on:
145145
- publish_to_local_registry
146146
- identifier: >-
@@ -151,7 +151,7 @@ batch:
151151
variables:
152152
TEST_SUITE: >-
153153
src/__tests__/datastore-modelgen-flutter.test.ts|src/__tests__/env-codegen.test.ts|src/__tests__/model-introspection-codegen.test.ts|src/__tests__/pull-codegen.test.ts
154-
CLI_REGION: ap-south-1
154+
CLI_REGION: ap-southeast-1
155155
depend-on:
156156
- publish_to_local_registry
157157
- identifier: >-
@@ -162,7 +162,7 @@ batch:
162162
variables:
163163
TEST_SUITE: >-
164164
src/__tests__/push-codegen-ios.test.ts|src/__tests__/push-codegen-android.test.ts|src/__tests__/graphql-documents-generator.test.ts|src/__tests__/push-codegen-js.test.ts
165-
CLI_REGION: ap-southeast-1
165+
CLI_REGION: ap-southeast-2
166166
depend-on:
167167
- publish_to_local_registry
168168
- identifier: >-
@@ -173,7 +173,7 @@ batch:
173173
variables:
174174
TEST_SUITE: >-
175175
src/__tests__/build-app-ts.test.ts|src/__tests__/graphql-generator-app.test.ts|src/__tests__/push-codegen-admin-modelgen.test.ts|src/__tests__/uninitialized-project-codegen-js.test.ts
176-
CLI_REGION: ap-southeast-2
176+
CLI_REGION: ca-central-1
177177
DISABLE_ESLINT_PLUGIN: true
178178
depend-on:
179179
- publish_to_local_registry
@@ -185,7 +185,7 @@ batch:
185185
variables:
186186
TEST_SUITE: >-
187187
src/__tests__/uninitialized-project-modelgen-android.test.ts|src/__tests__/uninitialized-project-modelgen-flutter.test.ts|src/__tests__/uninitialized-project-modelgen-ios.test.ts|src/__tests__/uninitialized-project-modelgen-js.test.ts
188-
CLI_REGION: ca-central-1
188+
CLI_REGION: eu-central-1
189189
depend-on:
190190
- publish_to_local_registry
191191
- identifier: >-

.codebuild/ios_canary_workflow.yml

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,6 @@ batch:
2222
compute-type: BUILD_GENERAL1_MEDIUM
2323
depend-on:
2424
- build_linux
25-
- identifier: build_app_ios_ap_east_1
26-
buildspec: .codebuild/run_regionalized_ios_modelgen_e2e_test.yml
27-
env:
28-
compute-type: BUILD_GENERAL1_LARGE
29-
variables:
30-
TEST_SUITE: src/__tests__/build-app-swift.test.ts
31-
CLI_REGION: ap-east-1
32-
CANARY_METRIC_NAME: IosAppBuildCodegenSuccessRate
33-
depend-on:
34-
- publish_to_local_registry
3525
- identifier: build_app_ios_ap_northeast_1
3626
buildspec: .codebuild/run_regionalized_ios_modelgen_e2e_test.yml
3727
env:
@@ -227,4 +217,4 @@ batch:
227217
env:
228218
compute-type: BUILD_GENERAL1_MEDIUM
229219
depend-on:
230-
- build_app_ios_ap_east_1
220+
- build_app_ios_ap_northeast_1

.codebuild/ts_canary_workflow.yml

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,6 @@ batch:
2222
compute-type: BUILD_GENERAL1_MEDIUM
2323
depend-on:
2424
- build_linux
25-
- identifier: build_app_ts_ap_east_1
26-
buildspec: .codebuild/run_regionalized_ts_modelgen_e2e_test.yml
27-
env:
28-
compute-type: BUILD_GENERAL1_LARGE
29-
variables:
30-
TEST_SUITE: src/__tests__/build-app-ts.test.ts
31-
CLI_REGION: ap-east-1
32-
CANARY_METRIC_NAME: TsAppBuildCodegenSuccessRate
33-
DISABLE_ESLINT_PLUGIN: true
34-
depend-on:
35-
- publish_to_local_registry
3625
- identifier: build_app_ts_ap_northeast_1
3726
buildspec: .codebuild/run_regionalized_ts_modelgen_e2e_test.yml
3827
env:
@@ -247,4 +236,4 @@ batch:
247236
env:
248237
compute-type: BUILD_GENERAL1_MEDIUM
249238
depend-on:
250-
- build_app_ts_ap_east_1
239+
- build_app_ts_ap_northeast_1

packages/amplify-codegen-e2e-core/src/configure/index.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,22 @@ const defaultProjectSettings = {
2525
startCmd: '\r',
2626
};
2727

28+
/**
29+
* Supported regions:
30+
* - All Amplify regions, as reported https://docs.aws.amazon.com/general/latest/gr/amplify.html
31+
*
32+
* NOTE:
33+
* - The list is used to configure correct region in Amplify profile as env var $CLI_REGION
34+
* - The list much be in the same order as 'amplify configure' regions selection dropdown
35+
* - 'ap-east-1' is not included in the list due to known discrepancy in Amplify CLI 'configure' command dropdown and supported regions
36+
*
37+
* The list of supported regions must be kept in sync amongst all of:
38+
* - Amplify CLI 'amplify configure' command regions dropdown
39+
* - the internal pipeline that publishes new lambda layer versions
40+
* - amplify-codegen/scripts/e2e-test-regions.json
41+
* - amplify-codegen/scripts/split-canary-tests.ts
42+
* - amplify-codegen/scripts/split-e2e-tests.ts
43+
*/
2844
export const amplifyRegions = [
2945
'us-east-1',
3046
'us-east-2',
@@ -38,6 +54,7 @@ export const amplifyRegions = [
3854
'eu-central-1',
3955
'ap-northeast-1',
4056
'ap-northeast-2',
57+
'ap-northeast-3',
4158
'ap-southeast-1',
4259
'ap-southeast-2',
4360
'ap-south-1',

scripts/e2e-test-regions.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
[
2-
{ "name": "ap-east-1", "optIn": true },
32
{ "name": "ap-northeast-1", "optIn": false },
43
{ "name": "ap-northeast-2", "optIn": false },
54
{ "name": "ap-northeast-3", "optIn": false },

scripts/split-canary-tests.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,16 @@ const CODEBUILD_CONFIG_BASE_PATH: string = join(CODEBUILD_CONFIG_PATH, 'canary_w
1111
* Supported regions:
1212
* - All Amplify regions, as reported https://docs.aws.amazon.com/general/latest/gr/amplify.html
1313
*
14-
* NOTE: The list of supported regions must be kept in sync amongst all of:
14+
* NOTE:
15+
* - 'ap-east-1' is not included in the list due to known discrepancy in Amplify CLI 'configure' command dropdown and supported regions
16+
* - Since 'ap-east-1' is not available via 'amplify configure', test $CLI_REGION with 'ap-east-1' will run in 'us-east-1'
17+
* and fail Amplify profile assertion in test setup phase
18+
*
19+
* The list of supported regions must be kept in sync amongst all of:
20+
* - Amplify CLI 'amplify configure' command regions dropdown
1521
* - the internal pipeline that publishes new lambda layer versions
22+
* - amplify-codegen/scripts/e2e-test-regions.json
1623
* - amplify-codegen/scripts/split-e2e-tests.ts
17-
* - amplify-codegen/packages/amplify-codegen-e2e-tests/src/cleanup-e2e-resources.ts
1824
*/
1925
const SUPPORTED_REGIONS_PATH: string = join(REPO_ROOT, 'scripts', 'e2e-test-regions.json');
2026
const AWS_REGIONS_TO_RUN_TESTS: string[] = JSON.parse(fs.readFileSync(SUPPORTED_REGIONS_PATH, 'utf-8')).map(region => region.name);

scripts/split-e2e-tests.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,16 @@ const DEBUG_FLAG = '--debug';
2323
* Supported regions:
2424
* - All Amplify regions, as reported https://docs.aws.amazon.com/general/latest/gr/amplify.html
2525
*
26-
* NOTE: The list of supported regions must be kept in sync amongst all of:
26+
* NOTE:
27+
* - 'ap-east-1' is not included in the list due to known discrepancy in Amplify CLI 'configure' command dropdown and supported regions
28+
* - Since 'ap-east-1' is not available via 'amplify configure', test $CLI_REGION with 'ap-east-1' will run in 'us-east-1'
29+
* and fail Amplify profile assertion in test setup phase
30+
*
31+
* The list of supported regions must be kept in sync amongst all of:
32+
* - Amplify CLI 'amplify configure' command regions dropdown
2733
* - the internal pipeline that publishes new lambda layer versions
34+
* - amplify-codegen/scripts/e2e-test-regions.json
2835
* - amplify-codegen/scripts/split-canary-tests.ts
29-
* - amplify-codegen/packages/amplify-codegen-e2e-tests/src/cleanup-e2e-resources.ts
3036
*/
3137
const SUPPORTED_REGIONS_PATH: string = join(REPO_ROOT, 'scripts', 'e2e-test-regions.json');
3238
const AWS_REGIONS_TO_RUN_TESTS: string[] = JSON.parse(fs.readFileSync(SUPPORTED_REGIONS_PATH, 'utf-8')).map(region => region.name);

0 commit comments

Comments
 (0)