From 9ef9636257072ca893d8f5c30e5c5be1d198d411 Mon Sep 17 00:00:00 2001 From: Eddy Varela Date: Wed, 12 Apr 2023 11:05:59 -0400 Subject: [PATCH 01/69] chore: bump memory size --- codebuild_specs/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codebuild_specs/test.yml b/codebuild_specs/test.yml index 00a2eec803a..8d62fd0c6ab 100644 --- a/codebuild_specs/test.yml +++ b/codebuild_specs/test.yml @@ -2,7 +2,7 @@ version: 0.2 env: shell: bash variables: - NODE_OPTIONS: --max-old-space-size=14000 + NODE_OPTIONS: --max-old-space-size=15000 phases: build: commands: From 3a3c25b1491f8efca413b4152704339a7f50f5e4 Mon Sep 17 00:00:00 2001 From: Eddy Varela Date: Wed, 12 Apr 2023 11:41:06 -0400 Subject: [PATCH 02/69] chore: testing heap size --- codebuild_specs/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/codebuild_specs/test.yml b/codebuild_specs/test.yml index 8d62fd0c6ab..e32f53974b4 100644 --- a/codebuild_specs/test.yml +++ b/codebuild_specs/test.yml @@ -7,4 +7,5 @@ phases: build: commands: - codebuild-breakpoint + - node -e "console.log(require('v8').getHeapStatistics().total_available_size / 1024 / 1024)" - source ./shared-scripts.sh && _testLinux From ac53f8ba576242c1d950aed717c76699c714a84e Mon Sep 17 00:00:00 2001 From: Eddy Varela Date: Wed, 12 Apr 2023 12:01:00 -0400 Subject: [PATCH 03/69] Update test.yml --- codebuild_specs/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codebuild_specs/test.yml b/codebuild_specs/test.yml index e32f53974b4..1081f834e1d 100644 --- a/codebuild_specs/test.yml +++ b/codebuild_specs/test.yml @@ -2,7 +2,7 @@ version: 0.2 env: shell: bash variables: - NODE_OPTIONS: --max-old-space-size=15000 + NODE_OPTIONS: --max-old-space-size=12000 phases: build: commands: From 3092c523bdba17881b23969aa3231a001b951cb3 Mon Sep 17 00:00:00 2001 From: Eddy Varela Date: Wed, 12 Apr 2023 12:20:54 -0400 Subject: [PATCH 04/69] Update test.yml --- codebuild_specs/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codebuild_specs/test.yml b/codebuild_specs/test.yml index 1081f834e1d..7dc0a51a7fd 100644 --- a/codebuild_specs/test.yml +++ b/codebuild_specs/test.yml @@ -2,7 +2,7 @@ version: 0.2 env: shell: bash variables: - NODE_OPTIONS: --max-old-space-size=12000 + NODE_OPTIONS: --max-old-space-size=13000 phases: build: commands: From f0533bd19f094a3af1735446d85ac54aaefcfa96 Mon Sep 17 00:00:00 2001 From: Eddy Varela Date: Wed, 12 Apr 2023 12:22:44 -0400 Subject: [PATCH 05/69] adding mock_e2e to pr_workflow --- codebuild_specs/pr_workflow.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/codebuild_specs/pr_workflow.yml b/codebuild_specs/pr_workflow.yml index bffa844977e..aead07aefaf 100644 --- a/codebuild_specs/pr_workflow.yml +++ b/codebuild_specs/pr_workflow.yml @@ -25,16 +25,16 @@ batch: debug-session: true depend-on: - build_linux - # - identifier: mock_e2e_tests - # buildspec: codebuild_specs/mock_e2e_tests.yml - # env: - # compute-type: BUILD_GENERAL1_LARGE - # depend-on: - # - build_linux - # - identifier: validate_cdk_version - # buildspec: codebuild_specs/validate_cdk_version.yml - # depend-on: - # - build_linux + - identifier: mock_e2e_tests + buildspec: codebuild_specs/mock_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_LARGE + depend-on: + - build_linux + - identifier: validate_cdk_version + buildspec: codebuild_specs/validate_cdk_version.yml + depend-on: + - build_linux # - identifier: verify_api_extract # buildspec: codebuild_specs/verify_api_extract.yml # env: From 48a939486dbdaaa08391e519c5d8183030413020 Mon Sep 17 00:00:00 2001 From: Eddy Varela Date: Wed, 12 Apr 2023 12:25:53 -0400 Subject: [PATCH 06/69] Update pr_workflow.yml --- codebuild_specs/pr_workflow.yml | 88 ++++++++++++++++----------------- 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/codebuild_specs/pr_workflow.yml b/codebuild_specs/pr_workflow.yml index aead07aefaf..98c9a107f1f 100644 --- a/codebuild_specs/pr_workflow.yml +++ b/codebuild_specs/pr_workflow.yml @@ -35,47 +35,47 @@ batch: buildspec: codebuild_specs/validate_cdk_version.yml depend-on: - build_linux - # - identifier: verify_api_extract - # buildspec: codebuild_specs/verify_api_extract.yml - # env: - # compute-type: BUILD_GENERAL1_LARGE - # depend-on: - # - build_linux - # - identifier: verify_yarn_lock - # buildspec: codebuild_specs/verify_yarn_lock.yml - # depend-on: - # - build_linux - # - identifier: publish_to_local_registry - # buildspec: codebuild_specs/publish_to_local_registry.yml - # env: - # compute-type: BUILD_GENERAL1_LARGE - # depend-on: - # - build_linux - # - identifier: build_pkg_binaries_arm - # buildspec: codebuild_specs/build_pkg_binaries_arm.yml - # env: - # compute-type: BUILD_GENERAL1_LARGE - # depend-on: - # - publish_to_local_registry - # - identifier: build_pkg_binaries_linux - # buildspec: codebuild_specs/build_pkg_binaries_linux.yml - # env: - # compute-type: BUILD_GENERAL1_LARGE - # depend-on: - # - publish_to_local_registry - # - identifier: build_pkg_binaries_macos - # buildspec: codebuild_specs/build_pkg_binaries_macos.yml - # env: - # compute-type: BUILD_GENERAL1_LARGE - # depend-on: - # - publish_to_local_registry - # - identifier: build_pkg_binaries_win - # buildspec: codebuild_specs/build_pkg_binaries_win.yml - # env: - # compute-type: BUILD_GENERAL1_LARGE - # depend-on: - # - publish_to_local_registry - # - identifier: verify_versions_match - # buildspec: codebuild_specs/verify_versions_match.yml - # depend-on: - # - publish_to_local_registry + - identifier: verify_api_extract + buildspec: codebuild_specs/verify_api_extract.yml + env: + compute-type: BUILD_GENERAL1_LARGE + depend-on: + - build_linux + - identifier: verify_yarn_lock + buildspec: codebuild_specs/verify_yarn_lock.yml + depend-on: + - build_linux + - identifier: publish_to_local_registry + buildspec: codebuild_specs/publish_to_local_registry.yml + env: + compute-type: BUILD_GENERAL1_LARGE + depend-on: + - build_linux + - identifier: build_pkg_binaries_arm + buildspec: codebuild_specs/build_pkg_binaries_arm.yml + env: + compute-type: BUILD_GENERAL1_LARGE + depend-on: + - publish_to_local_registry + - identifier: build_pkg_binaries_linux + buildspec: codebuild_specs/build_pkg_binaries_linux.yml + env: + compute-type: BUILD_GENERAL1_LARGE + depend-on: + - publish_to_local_registry + - identifier: build_pkg_binaries_macos + buildspec: codebuild_specs/build_pkg_binaries_macos.yml + env: + compute-type: BUILD_GENERAL1_LARGE + depend-on: + - publish_to_local_registry + - identifier: build_pkg_binaries_win + buildspec: codebuild_specs/build_pkg_binaries_win.yml + env: + compute-type: BUILD_GENERAL1_LARGE + depend-on: + - publish_to_local_registry + - identifier: verify_versions_match + buildspec: codebuild_specs/verify_versions_match.yml + depend-on: + - publish_to_local_registry From cabd20c80f4b32af38de2ae87db13492eb1febbe Mon Sep 17 00:00:00 2001 From: Eddy Varela Date: Wed, 12 Apr 2023 13:26:31 -0400 Subject: [PATCH 07/69] chore: adding retry options --- codebuild_specs/mock_e2e_tests.yml | 2 +- codebuild_specs/test.yml | 2 +- .../__tests__/provider-utils/awscloudformation/index.test.ts | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/codebuild_specs/mock_e2e_tests.yml b/codebuild_specs/mock_e2e_tests.yml index 5b2d812cb89..f2d7f8e4762 100644 --- a/codebuild_specs/mock_e2e_tests.yml +++ b/codebuild_specs/mock_e2e_tests.yml @@ -3,7 +3,7 @@ env: shell: bash variables: JEST_JUNIT_OUTPUT: 'reports/junit/js-test-results.xml' - NODE_OPTIONS: --max-old-space-size=14000 + NODE_OPTIONS: --max-old-space-size=5120 phases: build: commands: diff --git a/codebuild_specs/test.yml b/codebuild_specs/test.yml index 7dc0a51a7fd..ec1eee2560f 100644 --- a/codebuild_specs/test.yml +++ b/codebuild_specs/test.yml @@ -2,7 +2,7 @@ version: 0.2 env: shell: bash variables: - NODE_OPTIONS: --max-old-space-size=13000 + NODE_OPTIONS: --max-old-space-size=5120 phases: build: commands: diff --git a/packages/amplify-category-function/src/__tests__/provider-utils/awscloudformation/index.test.ts b/packages/amplify-category-function/src/__tests__/provider-utils/awscloudformation/index.test.ts index 2a410148006..b38beb9ee87 100644 --- a/packages/amplify-category-function/src/__tests__/provider-utils/awscloudformation/index.test.ts +++ b/packages/amplify-category-function/src/__tests__/provider-utils/awscloudformation/index.test.ts @@ -31,6 +31,7 @@ jest.mock('../../../provider-utils/awscloudformation/utils/buildFunction', () => })); const buildFunction_mock = buildFunction as jest.MockedFunction; +jest.retryTimes(2); describe('awscloudformation function provider', () => { beforeEach(() => jest.clearAllMocks()); it('opens the correct service console', () => { From 6e6e1c186a02623544dfc3b082bd80d1c5f21a3b Mon Sep 17 00:00:00 2001 From: Eddy Varela Date: Wed, 12 Apr 2023 13:50:15 -0400 Subject: [PATCH 08/69] chore: adding cleanup resources job --- codebuild_specs/cleanup_resources.yml | 2 +- codebuild_specs/integration_test.yml | 2 +- codebuild_specs/pr_workflow.yml | 10 ++++++++-- shared-scripts.sh | 15 +++++++++++++++ 4 files changed, 25 insertions(+), 4 deletions(-) diff --git a/codebuild_specs/cleanup_resources.yml b/codebuild_specs/cleanup_resources.yml index c9249fc7446..b941b6d89ce 100644 --- a/codebuild_specs/cleanup_resources.yml +++ b/codebuild_specs/cleanup_resources.yml @@ -4,4 +4,4 @@ env: phases: build: commands: - - echo cleanup running + - source ./shared-scripts.sh && _cleanupResources diff --git a/codebuild_specs/integration_test.yml b/codebuild_specs/integration_test.yml index d2e6df4b7a0..6aa019ca8cb 100644 --- a/codebuild_specs/integration_test.yml +++ b/codebuild_specs/integration_test.yml @@ -4,4 +4,4 @@ env: phases: build: commands: - - echo integration testing + - source ./shared-scripts.sh && _integrationTests diff --git a/codebuild_specs/pr_workflow.yml b/codebuild_specs/pr_workflow.yml index 98c9a107f1f..bbf3ca8ff6e 100644 --- a/codebuild_specs/pr_workflow.yml +++ b/codebuild_specs/pr_workflow.yml @@ -21,14 +21,14 @@ batch: - identifier: test buildspec: codebuild_specs/test.yml env: - compute-type: BUILD_GENERAL1_LARGE + compute-type: BUILD_GENERAL1_2XLARGE debug-session: true depend-on: - build_linux - identifier: mock_e2e_tests buildspec: codebuild_specs/mock_e2e_tests.yml env: - compute-type: BUILD_GENERAL1_LARGE + compute-type: BUILD_GENERAL1_2XLARGE depend-on: - build_linux - identifier: validate_cdk_version @@ -51,6 +51,12 @@ batch: compute-type: BUILD_GENERAL1_LARGE depend-on: - build_linux + - identifier: cleanup-resources + buildspec: codebuild_specs/cleanup_resources.yml + env: + compute-type: BUILD_GENERAL1_LARGE + depend-on: + - build_linux - identifier: build_pkg_binaries_arm buildspec: codebuild_specs/build_pkg_binaries_arm.yml env: diff --git a/shared-scripts.sh b/shared-scripts.sh index 8cd10e7020e..3b8ea51eac4 100644 --- a/shared-scripts.sh +++ b/shared-scripts.sh @@ -349,3 +349,18 @@ function _runE2ETestsWindows { retry runE2eTest } + +function _integrationTests{ + +} + +function _cleanupResources { + #restore cache + loadCache repo $CODEBUILD_SRC_DIR + loadCache .cache $HOME/.cache + + cd packages/amplify-e2e-tests + yarn clean-e2e-resources + + storeCache $CODEBUILD_SRC_DIR/packages/amplify-e2e-tests/amplify-e2e-reports repo +} From f9723fa813fa8648ef50b94dcb9bf0b76610c8c0 Mon Sep 17 00:00:00 2001 From: Eddy Varela Date: Wed, 12 Apr 2023 13:56:43 -0400 Subject: [PATCH 09/69] fix: file name is incorrect --- codebuild_specs/pr_workflow.yml | 8 +++++++- shared-scripts.sh | 6 +++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/codebuild_specs/pr_workflow.yml b/codebuild_specs/pr_workflow.yml index bbf3ca8ff6e..239a5179939 100644 --- a/codebuild_specs/pr_workflow.yml +++ b/codebuild_specs/pr_workflow.yml @@ -51,7 +51,13 @@ batch: compute-type: BUILD_GENERAL1_LARGE depend-on: - build_linux - - identifier: cleanup-resources + - identifier: integration_tests + buildspec: codebuild_specs/integration_test.yml + env: + compute-type: BUILD_GENERAL1_LARGE + depend-on: + - build_linux + - identifier: cleanup_resources buildspec: codebuild_specs/cleanup_resources.yml env: compute-type: BUILD_GENERAL1_LARGE diff --git a/shared-scripts.sh b/shared-scripts.sh index 3b8ea51eac4..6c75ae65538 100644 --- a/shared-scripts.sh +++ b/shared-scripts.sh @@ -350,8 +350,12 @@ function _runE2ETestsWindows { retry runE2eTest } -function _integrationTests{ +function _integrationTests { + #restore cache + loadCache repo $CODEBUILD_SRC_DIR + loadCache .cache $HOME/.cache + echo integration testing not implemented yet... } function _cleanupResources { From 10e19840eb8a08084879d8e8dce48d466aa91671 Mon Sep 17 00:00:00 2001 From: Eddy Varela Date: Wed, 12 Apr 2023 14:14:56 -0400 Subject: [PATCH 10/69] chore: test retry mechanism --- codebuild_specs/pr_workflow.yml | 134 +++++++++--------- .../utils/loadFunctionParameters.test.ts | 5 +- shared-scripts.sh | 6 +- 3 files changed, 74 insertions(+), 71 deletions(-) diff --git a/codebuild_specs/pr_workflow.yml b/codebuild_specs/pr_workflow.yml index 239a5179939..b4989bc2c81 100644 --- a/codebuild_specs/pr_workflow.yml +++ b/codebuild_specs/pr_workflow.yml @@ -22,72 +22,72 @@ batch: buildspec: codebuild_specs/test.yml env: compute-type: BUILD_GENERAL1_2XLARGE - debug-session: true depend-on: - build_linux - - identifier: mock_e2e_tests - buildspec: codebuild_specs/mock_e2e_tests.yml - env: - compute-type: BUILD_GENERAL1_2XLARGE - depend-on: - - build_linux - - identifier: validate_cdk_version - buildspec: codebuild_specs/validate_cdk_version.yml - depend-on: - - build_linux - - identifier: verify_api_extract - buildspec: codebuild_specs/verify_api_extract.yml - env: - compute-type: BUILD_GENERAL1_LARGE - depend-on: - - build_linux - - identifier: verify_yarn_lock - buildspec: codebuild_specs/verify_yarn_lock.yml - depend-on: - - build_linux - - identifier: publish_to_local_registry - buildspec: codebuild_specs/publish_to_local_registry.yml - env: - compute-type: BUILD_GENERAL1_LARGE - depend-on: - - build_linux - - identifier: integration_tests - buildspec: codebuild_specs/integration_test.yml - env: - compute-type: BUILD_GENERAL1_LARGE - depend-on: - - build_linux - - identifier: cleanup_resources - buildspec: codebuild_specs/cleanup_resources.yml - env: - compute-type: BUILD_GENERAL1_LARGE - depend-on: - - build_linux - - identifier: build_pkg_binaries_arm - buildspec: codebuild_specs/build_pkg_binaries_arm.yml - env: - compute-type: BUILD_GENERAL1_LARGE - depend-on: - - publish_to_local_registry - - identifier: build_pkg_binaries_linux - buildspec: codebuild_specs/build_pkg_binaries_linux.yml - env: - compute-type: BUILD_GENERAL1_LARGE - depend-on: - - publish_to_local_registry - - identifier: build_pkg_binaries_macos - buildspec: codebuild_specs/build_pkg_binaries_macos.yml - env: - compute-type: BUILD_GENERAL1_LARGE - depend-on: - - publish_to_local_registry - - identifier: build_pkg_binaries_win - buildspec: codebuild_specs/build_pkg_binaries_win.yml - env: - compute-type: BUILD_GENERAL1_LARGE - depend-on: - - publish_to_local_registry - - identifier: verify_versions_match - buildspec: codebuild_specs/verify_versions_match.yml - depend-on: - - publish_to_local_registry + # - identifier: mock_e2e_tests + # buildspec: codebuild_specs/mock_e2e_tests.yml + # env: + # compute-type: BUILD_GENERAL1_2XLARGE + # depend-on: + # - build_linux + # - identifier: validate_cdk_version + # buildspec: codebuild_specs/validate_cdk_version.yml + # depend-on: + # - build_linux + # - identifier: verify_api_extract + # buildspec: codebuild_specs/verify_api_extract.yml + # env: + # compute-type: BUILD_GENERAL1_LARGE + # depend-on: + # - build_linux + # - identifier: verify_yarn_lock + # buildspec: codebuild_specs/verify_yarn_lock.yml + # depend-on: + # - build_linux + # - identifier: publish_to_local_registry + # buildspec: codebuild_specs/publish_to_local_registry.yml + # env: + # compute-type: BUILD_GENERAL1_LARGE + # depend-on: + # - build_linux + # - identifier: integration_tests + # buildspec: codebuild_specs/integration_test.yml + # env: + # compute-type: BUILD_GENERAL1_LARGE + # debug-session: true + # depend-on: + # - build_linux + # - identifier: cleanup_resources + # buildspec: codebuild_specs/cleanup_resources.yml + # env: + # compute-type: BUILD_GENERAL1_LARGE + # depend-on: + # - build_linux + # - identifier: build_pkg_binaries_arm + # buildspec: codebuild_specs/build_pkg_binaries_arm.yml + # env: + # compute-type: BUILD_GENERAL1_LARGE + # depend-on: + # - publish_to_local_registry + # - identifier: build_pkg_binaries_linux + # buildspec: codebuild_specs/build_pkg_binaries_linux.yml + # env: + # compute-type: BUILD_GENERAL1_LARGE + # depend-on: + # - publish_to_local_registry + # - identifier: build_pkg_binaries_macos + # buildspec: codebuild_specs/build_pkg_binaries_macos.yml + # env: + # compute-type: BUILD_GENERAL1_LARGE + # depend-on: + # - publish_to_local_registry + # - identifier: build_pkg_binaries_win + # buildspec: codebuild_specs/build_pkg_binaries_win.yml + # env: + # compute-type: BUILD_GENERAL1_LARGE + # depend-on: + # - publish_to_local_registry + # - identifier: verify_versions_match + # buildspec: codebuild_specs/verify_versions_match.yml + # depend-on: + # - publish_to_local_registry diff --git a/packages/amplify-category-function/src/__tests__/provider-utils/awscloudformation/utils/loadFunctionParameters.test.ts b/packages/amplify-category-function/src/__tests__/provider-utils/awscloudformation/utils/loadFunctionParameters.test.ts index 3cb12a86483..922c75132b7 100644 --- a/packages/amplify-category-function/src/__tests__/provider-utils/awscloudformation/utils/loadFunctionParameters.test.ts +++ b/packages/amplify-category-function/src/__tests__/provider-utils/awscloudformation/utils/loadFunctionParameters.test.ts @@ -1,4 +1,4 @@ -import { JSONUtilities } from '@aws-amplify/amplify-cli-core'; +import { JSONUtilities, isCI } from '@aws-amplify/amplify-cli-core'; import { loadFunctionParameters } from '../../../../provider-utils/awscloudformation/utils/loadFunctionParameters'; jest.mock('@aws-amplify/amplify-cli-core', () => ({ @@ -35,6 +35,9 @@ describe('load function parameters', () => { }, }; + if (isCI()) { + jest.retryTimes(2); + } it('destructures mutableParametersState if it exists', () => { JSONUtilities_mock.readJson.mockImplementationOnce( jest.fn(() => ({ ...funcParamsBase, ...permissionsBase, ...mutableParametersStub })), diff --git a/shared-scripts.sh b/shared-scripts.sh index 6c75ae65538..207c4c93c1e 100644 --- a/shared-scripts.sh +++ b/shared-scripts.sh @@ -82,9 +82,6 @@ function _loadTestAccountCredentials { export AWS_SESSION_TOKEN=$(echo $creds | jq -c -r ".Credentials.SessionToken") } - - - function _setShell { echo Setting Shell yarn config set script-shell $(which bash) @@ -355,6 +352,9 @@ function _integrationTests { loadCache repo $CODEBUILD_SRC_DIR loadCache .cache $HOME/.cache + # make file executable + cd .circleci/ && chmod +x aws.sh + echo integration testing not implemented yet... } From 3b5ca8bd764dddb78bd78e3d3aedbf3f30c40c90 Mon Sep 17 00:00:00 2001 From: Eddy Varela Date: Wed, 12 Apr 2023 14:26:49 -0400 Subject: [PATCH 11/69] chore: bump up memory size for mock_e2e --- codebuild_specs/pr_workflow.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/codebuild_specs/pr_workflow.yml b/codebuild_specs/pr_workflow.yml index b4989bc2c81..fbe186eb4b5 100644 --- a/codebuild_specs/pr_workflow.yml +++ b/codebuild_specs/pr_workflow.yml @@ -24,12 +24,12 @@ batch: compute-type: BUILD_GENERAL1_2XLARGE depend-on: - build_linux - # - identifier: mock_e2e_tests - # buildspec: codebuild_specs/mock_e2e_tests.yml - # env: - # compute-type: BUILD_GENERAL1_2XLARGE - # depend-on: - # - build_linux + - identifier: mock_e2e_tests + buildspec: codebuild_specs/mock_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_2XLARGE + depend-on: + - build_linux # - identifier: validate_cdk_version # buildspec: codebuild_specs/validate_cdk_version.yml # depend-on: From 529454a02c4e2c4251ef823c52990515e88381f0 Mon Sep 17 00:00:00 2001 From: Eddy Varela Date: Wed, 12 Apr 2023 14:45:51 -0400 Subject: [PATCH 12/69] making debuggable --- codebuild_specs/pr_workflow.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/codebuild_specs/pr_workflow.yml b/codebuild_specs/pr_workflow.yml index fbe186eb4b5..02c3dca7ca0 100644 --- a/codebuild_specs/pr_workflow.yml +++ b/codebuild_specs/pr_workflow.yml @@ -22,6 +22,7 @@ batch: buildspec: codebuild_specs/test.yml env: compute-type: BUILD_GENERAL1_2XLARGE + debug-session: true depend-on: - build_linux - identifier: mock_e2e_tests From 6f98ad7fdffd4c362e7a7b1d50acc5841f00d64b Mon Sep 17 00:00:00 2001 From: Eddy Varela Date: Wed, 12 Apr 2023 16:32:15 -0400 Subject: [PATCH 13/69] Create build_image.yml --- codebuild_specs/build_image.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 codebuild_specs/build_image.yml diff --git a/codebuild_specs/build_image.yml b/codebuild_specs/build_image.yml new file mode 100644 index 00000000000..49814cf7799 --- /dev/null +++ b/codebuild_specs/build_image.yml @@ -0,0 +1,18 @@ +version: 0.2 + +phases: + pre_build: + commands: + - echo Logging in to Amazon ECR... + - aws ecr get-login-password --region $AWS_DEFAULT_REGION | docker login --username AWS --password-stdin $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com + build: + commands: + - echo Build started on `date` + - echo Building the Docker image... + - docker build -t $IMAGE_REPO_NAME:$IMAGE_TAG . + - docker tag $IMAGE_REPO_NAME:$IMAGE_TAG $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/$IMAGE_REPO_NAME:$IMAGE_TAG + post_build: + commands: + - echo Build completed on `date` + - echo Pushing the Docker image... + - docker push $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/$IMAGE_REPO_NAME:$IMAGE_TAG From d39f134b7425e8596acc801a79f94fc1ae1dd8cd Mon Sep 17 00:00:00 2001 From: Eddy Varela Date: Wed, 12 Apr 2023 16:33:22 -0400 Subject: [PATCH 14/69] Update build_image.yml --- codebuild_specs/build_image.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/codebuild_specs/build_image.yml b/codebuild_specs/build_image.yml index 49814cf7799..d46b867a98f 100644 --- a/codebuild_specs/build_image.yml +++ b/codebuild_specs/build_image.yml @@ -1,5 +1,5 @@ -version: 0.2 +version: 0.2 phases: pre_build: commands: @@ -7,9 +7,18 @@ phases: - aws ecr get-login-password --region $AWS_DEFAULT_REGION | docker login --username AWS --password-stdin $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com build: commands: + - export BRANCH_TAG=${CODEBUILD_WEBHOOK_TRIGGER#branch/codebuild-image/*} + - export IMAGE_TAG=${CUSTOM_TAG:=$BRANCH_TAG} + - echo $IMAGE_TAG + - echo $PKG_BINARY_CACHE_BUCKET_NAME + - mkdir pkg-cache + - aws s3 sync s3://$PKG_BINARY_CACHE_BUCKET_NAME pkg-cache + - /bin/bash ./rename_to_fetched.sh + - ls pkg-cache/* - echo Build started on `date` - echo Building the Docker image... - - docker build -t $IMAGE_REPO_NAME:$IMAGE_TAG . + - echo $CODEBUILD_SRC_DIR + - docker build --tag $IMAGE_REPO_NAME:$IMAGE_TAG . - docker tag $IMAGE_REPO_NAME:$IMAGE_TAG $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/$IMAGE_REPO_NAME:$IMAGE_TAG post_build: commands: From 3441e79bf502e6068eace8b93c988c7367d476ba Mon Sep 17 00:00:00 2001 From: Eddy Varela Date: Wed, 12 Apr 2023 16:44:18 -0400 Subject: [PATCH 15/69] Update build_image.yml --- codebuild_specs/build_image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codebuild_specs/build_image.yml b/codebuild_specs/build_image.yml index d46b867a98f..52e3ae81bae 100644 --- a/codebuild_specs/build_image.yml +++ b/codebuild_specs/build_image.yml @@ -8,7 +8,7 @@ phases: build: commands: - export BRANCH_TAG=${CODEBUILD_WEBHOOK_TRIGGER#branch/codebuild-image/*} - - export IMAGE_TAG=${CUSTOM_TAG:=$BRANCH_TAG} + - export IMAGE_TAG=latest - echo $IMAGE_TAG - echo $PKG_BINARY_CACHE_BUCKET_NAME - mkdir pkg-cache From 28960151c90b9dce11da98944adbdc60ad606ce4 Mon Sep 17 00:00:00 2001 From: Eddy Varela Date: Thu, 13 Apr 2023 12:19:43 -0400 Subject: [PATCH 16/69] Update test.yml --- codebuild_specs/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codebuild_specs/test.yml b/codebuild_specs/test.yml index ec1eee2560f..1081f834e1d 100644 --- a/codebuild_specs/test.yml +++ b/codebuild_specs/test.yml @@ -2,7 +2,7 @@ version: 0.2 env: shell: bash variables: - NODE_OPTIONS: --max-old-space-size=5120 + NODE_OPTIONS: --max-old-space-size=12000 phases: build: commands: From 879a487bbb434f6e6b5cb506c511431432e54a6a Mon Sep 17 00:00:00 2001 From: Eddy Varela Date: Thu, 13 Apr 2023 12:32:06 -0400 Subject: [PATCH 17/69] Update pr_workflow.yml --- codebuild_specs/pr_workflow.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/codebuild_specs/pr_workflow.yml b/codebuild_specs/pr_workflow.yml index 02c3dca7ca0..eb50a0710d7 100644 --- a/codebuild_specs/pr_workflow.yml +++ b/codebuild_specs/pr_workflow.yml @@ -25,12 +25,12 @@ batch: debug-session: true depend-on: - build_linux - - identifier: mock_e2e_tests - buildspec: codebuild_specs/mock_e2e_tests.yml - env: - compute-type: BUILD_GENERAL1_2XLARGE - depend-on: - - build_linux +# - identifier: mock_e2e_tests +# buildspec: codebuild_specs/mock_e2e_tests.yml +# env: +# compute-type: BUILD_GENERAL1_2XLARGE +# depend-on: +# - build_linux # - identifier: validate_cdk_version # buildspec: codebuild_specs/validate_cdk_version.yml # depend-on: From 6714d4e90cfc8db112117fc4cc565d3ed67418b6 Mon Sep 17 00:00:00 2001 From: Eddy Varela Date: Thu, 13 Apr 2023 12:33:07 -0400 Subject: [PATCH 18/69] Update pr_workflow.yml --- codebuild_specs/pr_workflow.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/codebuild_specs/pr_workflow.yml b/codebuild_specs/pr_workflow.yml index eb50a0710d7..e6249bf1250 100644 --- a/codebuild_specs/pr_workflow.yml +++ b/codebuild_specs/pr_workflow.yml @@ -92,3 +92,4 @@ batch: # buildspec: codebuild_specs/verify_versions_match.yml # depend-on: # - publish_to_local_registry + From c1a8f2f4a3de7aab21256588d0d466f3dc20963c Mon Sep 17 00:00:00 2001 From: Eddy Varela Date: Thu, 13 Apr 2023 12:55:17 -0400 Subject: [PATCH 19/69] Update pr_workflow.yml --- codebuild_specs/pr_workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codebuild_specs/pr_workflow.yml b/codebuild_specs/pr_workflow.yml index e6249bf1250..34f4a96b0bd 100644 --- a/codebuild_specs/pr_workflow.yml +++ b/codebuild_specs/pr_workflow.yml @@ -21,7 +21,7 @@ batch: - identifier: test buildspec: codebuild_specs/test.yml env: - compute-type: BUILD_GENERAL1_2XLARGE + compute-type: BUILD_GENERAL1_LARGE debug-session: true depend-on: - build_linux From a21b6045d1404476bd3767573a892accf4c62853 Mon Sep 17 00:00:00 2001 From: Eddy Varela Date: Thu, 13 Apr 2023 13:49:40 -0400 Subject: [PATCH 20/69] chore: remove retries --- .../awscloudformation/utils/loadFunctionParameters.test.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/amplify-category-function/src/__tests__/provider-utils/awscloudformation/utils/loadFunctionParameters.test.ts b/packages/amplify-category-function/src/__tests__/provider-utils/awscloudformation/utils/loadFunctionParameters.test.ts index 922c75132b7..3cb12a86483 100644 --- a/packages/amplify-category-function/src/__tests__/provider-utils/awscloudformation/utils/loadFunctionParameters.test.ts +++ b/packages/amplify-category-function/src/__tests__/provider-utils/awscloudformation/utils/loadFunctionParameters.test.ts @@ -1,4 +1,4 @@ -import { JSONUtilities, isCI } from '@aws-amplify/amplify-cli-core'; +import { JSONUtilities } from '@aws-amplify/amplify-cli-core'; import { loadFunctionParameters } from '../../../../provider-utils/awscloudformation/utils/loadFunctionParameters'; jest.mock('@aws-amplify/amplify-cli-core', () => ({ @@ -35,9 +35,6 @@ describe('load function parameters', () => { }, }; - if (isCI()) { - jest.retryTimes(2); - } it('destructures mutableParametersState if it exists', () => { JSONUtilities_mock.readJson.mockImplementationOnce( jest.fn(() => ({ ...funcParamsBase, ...permissionsBase, ...mutableParametersStub })), From 1269af44c3539cc15ce3e02715b6f135d98ad6b0 Mon Sep 17 00:00:00 2001 From: Eddy Varela Date: Thu, 13 Apr 2023 14:12:10 -0400 Subject: [PATCH 21/69] chore: retry test-ci twice --- shared-scripts.sh | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/shared-scripts.sh b/shared-scripts.sh index 207c4c93c1e..5f4846e5b81 100644 --- a/shared-scripts.sh +++ b/shared-scripts.sh @@ -104,11 +104,36 @@ function _buildWindows { } function _testLinux { echo Run Test - # download [repo, .cache from s3] + MAX_ATTEMPTS=2 + SLEEP_DURATION=5 + FIRST_RUN=true + n=0 + + # download [repo, .cache from s3] loadCache repo $CODEBUILD_SRC_DIR loadCache .cache $HOME/.cache + + until [ $n -ge $MAX_ATTEMPTS ] + do + echo "Attempting $@ with max retries $MAX_ATTEMPTS" + yarn test-ci + echo "Attempt $n completed." + sleep $SLEEP_DURATION + done + if [ $n -ge $MAX_ATTEMPTS ]; then + echo "failed: ${@}" >&2 + exit 1 + fi + + + + + + + + + # run tests - yarn test-ci # echo collecting coverage # yarn coverage } From e22955ddc13e54ed62cfe68d3de4ca2f28488d35 Mon Sep 17 00:00:00 2001 From: Eddy Varela Date: Thu, 13 Apr 2023 14:12:59 -0400 Subject: [PATCH 22/69] chore: adding ability to collect coverage --- shared-scripts.sh | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/shared-scripts.sh b/shared-scripts.sh index 5f4846e5b81..113ac664a51 100644 --- a/shared-scripts.sh +++ b/shared-scripts.sh @@ -124,18 +124,9 @@ function _testLinux { echo "failed: ${@}" >&2 exit 1 fi - - - - - - - - - - # run tests - # echo collecting coverage - # yarn coverage + + echo collecting coverage + yarn coverage } function _validateCDKVersion { echo Validate CDK Version From 5489827d8d57f04ab739f917b99bc7c5962ad64a Mon Sep 17 00:00:00 2001 From: Eddy Varela Date: Thu, 13 Apr 2023 15:28:54 -0400 Subject: [PATCH 23/69] chore: running multiple times --- codebuild_specs/test.yml | 5 ++++- shared-scripts.sh | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/codebuild_specs/test.yml b/codebuild_specs/test.yml index 1081f834e1d..794b0e9eaec 100644 --- a/codebuild_specs/test.yml +++ b/codebuild_specs/test.yml @@ -2,10 +2,13 @@ version: 0.2 env: shell: bash variables: - NODE_OPTIONS: --max-old-space-size=12000 + NODE_OPTIONS: --max-old-space-size=13000 phases: build: commands: - codebuild-breakpoint - node -e "console.log(require('v8').getHeapStatistics().total_available_size / 1024 / 1024)" - source ./shared-scripts.sh && _testLinux + post_build: + commands: + - echo Finished unit testing diff --git a/shared-scripts.sh b/shared-scripts.sh index 113ac664a51..452b31374a1 100644 --- a/shared-scripts.sh +++ b/shared-scripts.sh @@ -116,6 +116,8 @@ function _testLinux { until [ $n -ge $MAX_ATTEMPTS ] do echo "Attempting $@ with max retries $MAX_ATTEMPTS" + "$@" && break + n=$[$n+1] yarn test-ci echo "Attempt $n completed." sleep $SLEEP_DURATION From b2741eb4a6bb634e444bb53386c1c30bceffb472 Mon Sep 17 00:00:00 2001 From: Eddy Varela Date: Wed, 12 Apr 2023 15:13:05 -0400 Subject: [PATCH 24/69] chore: revert compute-type --- codebuild_specs/pr_workflow.yml | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/codebuild_specs/pr_workflow.yml b/codebuild_specs/pr_workflow.yml index 34f4a96b0bd..8ceb7af9cbb 100644 --- a/codebuild_specs/pr_workflow.yml +++ b/codebuild_specs/pr_workflow.yml @@ -25,12 +25,12 @@ batch: debug-session: true depend-on: - build_linux -# - identifier: mock_e2e_tests -# buildspec: codebuild_specs/mock_e2e_tests.yml -# env: -# compute-type: BUILD_GENERAL1_2XLARGE -# depend-on: -# - build_linux + # - identifier: mock_e2e_tests + # buildspec: codebuild_specs/mock_e2e_tests.yml + # env: + # compute-type: BUILD_GENERAL1_LARGE + # depend-on: + # - build_linux # - identifier: validate_cdk_version # buildspec: codebuild_specs/validate_cdk_version.yml # depend-on: @@ -58,12 +58,12 @@ batch: # debug-session: true # depend-on: # - build_linux - # - identifier: cleanup_resources - # buildspec: codebuild_specs/cleanup_resources.yml - # env: - # compute-type: BUILD_GENERAL1_LARGE - # depend-on: - # - build_linux + - identifier: cleanup_resources + buildspec: codebuild_specs/cleanup_resources.yml + env: + compute-type: BUILD_GENERAL1_LARGE + depend-on: + - build_linux # - identifier: build_pkg_binaries_arm # buildspec: codebuild_specs/build_pkg_binaries_arm.yml # env: @@ -92,4 +92,3 @@ batch: # buildspec: codebuild_specs/verify_versions_match.yml # depend-on: # - publish_to_local_registry - From c7044c86eb11ffeac173676f69598096c9bb1bcc Mon Sep 17 00:00:00 2001 From: Eddy Varela Date: Thu, 13 Apr 2023 15:50:45 -0400 Subject: [PATCH 25/69] chore: remove coverage --- shared-scripts.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shared-scripts.sh b/shared-scripts.sh index 452b31374a1..382c3190bf0 100644 --- a/shared-scripts.sh +++ b/shared-scripts.sh @@ -127,8 +127,8 @@ function _testLinux { exit 1 fi - echo collecting coverage - yarn coverage + # echo collecting coverage + # yarn coverage } function _validateCDKVersion { echo Validate CDK Version From f4f2fda14201523e292e78d7d0b4c16fa4f58a68 Mon Sep 17 00:00:00 2001 From: Eddy Varela Date: Thu, 13 Apr 2023 16:22:02 -0400 Subject: [PATCH 26/69] chore: retry unit tests --- codebuild_specs/pr_workflow.yml | 12 +++++------ shared-scripts.sh | 37 +++++++++++++++++---------------- 2 files changed, 25 insertions(+), 24 deletions(-) diff --git a/codebuild_specs/pr_workflow.yml b/codebuild_specs/pr_workflow.yml index 8ceb7af9cbb..866b3533fd1 100644 --- a/codebuild_specs/pr_workflow.yml +++ b/codebuild_specs/pr_workflow.yml @@ -25,12 +25,12 @@ batch: debug-session: true depend-on: - build_linux - # - identifier: mock_e2e_tests - # buildspec: codebuild_specs/mock_e2e_tests.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_LARGE + depend-on: + - build_linux # - identifier: validate_cdk_version # buildspec: codebuild_specs/validate_cdk_version.yml # depend-on: diff --git a/shared-scripts.sh b/shared-scripts.sh index 382c3190bf0..d8d786f5863 100644 --- a/shared-scripts.sh +++ b/shared-scripts.sh @@ -102,30 +102,26 @@ function _buildWindows { storeCache $CODEBUILD_SRC_DIR repo-windows storeCache $HOME/.cache .cache-windows } + +function _unitTests { + FAILED_TEST_REGEX_FILE=./amplify-unit-tests/failed_unit_tests.txt + if [ -f $FAILED_TEST_REGEX_FILE ]; then + # read the content of failed tests + failedTests=$(<$FAILED_TEST_REGEX_FILE) + yarn test-ci --forceExit --no-cache --maxWorkers=4 $TEST_SUITE -t "$failedTests" + else + yarn test-ci --forceExit --no-cache --maxWorkers=4 $TEST_SUITE + fi +} + function _testLinux { echo Run Test - MAX_ATTEMPTS=2 - SLEEP_DURATION=5 - FIRST_RUN=true - n=0 - # download [repo, .cache from s3] + # download [repo, .cache from s3] loadCache repo $CODEBUILD_SRC_DIR loadCache .cache $HOME/.cache - until [ $n -ge $MAX_ATTEMPTS ] - do - echo "Attempting $@ with max retries $MAX_ATTEMPTS" - "$@" && break - n=$[$n+1] - yarn test-ci - echo "Attempt $n completed." - sleep $SLEEP_DURATION - done - if [ $n -ge $MAX_ATTEMPTS ]; then - echo "failed: ${@}" >&2 - exit 1 - fi + retry _unitTests # echo collecting coverage # yarn coverage @@ -180,6 +176,8 @@ function _mockE2ETests { source .circleci/local_publish_helpers.sh cd packages/amplify-util-mock/ + + yarn e2e } function _publishToLocalRegistry { @@ -380,6 +378,9 @@ function _cleanupResources { #restore cache loadCache repo $CODEBUILD_SRC_DIR loadCache .cache $HOME/.cache + + #loading test account credentials + _loadTestAccountCredentials cd packages/amplify-e2e-tests yarn clean-e2e-resources From 03b03a5c1b5578b1fec3bc978db78899d35b450b Mon Sep 17 00:00:00 2001 From: Eddy Varela Date: Fri, 14 Apr 2023 00:46:13 -0400 Subject: [PATCH 27/69] Update build_image.yml --- codebuild_specs/build_image.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/codebuild_specs/build_image.yml b/codebuild_specs/build_image.yml index 52e3ae81bae..7a97648cad6 100644 --- a/codebuild_specs/build_image.yml +++ b/codebuild_specs/build_image.yml @@ -25,3 +25,4 @@ phases: - echo Build completed on `date` - echo Pushing the Docker image... - docker push $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/$IMAGE_REPO_NAME:$IMAGE_TAG + From a8777a46aa962f51d34bb8a6f711a34c2c54d529 Mon Sep 17 00:00:00 2001 From: Eddy Varela Date: Fri, 14 Apr 2023 00:49:30 -0400 Subject: [PATCH 28/69] Update build_image.yml From 6701936f49b4da743884be560bb8c63b651f602d Mon Sep 17 00:00:00 2001 From: Eddy Varela Date: Fri, 14 Apr 2023 01:07:35 -0400 Subject: [PATCH 29/69] Update test.yml --- codebuild_specs/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/codebuild_specs/test.yml b/codebuild_specs/test.yml index 794b0e9eaec..4247407cad3 100644 --- a/codebuild_specs/test.yml +++ b/codebuild_specs/test.yml @@ -8,6 +8,7 @@ phases: commands: - codebuild-breakpoint - node -e "console.log(require('v8').getHeapStatistics().total_available_size / 1024 / 1024)" + - source ./circleci - source ./shared-scripts.sh && _testLinux post_build: commands: From 679eb345e4cb2bbd6eb7174950dbc833cec4cb8b Mon Sep 17 00:00:00 2001 From: Eddy Varela Date: Fri, 14 Apr 2023 01:16:35 -0400 Subject: [PATCH 30/69] chore: fixing cleanup-resources --- codebuild_specs/integration_test.yml | 3 + codebuild_specs/test.yml | 2 +- shared-scripts.sh | 98 ++++++++++++++++++++++++++-- 3 files changed, 96 insertions(+), 7 deletions(-) diff --git a/codebuild_specs/integration_test.yml b/codebuild_specs/integration_test.yml index 6aa019ca8cb..8b5b7fed2f8 100644 --- a/codebuild_specs/integration_test.yml +++ b/codebuild_specs/integration_test.yml @@ -1,6 +1,9 @@ version: 0.2 env: shell: bash + variables: + - AUTH_CLONE_URL: Ref to Secrets manager #TODO + - API_CLONE_URL: Ref to secrets manager #TODO phases: build: commands: diff --git a/codebuild_specs/test.yml b/codebuild_specs/test.yml index 4247407cad3..58b44d23d3a 100644 --- a/codebuild_specs/test.yml +++ b/codebuild_specs/test.yml @@ -11,5 +11,5 @@ phases: - source ./circleci - source ./shared-scripts.sh && _testLinux post_build: - commands: + commands: - echo Finished unit testing diff --git a/shared-scripts.sh b/shared-scripts.sh index d8d786f5863..d71119cf67e 100644 --- a/shared-scripts.sh +++ b/shared-scripts.sh @@ -70,6 +70,9 @@ function loadCacheFile { } function _loadTestAccountCredentials { echo ASSUMING PARENT TEST ACCOUNT credentials + echo $TEST_ACCOUNT_ROLE + echo $RANDOM + session_id=$((1 + $RANDOM % 10000)) creds=$(aws sts assume-role --role-arn $TEST_ACCOUNT_ROLE --role-session-name testSession${session_id} --duration-seconds 3600) if [ -z $(echo $creds | jq -c -r '.AssumedRoleUser.Arn') ]; then @@ -81,7 +84,6 @@ function _loadTestAccountCredentials { export AWS_SECRET_ACCESS_KEY=$(echo $creds | jq -c -r ".Credentials.SecretAccessKey") export AWS_SESSION_TOKEN=$(echo $creds | jq -c -r ".Credentials.SessionToken") } - function _setShell { echo Setting Shell yarn config set script-shell $(which bash) @@ -102,7 +104,6 @@ function _buildWindows { storeCache $CODEBUILD_SRC_DIR repo-windows storeCache $HOME/.cache .cache-windows } - function _unitTests { FAILED_TEST_REGEX_FILE=./amplify-unit-tests/failed_unit_tests.txt if [ -f $FAILED_TEST_REGEX_FILE ]; then @@ -113,10 +114,11 @@ function _unitTests { yarn test-ci --forceExit --no-cache --maxWorkers=4 $TEST_SUITE fi } - function _testLinux { echo Run Test + source .circleci/local_publish_helpers.sh + # download [repo, .cache from s3] loadCache repo $CODEBUILD_SRC_DIR loadCache .cache $HOME/.cache @@ -177,7 +179,6 @@ function _mockE2ETests { source .circleci/local_publish_helpers.sh cd packages/amplify-util-mock/ - yarn e2e } function _publishToLocalRegistry { @@ -362,7 +363,6 @@ function _runE2ETestsWindows { retry runE2eTest } - function _integrationTests { #restore cache loadCache repo $CODEBUILD_SRC_DIR @@ -371,9 +371,95 @@ function _integrationTests { # make file executable cd .circleci/ && chmod +x aws.sh + #setting up dependencies + apt-get update + apt-get install -y sudo + sudo apt-get install -y tcl + sudo apt-get install -y expect + sudo apt-get install -y zip + sudo apt-get install -y lsof + sudo apt-get install -y python python-pip libpython-dev + sudo apt-get install -y jq + pip install awscli + + # don't know what this does + expect .circleci/aws_configure.exp + + # configuring Amplify CLI + yarn rm-dev-link && yarn link-dev && yarn rm-aa-dev-link && yarn link-aa-dev + echo 'export PATH="$(yarn global bin):$PATH"' >> $BASH_ENV + amplify-dev + + # cloning auth test package + cd .. + git clone $AUTH_CLONE_URL + cd aws-amplify-cypress-auth + yarn --cache-folder ~/.cache/yarn + yarn add cypress@6.8.0 --save + + cd .circleci/ && chmod +x auth.sh && chmod +x amplify_init.sh && chmod +x amplify_init.exp + expect .circleci/amplify_init.exp ../aws-amplify-cypress-auth + expect .circleci/enable_auth.exp + cd ../aws-amplify-cypress-auth + yarn --frozen-lockfile --cache-folder ~/.cache/yarn + cd ../aws-amplify-cypress-auth/src && cat $(find . -type f -name 'aws-exports*') + + # Start auth test server in the background + cd ../aws-amplify-cypress-auth + pwd + yarn start + + # Run cypress test for auth + cd ../aws-amplify-cypress-auth + cp ../repo/cypress.json . + cp -R ../repo/cypress . + yarn cypress run --spec $(find . -type f -name 'auth_spec*') + + # cleanup scripts + sudo kill -9 $(lsof -t -i:3000) + cd .circleci/ && chmod +x delete_auth.sh + expect .circleci/delete_auth.exp + + # clone API Test Package + cd .. + git clone $API_CLONE_URL #TODO: Define this + cd aws-amplify-cypress-api + yarn --cache-folder ~/.cache/yarn + + cd .circleci/ && chmod +x api.sh + expect .circleci/amplify_init.exp ../aws-amplify-cypress-api + expect .circleci/enable_api.exp + cd ../aws-amplify-cypress-api + yarn --frozen-lockfile --cache-folder ~/.cache/yarn + cd ../aws-amplify-cypress-api/src && cat $(find . -type f -name 'aws-exports*') + + # Start API test server in background + cd ../aws-amplify-cypress-api + pwd + yarn start + + # Run cypress tests for API + cd ../aws-amplify-cypress-api + yarn add cypress@6.8.0 --save + cp ../repo/cypress.json . + cp -R ../repo/cypress . + yarn cypress run --spec $(find . -type f -name 'api_spec*') + + cd .circleci/ && chmod +x delete_api.sh + expect .circleci/delete_api.exp + + _scanE2eTestArtifacts + + # storing in cache for auth tests + storeCache $HOME/aws-amplify-cypress-auth/cypress/videos ~/aws-amplify-cypress-auth/cypress/videos + storeCache $HOME/aws-amplify-cypress-auth/cypress/screenshots ~/aws-amplify-cypress-auth/cypress/screenshots + + # storing in cache for api tests + storeCache $HOME/aws-amplify-cypress-api/cypress/videos ~aws-amplify-cypress-api/cypress/videos + storeCache $HOME/aws-amplify-cypress-api/cypress/screenshots ~aws-amplify-cypress-api/cypress/screenshots + echo integration testing not implemented yet... } - function _cleanupResources { #restore cache loadCache repo $CODEBUILD_SRC_DIR From 5ed97addd7563c4653b5342f40ac1df6c33960f6 Mon Sep 17 00:00:00 2001 From: Eddy Varela Date: Fri, 14 Apr 2023 01:49:20 -0400 Subject: [PATCH 31/69] chore: remove a problematic line --- .circleci/local_publish_helpers.sh | 2 +- codebuild_specs/test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/local_publish_helpers.sh b/.circleci/local_publish_helpers.sh index 51719408dae..b9f79a9eb5b 100644 --- a/.circleci/local_publish_helpers.sh +++ b/.circleci/local_publish_helpers.sh @@ -255,7 +255,7 @@ function setAwsAccountCredentials { export AWS_SECRET_ACCESS_KEY_ORIG=$AWS_SECRET_ACCESS_KEY export AWS_SESSION_TOKEN_ORIG=$AWS_SESSION_TOKEN # introduce a delay of up to 1 minute to allow for more even spread aws list-accounts calls due to throttling - sleep $[ ( $RANDOM % 60 ) + 1 ]s + # sleep $ ( $RANDOM % 60 ) + 1 ]s if [[ "$OSTYPE" == "msys" ]]; then # windows provided by circleci has this OSTYPE useChildAccountCredentials diff --git a/codebuild_specs/test.yml b/codebuild_specs/test.yml index 58b44d23d3a..99f4b6218d5 100644 --- a/codebuild_specs/test.yml +++ b/codebuild_specs/test.yml @@ -8,7 +8,7 @@ phases: commands: - codebuild-breakpoint - node -e "console.log(require('v8').getHeapStatistics().total_available_size / 1024 / 1024)" - - source ./circleci + - source .circleci/local_publish_helpers.sh - source ./shared-scripts.sh && _testLinux post_build: commands: From b2a80767bf712c5d14a994016ece00c3b75dd6ed Mon Sep 17 00:00:00 2001 From: Eddy Varela Date: Fri, 14 Apr 2023 02:10:11 -0400 Subject: [PATCH 32/69] chore: try to run unit test twice back to back --- shared-scripts.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/shared-scripts.sh b/shared-scripts.sh index d71119cf67e..f9b5c1101e8 100644 --- a/shared-scripts.sh +++ b/shared-scripts.sh @@ -72,7 +72,7 @@ function _loadTestAccountCredentials { echo ASSUMING PARENT TEST ACCOUNT credentials echo $TEST_ACCOUNT_ROLE echo $RANDOM - + session_id=$((1 + $RANDOM % 10000)) creds=$(aws sts assume-role --role-arn $TEST_ACCOUNT_ROLE --role-session-name testSession${session_id} --duration-seconds 3600) if [ -z $(echo $creds | jq -c -r '.AssumedRoleUser.Arn') ]; then @@ -117,13 +117,12 @@ function _unitTests { function _testLinux { echo Run Test - source .circleci/local_publish_helpers.sh - # download [repo, .cache from s3] loadCache repo $CODEBUILD_SRC_DIR loadCache .cache $HOME/.cache - retry _unitTests + yarn test-ci + yarn test-ci # echo collecting coverage # yarn coverage From d9116cd1413174a3627463504abe9a0c59aa0a92 Mon Sep 17 00:00:00 2001 From: Eddy Varela Date: Fri, 14 Apr 2023 13:28:52 -0400 Subject: [PATCH 33/69] chore: adding debugger to mockE2e tests --- codebuild_specs/pr_workflow.yml | 15 ++++++++------- shared-scripts.sh | 5 +++-- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/codebuild_specs/pr_workflow.yml b/codebuild_specs/pr_workflow.yml index 866b3533fd1..161430141b5 100644 --- a/codebuild_specs/pr_workflow.yml +++ b/codebuild_specs/pr_workflow.yml @@ -18,17 +18,18 @@ batch: buildspec: codebuild_specs/build_linux.yml env: compute-type: BUILD_GENERAL1_LARGE - - identifier: test - buildspec: codebuild_specs/test.yml - env: - compute-type: BUILD_GENERAL1_LARGE - debug-session: true - depend-on: - - build_linux + # - identifier: test + # buildspec: codebuild_specs/test.yml + # env: + # compute-type: BUILD_GENERAL1_LARGE + # debug-session: true + # depend-on: + # - build_linux - identifier: mock_e2e_tests buildspec: codebuild_specs/mock_e2e_tests.yml env: compute-type: BUILD_GENERAL1_LARGE + debug-session: true depend-on: - build_linux # - identifier: validate_cdk_version diff --git a/shared-scripts.sh b/shared-scripts.sh index f9b5c1101e8..99a81891d80 100644 --- a/shared-scripts.sh +++ b/shared-scripts.sh @@ -122,8 +122,7 @@ function _testLinux { loadCache .cache $HOME/.cache yarn test-ci - yarn test-ci - + # echo collecting coverage # yarn coverage } @@ -175,6 +174,8 @@ function _mockE2ETests { loadCache repo $CODEBUILD_SRC_DIR loadCache .cache $HOME/.cache + sudo apt-get -y install lsof + source .circleci/local_publish_helpers.sh cd packages/amplify-util-mock/ From 00b34cbe3b365883f0c5858be83c231e80906af6 Mon Sep 17 00:00:00 2001 From: Eddy Varela Date: Fri, 14 Apr 2023 13:33:48 -0400 Subject: [PATCH 34/69] chore: add breakpoint --- codebuild_specs/mock_e2e_tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/codebuild_specs/mock_e2e_tests.yml b/codebuild_specs/mock_e2e_tests.yml index f2d7f8e4762..fd1859594e0 100644 --- a/codebuild_specs/mock_e2e_tests.yml +++ b/codebuild_specs/mock_e2e_tests.yml @@ -7,4 +7,5 @@ env: phases: build: commands: + - codebuild-breakpoint - source ./shared-scripts.sh && _mockE2ETests From f3dfb4bdb7cb2ff6169b58161caadce8f28742f0 Mon Sep 17 00:00:00 2001 From: Eddy Varela Date: Sat, 15 Apr 2023 11:18:03 -0400 Subject: [PATCH 35/69] Update pr_workflow.yml --- codebuild_specs/pr_workflow.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/codebuild_specs/pr_workflow.yml b/codebuild_specs/pr_workflow.yml index 161430141b5..0b9dd028305 100644 --- a/codebuild_specs/pr_workflow.yml +++ b/codebuild_specs/pr_workflow.yml @@ -93,3 +93,4 @@ batch: # buildspec: codebuild_specs/verify_versions_match.yml # depend-on: # - publish_to_local_registry + From de5c301b78355e45141c6abac939389c874b153e Mon Sep 17 00:00:00 2001 From: Eddy Varela Date: Sat, 15 Apr 2023 11:53:02 -0400 Subject: [PATCH 36/69] Update pr_workflow.yml --- codebuild_specs/pr_workflow.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/codebuild_specs/pr_workflow.yml b/codebuild_specs/pr_workflow.yml index 0b9dd028305..8881c3e20b3 100644 --- a/codebuild_specs/pr_workflow.yml +++ b/codebuild_specs/pr_workflow.yml @@ -18,13 +18,13 @@ batch: buildspec: codebuild_specs/build_linux.yml env: compute-type: BUILD_GENERAL1_LARGE - # - identifier: test - # buildspec: codebuild_specs/test.yml - # env: - # compute-type: BUILD_GENERAL1_LARGE - # debug-session: true - # depend-on: - # - build_linux + - identifier: test + buildspec: codebuild_specs/test.yml + env: + compute-type: BUILD_GENERAL1_LARGE + debug-session: true + depend-on: + - build_linux - identifier: mock_e2e_tests buildspec: codebuild_specs/mock_e2e_tests.yml env: From 2be85afefbd4a13a7f0bb60720e341651adf1bb6 Mon Sep 17 00:00:00 2001 From: Eddy Varela Date: Tue, 18 Apr 2023 02:23:30 -0400 Subject: [PATCH 37/69] chore: break up test due to memory issues --- codebuild_specs/pr_workflow.yml | 27 +++++++++++++-------------- package.json | 3 ++- shared-scripts.sh | 6 ++++-- 3 files changed, 19 insertions(+), 17 deletions(-) diff --git a/codebuild_specs/pr_workflow.yml b/codebuild_specs/pr_workflow.yml index 8881c3e20b3..0bf221a5605 100644 --- a/codebuild_specs/pr_workflow.yml +++ b/codebuild_specs/pr_workflow.yml @@ -25,13 +25,13 @@ batch: debug-session: true depend-on: - build_linux - - identifier: mock_e2e_tests - buildspec: codebuild_specs/mock_e2e_tests.yml - env: - compute-type: BUILD_GENERAL1_LARGE - debug-session: true - depend-on: - - build_linux + # - identifier: mock_e2e_tests + # buildspec: codebuild_specs/mock_e2e_tests.yml + # env: + # compute-type: BUILD_GENERAL1_LARGE + # debug-session: true + # depend-on: + # - build_linux # - identifier: validate_cdk_version # buildspec: codebuild_specs/validate_cdk_version.yml # depend-on: @@ -59,12 +59,12 @@ batch: # debug-session: true # depend-on: # - build_linux - - identifier: cleanup_resources - buildspec: codebuild_specs/cleanup_resources.yml - env: - compute-type: BUILD_GENERAL1_LARGE - depend-on: - - build_linux + # - identifier: cleanup_resources + # buildspec: codebuild_specs/cleanup_resources.yml + # env: + # compute-type: BUILD_GENERAL1_LARGE + # depend-on: + # - build_linux # - identifier: build_pkg_binaries_arm # buildspec: codebuild_specs/build_pkg_binaries_arm.yml # env: @@ -93,4 +93,3 @@ batch: # buildspec: codebuild_specs/verify_versions_match.yml # depend-on: # - publish_to_local_registry - diff --git a/package.json b/package.json index 8fed261980e..238c2fe2214 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,8 @@ "setup-dev": "yarn dev-build && yarn rm-dev-link && yarn link-dev && yarn rm-aa-dev-link && yarn link-aa-dev", "split-e2e-tests": "yarn ts-node ./scripts/split-e2e-tests.ts && git add .circleci/config.yml", "test-changed": "nx affected --target=test", - "test-ci": "nx run-many --parallel=4 --target=test --all -- --ci --runInBand", + "test-ci-1": "nx run-many --parallel=4 --target=test --all --exclude @aws-amplify/amplify-category-function:test --ci --runInBand", + "test-ci-2": "nx run --parallel=4 @aws-amplify/amplify-category-function:test --ci --runInBand", "test": "nx run-many --target=test --all -- --runInBand", "update-data-packages": "./scripts/update-data-dependencies.sh && yarn", "update-test-timing-data": "ts-node ./scripts/cci-get-job-metrics.ts && ts-node ./scripts/cci-extract-test-timings-from-job-metrics.ts", diff --git a/shared-scripts.sh b/shared-scripts.sh index 99a81891d80..1aeae531184 100644 --- a/shared-scripts.sh +++ b/shared-scripts.sh @@ -121,8 +121,10 @@ function _testLinux { loadCache repo $CODEBUILD_SRC_DIR loadCache .cache $HOME/.cache - yarn test-ci - + node --expose-gc node_modules/.bin/jest --logHeapUsage + yarn test-ci-1 + yarn test-ci-2 + # echo collecting coverage # yarn coverage } From 32815de9d0a4aba8d1ca9b602c1d3b2844ace5af Mon Sep 17 00:00:00 2001 From: Eddy Varela Date: Tue, 18 Apr 2023 02:53:23 -0400 Subject: [PATCH 38/69] removing logging --- shared-scripts.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-scripts.sh b/shared-scripts.sh index 1aeae531184..fd7e309cd57 100644 --- a/shared-scripts.sh +++ b/shared-scripts.sh @@ -121,7 +121,7 @@ function _testLinux { loadCache repo $CODEBUILD_SRC_DIR loadCache .cache $HOME/.cache - node --expose-gc node_modules/.bin/jest --logHeapUsage + # node --expose-gc node_modules/.bin/jest --logHeapUsage yarn test-ci-1 yarn test-ci-2 From 63c62cbeff84bf9634b4a623d5202fb2c6d80fb7 Mon Sep 17 00:00:00 2001 From: Eddy Varela Date: Tue, 18 Apr 2023 02:54:31 -0400 Subject: [PATCH 39/69] chore:try again --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 238c2fe2214..49365dfec3a 100644 --- a/package.json +++ b/package.json @@ -46,6 +46,7 @@ "setup-dev": "yarn dev-build && yarn rm-dev-link && yarn link-dev && yarn rm-aa-dev-link && yarn link-aa-dev", "split-e2e-tests": "yarn ts-node ./scripts/split-e2e-tests.ts && git add .circleci/config.yml", "test-changed": "nx affected --target=test", + "test-ci": "nx run-many --parallel=4 --target=test --all --ci --runInBand", "test-ci-1": "nx run-many --parallel=4 --target=test --all --exclude @aws-amplify/amplify-category-function:test --ci --runInBand", "test-ci-2": "nx run --parallel=4 @aws-amplify/amplify-category-function:test --ci --runInBand", "test": "nx run-many --target=test --all -- --runInBand", From 4a9b807391edde4534388264ac33cc998ee75ded Mon Sep 17 00:00:00 2001 From: Eddy Varela Date: Tue, 18 Apr 2023 03:09:53 -0400 Subject: [PATCH 40/69] chore: exposing garbage collector --- shared-scripts.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shared-scripts.sh b/shared-scripts.sh index fd7e309cd57..aa89e444eb9 100644 --- a/shared-scripts.sh +++ b/shared-scripts.sh @@ -121,8 +121,8 @@ function _testLinux { loadCache repo $CODEBUILD_SRC_DIR loadCache .cache $HOME/.cache - # node --expose-gc node_modules/.bin/jest --logHeapUsage - yarn test-ci-1 + node --expose-gc node_modules/.bin/jest --logHeapUsage + yarn test-ci yarn test-ci-2 # echo collecting coverage From d141f40835e644df5987fded4610597d8f056caa Mon Sep 17 00:00:00 2001 From: Eddy Varela Date: Tue, 18 Apr 2023 11:08:37 -0400 Subject: [PATCH 41/69] reduce number of parallel workers --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 49365dfec3a..52b4692af8e 100644 --- a/package.json +++ b/package.json @@ -46,9 +46,9 @@ "setup-dev": "yarn dev-build && yarn rm-dev-link && yarn link-dev && yarn rm-aa-dev-link && yarn link-aa-dev", "split-e2e-tests": "yarn ts-node ./scripts/split-e2e-tests.ts && git add .circleci/config.yml", "test-changed": "nx affected --target=test", - "test-ci": "nx run-many --parallel=4 --target=test --all --ci --runInBand", + "test-ci": "nx run-many --parallel=3 --target=test --all --ci --runInBand", "test-ci-1": "nx run-many --parallel=4 --target=test --all --exclude @aws-amplify/amplify-category-function:test --ci --runInBand", - "test-ci-2": "nx run --parallel=4 @aws-amplify/amplify-category-function:test --ci --runInBand", + "test-ci-2": "nx run --parallel=3 @aws-amplify/amplify-category-function:test --ci --runInBand", "test": "nx run-many --target=test --all -- --runInBand", "update-data-packages": "./scripts/update-data-dependencies.sh && yarn", "update-test-timing-data": "ts-node ./scripts/cci-get-job-metrics.ts && ts-node ./scripts/cci-extract-test-timings-from-job-metrics.ts", From 07006b26aa11a395929c0337edaf55fa9222dba5 Mon Sep 17 00:00:00 2001 From: Eddy Varela Date: Tue, 18 Apr 2023 11:35:54 -0400 Subject: [PATCH 42/69] chore: reduce alloted memory size --- codebuild_specs/test.yml | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/codebuild_specs/test.yml b/codebuild_specs/test.yml index 99f4b6218d5..b3aaa3c6f8e 100644 --- a/codebuild_specs/test.yml +++ b/codebuild_specs/test.yml @@ -2,7 +2,7 @@ version: 0.2 env: shell: bash variables: - NODE_OPTIONS: --max-old-space-size=13000 + NODE_OPTIONS: --max-old-space-size=5120 phases: build: commands: diff --git a/package.json b/package.json index 52b4692af8e..6aeb3dc3574 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ "split-e2e-tests": "yarn ts-node ./scripts/split-e2e-tests.ts && git add .circleci/config.yml", "test-changed": "nx affected --target=test", "test-ci": "nx run-many --parallel=3 --target=test --all --ci --runInBand", - "test-ci-1": "nx run-many --parallel=4 --target=test --all --exclude @aws-amplify/amplify-category-function:test --ci --runInBand", + "test-ci-1": "nx run-many --parallel=3 --target=test --all --exclude @aws-amplify/amplify-category-function:test --ci --runInBand", "test-ci-2": "nx run --parallel=3 @aws-amplify/amplify-category-function:test --ci --runInBand", "test": "nx run-many --target=test --all -- --runInBand", "update-data-packages": "./scripts/update-data-dependencies.sh && yarn", From 94e87501303518326a84b51724c00ca3552528e9 Mon Sep 17 00:00:00 2001 From: Eddy Varela Date: Tue, 18 Apr 2023 12:14:28 -0400 Subject: [PATCH 43/69] testing mock_e2e --- codebuild_specs/pr_workflow.yml | 20 ++++++++++---------- codebuild_specs/test.yml | 2 +- package.json | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/codebuild_specs/pr_workflow.yml b/codebuild_specs/pr_workflow.yml index 0bf221a5605..e0583932c7f 100644 --- a/codebuild_specs/pr_workflow.yml +++ b/codebuild_specs/pr_workflow.yml @@ -18,21 +18,21 @@ batch: buildspec: codebuild_specs/build_linux.yml env: compute-type: BUILD_GENERAL1_LARGE - - identifier: test - buildspec: codebuild_specs/test.yml - env: - compute-type: BUILD_GENERAL1_LARGE - debug-session: true - depend-on: - - build_linux - # - identifier: mock_e2e_tests - # buildspec: codebuild_specs/mock_e2e_tests.yml + # - identifier: test + # buildspec: codebuild_specs/test.yml # env: # compute-type: BUILD_GENERAL1_LARGE # debug-session: true # depend-on: # - build_linux - # - identifier: validate_cdk_version + - identifier: mock_e2e_tests + buildspec: codebuild_specs/mock_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_LARGE + debug-session: true + depend-on: + - build_linux + - identifier: validate_cdk_version # buildspec: codebuild_specs/validate_cdk_version.yml # depend-on: # - build_linux diff --git a/codebuild_specs/test.yml b/codebuild_specs/test.yml index b3aaa3c6f8e..46a79cb3cbe 100644 --- a/codebuild_specs/test.yml +++ b/codebuild_specs/test.yml @@ -2,7 +2,7 @@ version: 0.2 env: shell: bash variables: - NODE_OPTIONS: --max-old-space-size=5120 + NODE_OPTIONS: --max-old-space-size=12000 phases: build: commands: diff --git a/package.json b/package.json index 6aeb3dc3574..108390b42a2 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "setup-dev": "yarn dev-build && yarn rm-dev-link && yarn link-dev && yarn rm-aa-dev-link && yarn link-aa-dev", "split-e2e-tests": "yarn ts-node ./scripts/split-e2e-tests.ts && git add .circleci/config.yml", "test-changed": "nx affected --target=test", - "test-ci": "nx run-many --parallel=3 --target=test --all --ci --runInBand", + "test-ci": "nx run-many --parallel=4 --target=test --all --ci --runInBand", "test-ci-1": "nx run-many --parallel=3 --target=test --all --exclude @aws-amplify/amplify-category-function:test --ci --runInBand", "test-ci-2": "nx run --parallel=3 @aws-amplify/amplify-category-function:test --ci --runInBand", "test": "nx run-many --target=test --all -- --runInBand", From 7075da5c6372ed4378dfae5e4c693f599688e75b Mon Sep 17 00:00:00 2001 From: Eddy Varela Date: Tue, 18 Apr 2023 12:23:42 -0400 Subject: [PATCH 44/69] chore: try single test --- codebuild_specs/pr_workflow.yml | 14 +++++++------- shared-scripts.sh | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/codebuild_specs/pr_workflow.yml b/codebuild_specs/pr_workflow.yml index e0583932c7f..e02e1a7480c 100644 --- a/codebuild_specs/pr_workflow.yml +++ b/codebuild_specs/pr_workflow.yml @@ -18,13 +18,13 @@ batch: buildspec: codebuild_specs/build_linux.yml env: compute-type: BUILD_GENERAL1_LARGE - # - identifier: test - # buildspec: codebuild_specs/test.yml - # env: - # compute-type: BUILD_GENERAL1_LARGE - # debug-session: true - # depend-on: - # - build_linux + - identifier: test + buildspec: codebuild_specs/test.yml + env: + compute-type: BUILD_GENERAL1_LARGE + debug-session: true + depend-on: + - build_linux - identifier: mock_e2e_tests buildspec: codebuild_specs/mock_e2e_tests.yml env: diff --git a/shared-scripts.sh b/shared-scripts.sh index aa89e444eb9..f62c1968438 100644 --- a/shared-scripts.sh +++ b/shared-scripts.sh @@ -122,7 +122,7 @@ function _testLinux { loadCache .cache $HOME/.cache node --expose-gc node_modules/.bin/jest --logHeapUsage - yarn test-ci + # yarn test-ci yarn test-ci-2 # echo collecting coverage From 0a41ed541e28c4e397f28d715c55160acc3f91e7 Mon Sep 17 00:00:00 2001 From: Eddy Varela Date: Tue, 18 Apr 2023 12:28:24 -0400 Subject: [PATCH 45/69] chore: try single test --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 108390b42a2..6aeb3dc3574 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "setup-dev": "yarn dev-build && yarn rm-dev-link && yarn link-dev && yarn rm-aa-dev-link && yarn link-aa-dev", "split-e2e-tests": "yarn ts-node ./scripts/split-e2e-tests.ts && git add .circleci/config.yml", "test-changed": "nx affected --target=test", - "test-ci": "nx run-many --parallel=4 --target=test --all --ci --runInBand", + "test-ci": "nx run-many --parallel=3 --target=test --all --ci --runInBand", "test-ci-1": "nx run-many --parallel=3 --target=test --all --exclude @aws-amplify/amplify-category-function:test --ci --runInBand", "test-ci-2": "nx run --parallel=3 @aws-amplify/amplify-category-function:test --ci --runInBand", "test": "nx run-many --target=test --all -- --runInBand", From f0f984fcc50623872b9104f88eeba94ebc024b8d Mon Sep 17 00:00:00 2001 From: Eddy Varela Date: Tue, 18 Apr 2023 13:45:33 -0400 Subject: [PATCH 46/69] chore: testing cleanup resources --- codebuild_specs/pr_workflow.yml | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/codebuild_specs/pr_workflow.yml b/codebuild_specs/pr_workflow.yml index e02e1a7480c..ff0c3194795 100644 --- a/codebuild_specs/pr_workflow.yml +++ b/codebuild_specs/pr_workflow.yml @@ -32,7 +32,7 @@ batch: debug-session: true depend-on: - build_linux - - identifier: validate_cdk_version + # - identifier: validate_cdk_version # buildspec: codebuild_specs/validate_cdk_version.yml # depend-on: # - build_linux @@ -59,12 +59,12 @@ batch: # debug-session: true # depend-on: # - build_linux - # - identifier: cleanup_resources - # buildspec: codebuild_specs/cleanup_resources.yml - # env: - # compute-type: BUILD_GENERAL1_LARGE - # depend-on: - # - build_linux + - identifier: cleanup_resources + buildspec: codebuild_specs/cleanup_resources.yml + env: + compute-type: BUILD_GENERAL1_LARGE + depend-on: + - build_linux # - identifier: build_pkg_binaries_arm # buildspec: codebuild_specs/build_pkg_binaries_arm.yml # env: diff --git a/package.json b/package.json index 6aeb3dc3574..48607e29254 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "setup-dev": "yarn dev-build && yarn rm-dev-link && yarn link-dev && yarn rm-aa-dev-link && yarn link-aa-dev", "split-e2e-tests": "yarn ts-node ./scripts/split-e2e-tests.ts && git add .circleci/config.yml", "test-changed": "nx affected --target=test", - "test-ci": "nx run-many --parallel=3 --target=test --all --ci --runInBand", + "test-ci": "nx run-many --parallel=2 --target=test --all --ci --runInBand", "test-ci-1": "nx run-many --parallel=3 --target=test --all --exclude @aws-amplify/amplify-category-function:test --ci --runInBand", "test-ci-2": "nx run --parallel=3 @aws-amplify/amplify-category-function:test --ci --runInBand", "test": "nx run-many --target=test --all -- --runInBand", From d6b474a458e498524a977ed8984eadaffd016fe1 Mon Sep 17 00:00:00 2001 From: Eddy Varela Date: Tue, 18 Apr 2023 14:27:58 -0400 Subject: [PATCH 47/69] reduce parallelicity --- codebuild_specs/pr_workflow.yml | 14 +++++++------- package.json | 4 ++-- shared-scripts.sh | 3 ++- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/codebuild_specs/pr_workflow.yml b/codebuild_specs/pr_workflow.yml index ff0c3194795..d8eaf9fad40 100644 --- a/codebuild_specs/pr_workflow.yml +++ b/codebuild_specs/pr_workflow.yml @@ -25,13 +25,13 @@ batch: debug-session: true depend-on: - build_linux - - identifier: mock_e2e_tests - buildspec: codebuild_specs/mock_e2e_tests.yml - env: - compute-type: BUILD_GENERAL1_LARGE - debug-session: true - depend-on: - - build_linux + # - identifier: mock_e2e_tests + # buildspec: codebuild_specs/mock_e2e_tests.yml + # env: + # compute-type: BUILD_GENERAL1_LARGE + # debug-session: true + # depend-on: + # - build_linux # - identifier: validate_cdk_version # buildspec: codebuild_specs/validate_cdk_version.yml # depend-on: diff --git a/package.json b/package.json index 48607e29254..f5578964eaf 100644 --- a/package.json +++ b/package.json @@ -46,8 +46,8 @@ "setup-dev": "yarn dev-build && yarn rm-dev-link && yarn link-dev && yarn rm-aa-dev-link && yarn link-aa-dev", "split-e2e-tests": "yarn ts-node ./scripts/split-e2e-tests.ts && git add .circleci/config.yml", "test-changed": "nx affected --target=test", - "test-ci": "nx run-many --parallel=2 --target=test --all --ci --runInBand", - "test-ci-1": "nx run-many --parallel=3 --target=test --all --exclude @aws-amplify/amplify-category-function:test --ci --runInBand", + "test-ci": "nx run-many --parallel=1 --target=test --all --ci --runInBand", + "test-ci-1": "nx run-many --parallel=1 --target=test --all --exclude @aws-amplify/amplify-category-function:test --ci --runInBand", "test-ci-2": "nx run --parallel=3 @aws-amplify/amplify-category-function:test --ci --runInBand", "test": "nx run-many --target=test --all -- --runInBand", "update-data-packages": "./scripts/update-data-dependencies.sh && yarn", diff --git a/shared-scripts.sh b/shared-scripts.sh index f62c1968438..162885b58fd 100644 --- a/shared-scripts.sh +++ b/shared-scripts.sh @@ -122,7 +122,8 @@ function _testLinux { loadCache .cache $HOME/.cache node --expose-gc node_modules/.bin/jest --logHeapUsage - # yarn test-ci + yarn test-ci + yarn test-ci-1 yarn test-ci-2 # echo collecting coverage From 5ade223e41e9492fa648d2eed0fcea03cc76f084 Mon Sep 17 00:00:00 2001 From: Eddy Varela Date: Tue, 18 Apr 2023 15:38:47 -0400 Subject: [PATCH 48/69] Update e2e_workflow.yml --- codebuild_specs/e2e_workflow.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/codebuild_specs/e2e_workflow.yml b/codebuild_specs/e2e_workflow.yml index 8ca58071fb6..425e6c4db9b 100644 --- a/codebuild_specs/e2e_workflow.yml +++ b/codebuild_specs/e2e_workflow.yml @@ -97,7 +97,6 @@ batch: buildspec: codebuild_specs/run_e2e_tests_linux.yml env: compute-type: BUILD_GENERAL1_LARGE - debug-session: true depend-on: - upload_pkg_binaries - identifier: run_e2e_tests_windows @@ -108,3 +107,7 @@ batch: image: aws/codebuild/windows-base:2019-2.0 depend-on: - upload_pkg_binaries + - identifier: cleanup_resources + buildspec: codebuild_specs/cleanup_resources.yml + depend-on: + - publish_to_local_registry From 1eb3cc54339caa83ccaa4025d443e668202be882 Mon Sep 17 00:00:00 2001 From: Eddy Varela Date: Tue, 18 Apr 2023 15:41:49 -0400 Subject: [PATCH 49/69] Update e2e_workflow.yml --- codebuild_specs/e2e_workflow.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/codebuild_specs/e2e_workflow.yml b/codebuild_specs/e2e_workflow.yml index 425e6c4db9b..6b3562ee199 100644 --- a/codebuild_specs/e2e_workflow.yml +++ b/codebuild_specs/e2e_workflow.yml @@ -111,3 +111,4 @@ batch: buildspec: codebuild_specs/cleanup_resources.yml depend-on: - publish_to_local_registry + From 0e3ff33fff76c7b9e8a3e52fe9491773f6733632 Mon Sep 17 00:00:00 2001 From: Eddy Varela Date: Tue, 18 Apr 2023 15:46:44 -0400 Subject: [PATCH 50/69] Update e2e_workflow.yml --- codebuild_specs/e2e_workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codebuild_specs/e2e_workflow.yml b/codebuild_specs/e2e_workflow.yml index 6b3562ee199..820b8b74358 100644 --- a/codebuild_specs/e2e_workflow.yml +++ b/codebuild_specs/e2e_workflow.yml @@ -111,4 +111,4 @@ batch: buildspec: codebuild_specs/cleanup_resources.yml depend-on: - publish_to_local_registry - + From b19a60b6374d9b2bf4dbaa97c69531023b116def Mon Sep 17 00:00:00 2001 From: Eddy Varela Date: Tue, 18 Apr 2023 16:47:33 -0400 Subject: [PATCH 51/69] Update e2e_workflow.yml --- codebuild_specs/e2e_workflow.yml | 164 +++++++++++++++---------------- 1 file changed, 82 insertions(+), 82 deletions(-) diff --git a/codebuild_specs/e2e_workflow.yml b/codebuild_specs/e2e_workflow.yml index 820b8b74358..587764995d6 100644 --- a/codebuild_specs/e2e_workflow.yml +++ b/codebuild_specs/e2e_workflow.yml @@ -18,37 +18,37 @@ 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: aws/codebuild/windows-base:2019-2.0 - - 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_LARGE - depend-on: - - build_linux - - identifier: validate_cdk_version - buildspec: codebuild_specs/validate_cdk_version.yml - depend-on: - - build_linux - - identifier: verify_api_extract - buildspec: codebuild_specs/verify_api_extract.yml - env: - compute-type: BUILD_GENERAL1_LARGE - depend-on: - - build_linux - - identifier: verify_yarn_lock - buildspec: codebuild_specs/verify_yarn_lock.yml - depend-on: +# - identifier: build_windows +# buildspec: codebuild_specs/build_windows.yml +# env: +# type: WINDOWS_SERVER_2019_CONTAINER +# compute-type: BUILD_GENERAL1_LARGE +# image: aws/codebuild/windows-base:2019-2.0 +# # - 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_LARGE +# depend-on: +# - build_linux +# - identifier: validate_cdk_version +# buildspec: codebuild_specs/validate_cdk_version.yml +# depend-on: +# - build_linux +# - identifier: verify_api_extract +# buildspec: codebuild_specs/verify_api_extract.yml +# env: +# compute-type: BUILD_GENERAL1_LARGE +# depend-on: +# - build_linux +# - identifier: verify_yarn_lock +# buildspec: codebuild_specs/verify_yarn_lock.yml +# depend-on: - build_linux - identifier: publish_to_local_registry buildspec: codebuild_specs/publish_to_local_registry.yml @@ -56,57 +56,57 @@ batch: compute-type: BUILD_GENERAL1_LARGE depend-on: - build_linux - - identifier: build_pkg_binaries_arm - buildspec: codebuild_specs/build_pkg_binaries_arm.yml - env: - compute-type: BUILD_GENERAL1_LARGE - depend-on: - - publish_to_local_registry - - identifier: build_pkg_binaries_linux - buildspec: codebuild_specs/build_pkg_binaries_linux.yml - env: - compute-type: BUILD_GENERAL1_LARGE - depend-on: - - publish_to_local_registry - - identifier: build_pkg_binaries_macos - buildspec: codebuild_specs/build_pkg_binaries_macos.yml - env: - compute-type: BUILD_GENERAL1_LARGE - depend-on: - - publish_to_local_registry - - identifier: build_pkg_binaries_win - buildspec: codebuild_specs/build_pkg_binaries_win.yml - env: - compute-type: BUILD_GENERAL1_LARGE - depend-on: - - publish_to_local_registry - - identifier: upload_pkg_binaries - buildspec: codebuild_specs/upload_pkg_binaries.yml - env: - compute-type: BUILD_GENERAL1_LARGE - depend-on: - - build_pkg_binaries_arm - - build_pkg_binaries_linux - - build_pkg_binaries_macos - - build_pkg_binaries_win - - identifier: verify_versions_match - buildspec: codebuild_specs/verify_versions_match.yml - depend-on: - - publish_to_local_registry - - identifier: run_e2e_tests_linux - buildspec: codebuild_specs/run_e2e_tests_linux.yml - env: - compute-type: BUILD_GENERAL1_LARGE - depend-on: - - upload_pkg_binaries - - identifier: run_e2e_tests_windows - buildspec: codebuild_specs/run_e2e_tests_windows.yml - env: - type: WINDOWS_SERVER_2019_CONTAINER - compute-type: BUILD_GENERAL1_LARGE - image: aws/codebuild/windows-base:2019-2.0 - depend-on: - - upload_pkg_binaries +# - identifier: build_pkg_binaries_arm +# buildspec: codebuild_specs/build_pkg_binaries_arm.yml +# env: +# compute-type: BUILD_GENERAL1_LARGE +# depend-on: +# - publish_to_local_registry +# - identifier: build_pkg_binaries_linux +# buildspec: codebuild_specs/build_pkg_binaries_linux.yml +# env: +# compute-type: BUILD_GENERAL1_LARGE +# depend-on: +# - publish_to_local_registry +# - identifier: build_pkg_binaries_macos +# buildspec: codebuild_specs/build_pkg_binaries_macos.yml +# env: +# compute-type: BUILD_GENERAL1_LARGE +# depend-on: +# - publish_to_local_registry +# - identifier: build_pkg_binaries_win +# buildspec: codebuild_specs/build_pkg_binaries_win.yml +# env: +# compute-type: BUILD_GENERAL1_LARGE +# depend-on: +# - publish_to_local_registry +# - identifier: upload_pkg_binaries +# buildspec: codebuild_specs/upload_pkg_binaries.yml +# env: +# compute-type: BUILD_GENERAL1_LARGE +# depend-on: +# - build_pkg_binaries_arm +# - build_pkg_binaries_linux +# - build_pkg_binaries_macos +# - build_pkg_binaries_win +# - identifier: verify_versions_match +# buildspec: codebuild_specs/verify_versions_match.yml +# depend-on: +# - publish_to_local_registry +# - identifier: run_e2e_tests_linux +# buildspec: codebuild_specs/run_e2e_tests_linux.yml +# env: +# compute-type: BUILD_GENERAL1_LARGE +# depend-on: +# - upload_pkg_binaries +# - identifier: run_e2e_tests_windows +# buildspec: codebuild_specs/run_e2e_tests_windows.yml +# env: +# type: WINDOWS_SERVER_2019_CONTAINER +# compute-type: BUILD_GENERAL1_LARGE +# image: aws/codebuild/windows-base:2019-2.0 +# depend-on: +# - upload_pkg_binaries - identifier: cleanup_resources buildspec: codebuild_specs/cleanup_resources.yml depend-on: From e4013edae60e5a355e7942b042491d38d3f6ed4f Mon Sep 17 00:00:00 2001 From: Eddy Varela Date: Tue, 18 Apr 2023 16:47:49 -0400 Subject: [PATCH 52/69] Update e2e_workflow.yml --- codebuild_specs/e2e_workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codebuild_specs/e2e_workflow.yml b/codebuild_specs/e2e_workflow.yml index 587764995d6..1217dc90369 100644 --- a/codebuild_specs/e2e_workflow.yml +++ b/codebuild_specs/e2e_workflow.yml @@ -49,7 +49,7 @@ batch: # - identifier: verify_yarn_lock # buildspec: codebuild_specs/verify_yarn_lock.yml # depend-on: - - build_linux +# - build_linux - identifier: publish_to_local_registry buildspec: codebuild_specs/publish_to_local_registry.yml env: From ed48d959d864ce3312731e4a752f31e432527587 Mon Sep 17 00:00:00 2001 From: Eddy Varela Date: Tue, 18 Apr 2023 17:18:39 -0400 Subject: [PATCH 53/69] chore: making changes --- codebuild_specs/cleanup_resources.yml | 2 ++ codebuild_specs/pr_workflow.yml | 6 ------ shared-scripts.sh | 2 +- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/codebuild_specs/cleanup_resources.yml b/codebuild_specs/cleanup_resources.yml index b941b6d89ce..b5e01cb0e05 100644 --- a/codebuild_specs/cleanup_resources.yml +++ b/codebuild_specs/cleanup_resources.yml @@ -1,6 +1,8 @@ version: 0.2 env: shell: bash + variables: + NODE_OPTIONS: --max-old-space-size=5120 phases: build: commands: diff --git a/codebuild_specs/pr_workflow.yml b/codebuild_specs/pr_workflow.yml index d8eaf9fad40..67e6a4b8158 100644 --- a/codebuild_specs/pr_workflow.yml +++ b/codebuild_specs/pr_workflow.yml @@ -59,12 +59,6 @@ batch: # debug-session: true # depend-on: # - build_linux - - identifier: cleanup_resources - buildspec: codebuild_specs/cleanup_resources.yml - env: - compute-type: BUILD_GENERAL1_LARGE - depend-on: - - build_linux # - identifier: build_pkg_binaries_arm # buildspec: codebuild_specs/build_pkg_binaries_arm.yml # env: diff --git a/shared-scripts.sh b/shared-scripts.sh index 162885b58fd..4b561b86b01 100644 --- a/shared-scripts.sh +++ b/shared-scripts.sh @@ -474,5 +474,5 @@ function _cleanupResources { cd packages/amplify-e2e-tests yarn clean-e2e-resources - storeCache $CODEBUILD_SRC_DIR/packages/amplify-e2e-tests/amplify-e2e-reports repo + storeCache $HOME/packages/amplify-e2e-tests/amplify-e2e-reports repo } From b0b823ed94016bcf533931d643633d0822200a3b Mon Sep 17 00:00:00 2001 From: Eddy Varela Date: Tue, 18 Apr 2023 17:27:22 -0400 Subject: [PATCH 54/69] chore: publish PR workflow changes --- codebuild_specs/pr_workflow.yml | 60 +++++++++++++++++++-------------- shared-scripts.sh | 2 ++ 2 files changed, 37 insertions(+), 25 deletions(-) diff --git a/codebuild_specs/pr_workflow.yml b/codebuild_specs/pr_workflow.yml index 67e6a4b8158..2a2b74c1348 100644 --- a/codebuild_specs/pr_workflow.yml +++ b/codebuild_specs/pr_workflow.yml @@ -18,40 +18,50 @@ batch: buildspec: codebuild_specs/build_linux.yml env: compute-type: BUILD_GENERAL1_LARGE - - identifier: test - buildspec: codebuild_specs/test.yml + - identifier: lint + buildspec: codebuild_specs/lint.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_LARGE debug-session: true depend-on: - build_linux - # - identifier: mock_e2e_tests - # buildspec: codebuild_specs/mock_e2e_tests.yml - # env: - # compute-type: BUILD_GENERAL1_LARGE - # debug-session: true - # depend-on: - # - build_linux - # - identifier: validate_cdk_version - # buildspec: codebuild_specs/validate_cdk_version.yml - # depend-on: - # - build_linux - # - identifier: verify_api_extract - # buildspec: codebuild_specs/verify_api_extract.yml - # env: - # compute-type: BUILD_GENERAL1_LARGE - # depend-on: - # - build_linux - # - identifier: verify_yarn_lock - # buildspec: codebuild_specs/verify_yarn_lock.yml - # depend-on: - # - build_linux - # - identifier: publish_to_local_registry - # buildspec: codebuild_specs/publish_to_local_registry.yml + - identifier: publish_to_local_registry + buildspec: codebuild_specs/publish_to_local_registry.yml + env: + compute-type: BUILD_GENERAL1_LARGE + depend-on: + - build_linux + - identifier: validate_cdk_version + buildspec: codebuild_specs/validate_cdk_version.yml + env: + compute-type: BUILD_GENERAL1_LARGE + depend-on: + - build_linux + + - identifier: verify_api_extract + buildspec: codebuild_specs/verify_api_extract.yml + env: + compute-type: BUILD_GENERAL1_LARGE + depend-on: + - build_linux + - identifier: verify_yarn_lock + buildspec: codebuild_specs/verify_yarn_lock.yml + depend-on: + - build_linux + + # - identifier: test + # buildspec: codebuild_specs/test.yml # env: # compute-type: BUILD_GENERAL1_LARGE # depend-on: # - build_linux + # - identifier: integration_tests # buildspec: codebuild_specs/integration_test.yml # env: diff --git a/shared-scripts.sh b/shared-scripts.sh index 4b561b86b01..264e7e8fc22 100644 --- a/shared-scripts.sh +++ b/shared-scripts.sh @@ -91,8 +91,10 @@ function _setShell { function _buildLinux { _setShell echo Linux Build + yarn run production-build yarn build-tests + storeCache $CODEBUILD_SRC_DIR repo storeCache $HOME/.cache .cache } From 3adfaf0e1dafe9495c6c92cb2af0028ef4eec8c6 Mon Sep 17 00:00:00 2001 From: Eddy Varela Date: Tue, 18 Apr 2023 17:30:43 -0400 Subject: [PATCH 55/69] chore: PR Workflows --- codebuild_specs/pr_workflow.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/codebuild_specs/pr_workflow.yml b/codebuild_specs/pr_workflow.yml index 2a2b74c1348..42b30e079ca 100644 --- a/codebuild_specs/pr_workflow.yml +++ b/codebuild_specs/pr_workflow.yml @@ -43,7 +43,6 @@ batch: compute-type: BUILD_GENERAL1_LARGE depend-on: - build_linux - - identifier: verify_api_extract buildspec: codebuild_specs/verify_api_extract.yml env: @@ -52,6 +51,8 @@ batch: - build_linux - identifier: verify_yarn_lock buildspec: codebuild_specs/verify_yarn_lock.yml + env: + compute-type: BUILD_GENERAL1_LARGE depend-on: - build_linux From e4139f41ce008a475a8162e82c984c95fe027fa0 Mon Sep 17 00:00:00 2001 From: Eddy Varela Date: Tue, 18 Apr 2023 17:57:05 -0400 Subject: [PATCH 56/69] chore: add more memory to lint --- codebuild_specs/lint.yml | 2 + codebuild_specs/pr_workflow.yml | 69 +++++++++++++-------------------- 2 files changed, 30 insertions(+), 41 deletions(-) diff --git a/codebuild_specs/lint.yml b/codebuild_specs/lint.yml index 7363c6c10d0..9f9e195c97e 100644 --- a/codebuild_specs/lint.yml +++ b/codebuild_specs/lint.yml @@ -1,6 +1,8 @@ version: 0.2 env: shell: bash + variables: + NODE_OPTIONS: --max-old-space-size=5120 phases: build: commands: diff --git a/codebuild_specs/pr_workflow.yml b/codebuild_specs/pr_workflow.yml index 42b30e079ca..807fc0e3e17 100644 --- a/codebuild_specs/pr_workflow.yml +++ b/codebuild_specs/pr_workflow.yml @@ -56,45 +56,32 @@ batch: depend-on: - build_linux - # - identifier: test - # buildspec: codebuild_specs/test.yml - # env: - # compute-type: BUILD_GENERAL1_LARGE - # depend-on: - # - build_linux + - identifier: build_pkg_binaries_arm + buildspec: codebuild_specs/build_pkg_binaries_arm.yml + env: + compute-type: BUILD_GENERAL1_LARGE + depend-on: + - publish_to_local_registry - # - identifier: integration_tests - # buildspec: codebuild_specs/integration_test.yml - # env: - # compute-type: BUILD_GENERAL1_LARGE - # debug-session: true - # depend-on: - # - build_linux - # - identifier: build_pkg_binaries_arm - # buildspec: codebuild_specs/build_pkg_binaries_arm.yml - # env: - # compute-type: BUILD_GENERAL1_LARGE - # depend-on: - # - publish_to_local_registry - # - identifier: build_pkg_binaries_linux - # buildspec: codebuild_specs/build_pkg_binaries_linux.yml - # env: - # compute-type: BUILD_GENERAL1_LARGE - # depend-on: - # - publish_to_local_registry - # - identifier: build_pkg_binaries_macos - # buildspec: codebuild_specs/build_pkg_binaries_macos.yml - # env: - # compute-type: BUILD_GENERAL1_LARGE - # depend-on: - # - publish_to_local_registry - # - identifier: build_pkg_binaries_win - # buildspec: codebuild_specs/build_pkg_binaries_win.yml - # env: - # compute-type: BUILD_GENERAL1_LARGE - # depend-on: - # - publish_to_local_registry - # - identifier: verify_versions_match - # buildspec: codebuild_specs/verify_versions_match.yml - # depend-on: - # - publish_to_local_registry + - identifier: build_pkg_binaries_linux + buildspec: codebuild_specs/build_pkg_binaries_linux.yml + env: + compute-type: BUILD_GENERAL1_LARGE + depend-on: + - publish_to_local_registry + - identifier: build_pkg_binaries_macos + buildspec: codebuild_specs/build_pkg_binaries_macos.yml + env: + compute-type: BUILD_GENERAL1_LARGE + depend-on: + - publish_to_local_registry + - identifier: build_pkg_binaries_win + buildspec: codebuild_specs/build_pkg_binaries_win.yml + env: + compute-type: BUILD_GENERAL1_LARGE + depend-on: + - publish_to_local_registry + - identifier: verify_versions_match + buildspec: codebuild_specs/verify_versions_match.yml + depend-on: + - publish_to_local_registry From 80ce910d585304f817d133148109128b9cb8a91c Mon Sep 17 00:00:00 2001 From: Eddy Varela Date: Tue, 18 Apr 2023 18:00:52 -0400 Subject: [PATCH 57/69] chore: add unit tests --- codebuild_specs/pr_workflow.yml | 9 +++++++-- codebuild_specs/test.yml | 1 - shared-scripts.sh | 5 +++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/codebuild_specs/pr_workflow.yml b/codebuild_specs/pr_workflow.yml index 807fc0e3e17..c4917b9f3d4 100644 --- a/codebuild_specs/pr_workflow.yml +++ b/codebuild_specs/pr_workflow.yml @@ -31,6 +31,13 @@ batch: debug-session: true depend-on: - build_linux + + - identifier: test + buildspec: codebuild_specs/test.yml + env: + compute-type: BUILD_GENERAL1_LARGE + depend-on: + - build_linux - identifier: publish_to_local_registry buildspec: codebuild_specs/publish_to_local_registry.yml env: @@ -55,14 +62,12 @@ batch: compute-type: BUILD_GENERAL1_LARGE depend-on: - build_linux - - identifier: build_pkg_binaries_arm buildspec: codebuild_specs/build_pkg_binaries_arm.yml env: compute-type: BUILD_GENERAL1_LARGE depend-on: - publish_to_local_registry - - identifier: build_pkg_binaries_linux buildspec: codebuild_specs/build_pkg_binaries_linux.yml env: diff --git a/codebuild_specs/test.yml b/codebuild_specs/test.yml index 46a79cb3cbe..bb1a381745b 100644 --- a/codebuild_specs/test.yml +++ b/codebuild_specs/test.yml @@ -8,7 +8,6 @@ phases: commands: - codebuild-breakpoint - node -e "console.log(require('v8').getHeapStatistics().total_available_size / 1024 / 1024)" - - source .circleci/local_publish_helpers.sh - source ./shared-scripts.sh && _testLinux post_build: commands: diff --git a/shared-scripts.sh b/shared-scripts.sh index 264e7e8fc22..70628424465 100644 --- a/shared-scripts.sh +++ b/shared-scripts.sh @@ -125,8 +125,9 @@ function _testLinux { node --expose-gc node_modules/.bin/jest --logHeapUsage yarn test-ci - yarn test-ci-1 - yarn test-ci-2 + + # yarn test-ci-1 + # yarn test-ci-2 # echo collecting coverage # yarn coverage From b3601b96e5a21b5b43e9e31721d281946113404d Mon Sep 17 00:00:00 2001 From: Eddy Varela Date: Tue, 18 Apr 2023 18:19:24 -0400 Subject: [PATCH 58/69] chore: get lint to pass --- codebuild_specs/build_image.yml | 2 - codebuild_specs/e2e_workflow.yml | 167 +++++++++++++++---------------- 2 files changed, 83 insertions(+), 86 deletions(-) diff --git a/codebuild_specs/build_image.yml b/codebuild_specs/build_image.yml index 7a97648cad6..5363c47c0d3 100644 --- a/codebuild_specs/build_image.yml +++ b/codebuild_specs/build_image.yml @@ -1,4 +1,3 @@ - version: 0.2 phases: pre_build: @@ -25,4 +24,3 @@ phases: - echo Build completed on `date` - echo Pushing the Docker image... - docker push $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/$IMAGE_REPO_NAME:$IMAGE_TAG - diff --git a/codebuild_specs/e2e_workflow.yml b/codebuild_specs/e2e_workflow.yml index 1217dc90369..844513ebd0c 100644 --- a/codebuild_specs/e2e_workflow.yml +++ b/codebuild_specs/e2e_workflow.yml @@ -18,97 +18,96 @@ 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: aws/codebuild/windows-base:2019-2.0 -# # - 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_LARGE -# depend-on: -# - build_linux -# - identifier: validate_cdk_version -# buildspec: codebuild_specs/validate_cdk_version.yml -# depend-on: -# - build_linux -# - identifier: verify_api_extract -# buildspec: codebuild_specs/verify_api_extract.yml -# env: -# compute-type: BUILD_GENERAL1_LARGE -# depend-on: -# - build_linux -# - identifier: verify_yarn_lock -# buildspec: codebuild_specs/verify_yarn_lock.yml -# depend-on: -# - build_linux + # - identifier: build_windows + # buildspec: codebuild_specs/build_windows.yml + # env: + # type: WINDOWS_SERVER_2019_CONTAINER + # compute-type: BUILD_GENERAL1_LARGE + # image: aws/codebuild/windows-base:2019-2.0 + # # - 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_LARGE + # depend-on: + # - build_linux + # - identifier: validate_cdk_version + # buildspec: codebuild_specs/validate_cdk_version.yml + # depend-on: + # - build_linux + # - identifier: verify_api_extract + # buildspec: codebuild_specs/verify_api_extract.yml + # env: + # compute-type: BUILD_GENERAL1_LARGE + # depend-on: + # - build_linux + # - identifier: verify_yarn_lock + # buildspec: codebuild_specs/verify_yarn_lock.yml + # depend-on: + # - build_linux - identifier: publish_to_local_registry buildspec: codebuild_specs/publish_to_local_registry.yml env: compute-type: BUILD_GENERAL1_LARGE depend-on: - build_linux -# - identifier: build_pkg_binaries_arm -# buildspec: codebuild_specs/build_pkg_binaries_arm.yml -# env: -# compute-type: BUILD_GENERAL1_LARGE -# depend-on: -# - publish_to_local_registry -# - identifier: build_pkg_binaries_linux -# buildspec: codebuild_specs/build_pkg_binaries_linux.yml -# env: -# compute-type: BUILD_GENERAL1_LARGE -# depend-on: -# - publish_to_local_registry -# - identifier: build_pkg_binaries_macos -# buildspec: codebuild_specs/build_pkg_binaries_macos.yml -# env: -# compute-type: BUILD_GENERAL1_LARGE -# depend-on: -# - publish_to_local_registry -# - identifier: build_pkg_binaries_win -# buildspec: codebuild_specs/build_pkg_binaries_win.yml -# env: -# compute-type: BUILD_GENERAL1_LARGE -# depend-on: -# - publish_to_local_registry -# - identifier: upload_pkg_binaries -# buildspec: codebuild_specs/upload_pkg_binaries.yml -# env: -# compute-type: BUILD_GENERAL1_LARGE -# depend-on: -# - build_pkg_binaries_arm -# - build_pkg_binaries_linux -# - build_pkg_binaries_macos -# - build_pkg_binaries_win -# - identifier: verify_versions_match -# buildspec: codebuild_specs/verify_versions_match.yml -# depend-on: -# - publish_to_local_registry -# - identifier: run_e2e_tests_linux -# buildspec: codebuild_specs/run_e2e_tests_linux.yml -# env: -# compute-type: BUILD_GENERAL1_LARGE -# depend-on: -# - upload_pkg_binaries -# - identifier: run_e2e_tests_windows -# buildspec: codebuild_specs/run_e2e_tests_windows.yml -# env: -# type: WINDOWS_SERVER_2019_CONTAINER -# compute-type: BUILD_GENERAL1_LARGE -# image: aws/codebuild/windows-base:2019-2.0 -# depend-on: -# - upload_pkg_binaries + # - identifier: build_pkg_binaries_arm + # buildspec: codebuild_specs/build_pkg_binaries_arm.yml + # env: + # compute-type: BUILD_GENERAL1_LARGE + # depend-on: + # - publish_to_local_registry + # - identifier: build_pkg_binaries_linux + # buildspec: codebuild_specs/build_pkg_binaries_linux.yml + # env: + # compute-type: BUILD_GENERAL1_LARGE + # depend-on: + # - publish_to_local_registry + # - identifier: build_pkg_binaries_macos + # buildspec: codebuild_specs/build_pkg_binaries_macos.yml + # env: + # compute-type: BUILD_GENERAL1_LARGE + # depend-on: + # - publish_to_local_registry + # - identifier: build_pkg_binaries_win + # buildspec: codebuild_specs/build_pkg_binaries_win.yml + # env: + # compute-type: BUILD_GENERAL1_LARGE + # depend-on: + # - publish_to_local_registry + # - identifier: upload_pkg_binaries + # buildspec: codebuild_specs/upload_pkg_binaries.yml + # env: + # compute-type: BUILD_GENERAL1_LARGE + # depend-on: + # - build_pkg_binaries_arm + # - build_pkg_binaries_linux + # - build_pkg_binaries_macos + # - build_pkg_binaries_win + # - identifier: verify_versions_match + # buildspec: codebuild_specs/verify_versions_match.yml + # depend-on: + # - publish_to_local_registry + # - identifier: run_e2e_tests_linux + # buildspec: codebuild_specs/run_e2e_tests_linux.yml + # env: + # compute-type: BUILD_GENERAL1_LARGE + # depend-on: + # - upload_pkg_binaries + # - identifier: run_e2e_tests_windows + # buildspec: codebuild_specs/run_e2e_tests_windows.yml + # env: + # type: WINDOWS_SERVER_2019_CONTAINER + # compute-type: BUILD_GENERAL1_LARGE + # image: aws/codebuild/windows-base:2019-2.0 + # depend-on: + # - upload_pkg_binaries - identifier: cleanup_resources buildspec: codebuild_specs/cleanup_resources.yml depend-on: - publish_to_local_registry - From 4f5b1c5bebb949f3b25fe1d6cf3629d5e49a4459 Mon Sep 17 00:00:00 2001 From: Eddy Varela Date: Tue, 18 Apr 2023 20:14:16 -0400 Subject: [PATCH 59/69] chore: test e2e integration tests --- codebuild_specs/e2e_workflow.yml | 117 +++++++++++++++++-------------- codebuild_specs/pr_workflow.yml | 1 - package.json | 2 +- shared-scripts.sh | 2 +- 4 files changed, 65 insertions(+), 57 deletions(-) diff --git a/codebuild_specs/e2e_workflow.yml b/codebuild_specs/e2e_workflow.yml index 844513ebd0c..f821168dac0 100644 --- a/codebuild_specs/e2e_workflow.yml +++ b/codebuild_specs/e2e_workflow.yml @@ -18,62 +18,75 @@ 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: aws/codebuild/windows-base:2019-2.0 - # # - 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_LARGE - # depend-on: - # - build_linux - # - identifier: validate_cdk_version - # buildspec: codebuild_specs/validate_cdk_version.yml - # depend-on: - # - build_linux - # - identifier: verify_api_extract - # buildspec: codebuild_specs/verify_api_extract.yml - # env: - # compute-type: BUILD_GENERAL1_LARGE - # depend-on: - # - build_linux - # - identifier: verify_yarn_lock - # buildspec: codebuild_specs/verify_yarn_lock.yml - # depend-on: - # - build_linux + - identifier: cleanup_resources + buildspec: codebuild_specs/cleanup_resources.yml + depend-on: + - build_linux + - identifier: integration_test + buildspec: codebuild_specs/integration_tests.yml + env: + compute-type: BUILD_GENERAL1_LARGE + - identifier: mock_e2e_tests + buildspec: codebuild_specs/mock_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_LARGE + depend-on: + - build_linux - identifier: publish_to_local_registry buildspec: codebuild_specs/publish_to_local_registry.yml env: compute-type: BUILD_GENERAL1_LARGE depend-on: - build_linux - # - identifier: build_pkg_binaries_arm - # buildspec: codebuild_specs/build_pkg_binaries_arm.yml - # env: - # compute-type: BUILD_GENERAL1_LARGE - # depend-on: - # - publish_to_local_registry - # - identifier: build_pkg_binaries_linux - # buildspec: codebuild_specs/build_pkg_binaries_linux.yml - # env: - # compute-type: BUILD_GENERAL1_LARGE - # depend-on: - # - publish_to_local_registry - # - identifier: build_pkg_binaries_macos - # buildspec: codebuild_specs/build_pkg_binaries_macos.yml - # env: - # compute-type: BUILD_GENERAL1_LARGE - # depend-on: - # - publish_to_local_registry + - identifier: test + buildspec: codebuild_specs/test.yml + env: + compute-type: BUILD_GENERAL1_LARGE + depend-on: + - build_linux + - identifier: validate_cdk_version + buildspec: codebuild_specs/validate_cdk_version.yml + env: + compute-type: BUILD_GENERAL1_LARGE + depend-on: + - build_linux + - identifier: verify_api_extract + buildspec: codebuild_specs/verify_api_extract.yml + env: + compute-type: BUILD_GENERAL1_LARGE + depend-on: + - build_linux + - identifier: verify_yarn_lock + buildspec: codebuild_specs/verify_yarn_lock.yml + depend-on: + - build_linux + + - identifier: build_windows + buildspec: codebuild_specs/build_windows.yml + env: + type: WINDOWS_SERVER_2019_CONTAINER + compute-type: BUILD_GENERAL1_LARGE + image: aws/codebuild/windows-base:2019-2.0 + - identifier: build_pkg_binaries_macos + buildspec: codebuild_specs/build_pkg_binaries_macos.yml + env: + compute-type: BUILD_GENERAL1_LARGE + depend-on: + - publish_to_local_registry + + - identifier: build_pkg_binaries_arm + buildspec: codebuild_specs/build_pkg_binaries_arm.yml + env: + compute-type: BUILD_GENERAL1_LARGE + depend-on: + - publish_to_local_registry + - identifier: build_pkg_binaries_linux + buildspec: codebuild_specs/build_pkg_binaries_linux.yml + env: + compute-type: BUILD_GENERAL1_LARGE + depend-on: + - publish_to_local_registry + # # - identifier: build_pkg_binaries_win # buildspec: codebuild_specs/build_pkg_binaries_win.yml # env: @@ -107,7 +120,3 @@ batch: # image: aws/codebuild/windows-base:2019-2.0 # depend-on: # - upload_pkg_binaries - - identifier: cleanup_resources - buildspec: codebuild_specs/cleanup_resources.yml - depend-on: - - publish_to_local_registry diff --git a/codebuild_specs/pr_workflow.yml b/codebuild_specs/pr_workflow.yml index c4917b9f3d4..80a653f476e 100644 --- a/codebuild_specs/pr_workflow.yml +++ b/codebuild_specs/pr_workflow.yml @@ -31,7 +31,6 @@ batch: debug-session: true depend-on: - build_linux - - identifier: test buildspec: codebuild_specs/test.yml env: diff --git a/package.json b/package.json index f5578964eaf..cadcc523f28 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "setup-dev": "yarn dev-build && yarn rm-dev-link && yarn link-dev && yarn rm-aa-dev-link && yarn link-aa-dev", "split-e2e-tests": "yarn ts-node ./scripts/split-e2e-tests.ts && git add .circleci/config.yml", "test-changed": "nx affected --target=test", - "test-ci": "nx run-many --parallel=1 --target=test --all --ci --runInBand", + "test-ci": "nx run-many --parallel=3 --target=test --all --ci --runInBand", "test-ci-1": "nx run-many --parallel=1 --target=test --all --exclude @aws-amplify/amplify-category-function:test --ci --runInBand", "test-ci-2": "nx run --parallel=3 @aws-amplify/amplify-category-function:test --ci --runInBand", "test": "nx run-many --target=test --all -- --runInBand", diff --git a/shared-scripts.sh b/shared-scripts.sh index 70628424465..b8b59498301 100644 --- a/shared-scripts.sh +++ b/shared-scripts.sh @@ -123,7 +123,7 @@ function _testLinux { loadCache repo $CODEBUILD_SRC_DIR loadCache .cache $HOME/.cache - node --expose-gc node_modules/.bin/jest --logHeapUsage + # node --expose-gc node_modules/.bin/jest --logHeapUsage yarn test-ci # yarn test-ci-1 From f8cd10c45f045cd3e04d70d607a91d9a0fd3f015 Mon Sep 17 00:00:00 2001 From: Eddy Varela Date: Tue, 18 Apr 2023 20:23:34 -0400 Subject: [PATCH 60/69] chore: clean --- codebuild_specs/e2e_workflow.yml | 45 ++++++++++++++------------------ 1 file changed, 19 insertions(+), 26 deletions(-) diff --git a/codebuild_specs/e2e_workflow.yml b/codebuild_specs/e2e_workflow.yml index f821168dac0..ec9ddcb88d7 100644 --- a/codebuild_specs/e2e_workflow.yml +++ b/codebuild_specs/e2e_workflow.yml @@ -86,32 +86,25 @@ batch: compute-type: BUILD_GENERAL1_LARGE depend-on: - publish_to_local_registry - # - # - identifier: build_pkg_binaries_win - # buildspec: codebuild_specs/build_pkg_binaries_win.yml - # env: - # compute-type: BUILD_GENERAL1_LARGE - # depend-on: - # - publish_to_local_registry - # - identifier: upload_pkg_binaries - # buildspec: codebuild_specs/upload_pkg_binaries.yml - # env: - # compute-type: BUILD_GENERAL1_LARGE - # depend-on: - # - build_pkg_binaries_arm - # - build_pkg_binaries_linux - # - build_pkg_binaries_macos - # - build_pkg_binaries_win - # - identifier: verify_versions_match - # buildspec: codebuild_specs/verify_versions_match.yml - # depend-on: - # - publish_to_local_registry - # - identifier: run_e2e_tests_linux - # buildspec: codebuild_specs/run_e2e_tests_linux.yml - # env: - # compute-type: BUILD_GENERAL1_LARGE - # depend-on: - # - upload_pkg_binaries + - identifier: upload_pkg_binaries.yml + buildspec: codebuild_specs/upload_pkg_binaries.yml + env: + compute-type: BUILD_GENERAL1_LARGE + depend-on: + - build_pkg_binaries_arm + - build_pkg_binaries_linux + - build_pkg_binaries_macos + - build_pkg_binaries_win + - identifier: verify_versions_match + buildspec: codebuild_specs/verify_versions_match.yml + depend-on: + - publish_to_local_registry + # - identifier: run_e2e_tests_linux + # buildspec: codebuild_specs/run_e2e_tests_linux.yml + # env: + # compute-type: BUILD_GENERAL1_LARGE + # depend-on: + # - upload_pkg_binaries # - identifier: run_e2e_tests_windows # buildspec: codebuild_specs/run_e2e_tests_windows.yml # env: From 96ab27d3bca8aac4fe623e29138726b539a5bc6a Mon Sep 17 00:00:00 2001 From: Eddy Varela Date: Tue, 18 Apr 2023 20:29:48 -0400 Subject: [PATCH 61/69] chore: fix error --- codebuild_specs/e2e_workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codebuild_specs/e2e_workflow.yml b/codebuild_specs/e2e_workflow.yml index ec9ddcb88d7..e20b164fd87 100644 --- a/codebuild_specs/e2e_workflow.yml +++ b/codebuild_specs/e2e_workflow.yml @@ -86,7 +86,7 @@ batch: compute-type: BUILD_GENERAL1_LARGE depend-on: - publish_to_local_registry - - identifier: upload_pkg_binaries.yml + - identifier: upload_pkg_binaries buildspec: codebuild_specs/upload_pkg_binaries.yml env: compute-type: BUILD_GENERAL1_LARGE From c84f672445589b0042e224a3bf2f9f1b7b21b783 Mon Sep 17 00:00:00 2001 From: Eddy Varela Date: Tue, 18 Apr 2023 20:36:35 -0400 Subject: [PATCH 62/69] fix binaries problem --- codebuild_specs/e2e_workflow.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/codebuild_specs/e2e_workflow.yml b/codebuild_specs/e2e_workflow.yml index e20b164fd87..66c851059d9 100644 --- a/codebuild_specs/e2e_workflow.yml +++ b/codebuild_specs/e2e_workflow.yml @@ -86,6 +86,15 @@ batch: compute-type: BUILD_GENERAL1_LARGE depend-on: - publish_to_local_registry + - identifier: build_pkg_binaries_win + buildspec: codebuild_specs/build_pkg_binaries_win.yml + env: + type: WINDOWS_SERVER_2019_CONTAINER + compute-type: BUILD_GENERAL1_LARGE + image: aws/codebuild/windows-base:2019-2.0 + depend-on: + - publish_to_local_registry + - identifier: upload_pkg_binaries buildspec: codebuild_specs/upload_pkg_binaries.yml env: @@ -95,6 +104,7 @@ batch: - build_pkg_binaries_linux - build_pkg_binaries_macos - build_pkg_binaries_win + - identifier: verify_versions_match buildspec: codebuild_specs/verify_versions_match.yml depend-on: From 6f465d37501bb02affa5f09dee48a023bd4065f3 Mon Sep 17 00:00:00 2001 From: Eddy Varela Date: Tue, 18 Apr 2023 20:54:44 -0400 Subject: [PATCH 63/69] chore: trigger builds --- codebuild_specs/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codebuild_specs/lint.yml b/codebuild_specs/lint.yml index 9f9e195c97e..9cfa007b5fb 100644 --- a/codebuild_specs/lint.yml +++ b/codebuild_specs/lint.yml @@ -2,7 +2,7 @@ version: 0.2 env: shell: bash variables: - NODE_OPTIONS: --max-old-space-size=5120 + NODE_OPTIONS: --max-old-space-size=5121 phases: build: commands: From 8df2cef05eaa8a2581a5d5516e79d89b701d14d8 Mon Sep 17 00:00:00 2001 From: Eddy Varela Date: Tue, 18 Apr 2023 20:57:25 -0400 Subject: [PATCH 64/69] chore: change name --- codebuild_specs/e2e_workflow.yml | 2 +- codebuild_specs/integration_test.yml | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/codebuild_specs/e2e_workflow.yml b/codebuild_specs/e2e_workflow.yml index 66c851059d9..8d71babae9d 100644 --- a/codebuild_specs/e2e_workflow.yml +++ b/codebuild_specs/e2e_workflow.yml @@ -23,7 +23,7 @@ batch: depend-on: - build_linux - identifier: integration_test - buildspec: codebuild_specs/integration_tests.yml + buildspec: codebuild_specs/integration_test.yml env: compute-type: BUILD_GENERAL1_LARGE - identifier: mock_e2e_tests diff --git a/codebuild_specs/integration_test.yml b/codebuild_specs/integration_test.yml index 8b5b7fed2f8..6aa019ca8cb 100644 --- a/codebuild_specs/integration_test.yml +++ b/codebuild_specs/integration_test.yml @@ -1,9 +1,6 @@ version: 0.2 env: shell: bash - variables: - - AUTH_CLONE_URL: Ref to Secrets manager #TODO - - API_CLONE_URL: Ref to secrets manager #TODO phases: build: commands: From 074aa470c2a3236d7f853983eabe67d9f850a17b Mon Sep 17 00:00:00 2001 From: Eddy Varela Date: Tue, 18 Apr 2023 21:00:16 -0400 Subject: [PATCH 65/69] chore: add dependency on build_linux --- codebuild_specs/e2e_workflow.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/codebuild_specs/e2e_workflow.yml b/codebuild_specs/e2e_workflow.yml index 8d71babae9d..21589333552 100644 --- a/codebuild_specs/e2e_workflow.yml +++ b/codebuild_specs/e2e_workflow.yml @@ -26,6 +26,8 @@ batch: buildspec: codebuild_specs/integration_test.yml env: compute-type: BUILD_GENERAL1_LARGE + depend-on: + - build_linux - identifier: mock_e2e_tests buildspec: codebuild_specs/mock_e2e_tests.yml env: From 04545bcd37284a3e75ff9d4b7fbdd27e5a2e5c2a Mon Sep 17 00:00:00 2001 From: Eddy Varela Date: Wed, 19 Apr 2023 11:32:28 -0400 Subject: [PATCH 66/69] Update shared-scripts.sh --- shared-scripts.sh | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/shared-scripts.sh b/shared-scripts.sh index b8b59498301..ef9e01205e2 100644 --- a/shared-scripts.sh +++ b/shared-scripts.sh @@ -377,17 +377,6 @@ function _integrationTests { # make file executable cd .circleci/ && chmod +x aws.sh - #setting up dependencies - apt-get update - apt-get install -y sudo - sudo apt-get install -y tcl - sudo apt-get install -y expect - sudo apt-get install -y zip - sudo apt-get install -y lsof - sudo apt-get install -y python python-pip libpython-dev - sudo apt-get install -y jq - pip install awscli - # don't know what this does expect .circleci/aws_configure.exp From 8525247d389fba52c6d0883e1ccc101070181ebd Mon Sep 17 00:00:00 2001 From: Eddy Varela Date: Wed, 19 Apr 2023 11:33:24 -0400 Subject: [PATCH 67/69] Update shared-scripts.sh --- shared-scripts.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/shared-scripts.sh b/shared-scripts.sh index ef9e01205e2..332364e4b4f 100644 --- a/shared-scripts.sh +++ b/shared-scripts.sh @@ -374,6 +374,9 @@ function _integrationTests { loadCache repo $CODEBUILD_SRC_DIR loadCache .cache $HOME/.cache + echo $AUTH_CLONE_URL + echo $API_CLONE_URL + # make file executable cd .circleci/ && chmod +x aws.sh From c049c18e5fcc4ae63e66c72da0553fb7d558c9d4 Mon Sep 17 00:00:00 2001 From: Eddy Varela Date: Wed, 19 Apr 2023 12:51:42 -0400 Subject: [PATCH 68/69] Update integration_test.yml --- codebuild_specs/integration_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codebuild_specs/integration_test.yml b/codebuild_specs/integration_test.yml index 6aa019ca8cb..e8ca39bb4ed 100644 --- a/codebuild_specs/integration_test.yml +++ b/codebuild_specs/integration_test.yml @@ -4,4 +4,4 @@ env: phases: build: commands: - - source ./shared-scripts.sh && _integrationTests + - source ./circleci && ./shared-scripts.sh && _integrationTests From 47f57099084d420643213f15ecd4cc974f57a10e Mon Sep 17 00:00:00 2001 From: Eddy Varela Date: Wed, 19 Apr 2023 12:53:26 -0400 Subject: [PATCH 69/69] Update shared-scripts.sh --- shared-scripts.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/shared-scripts.sh b/shared-scripts.sh index 332364e4b4f..153f1603b64 100644 --- a/shared-scripts.sh +++ b/shared-scripts.sh @@ -377,6 +377,7 @@ function _integrationTests { echo $AUTH_CLONE_URL echo $API_CLONE_URL + source .circleci/ # make file executable cd .circleci/ && chmod +x aws.sh @@ -456,7 +457,7 @@ function _integrationTests { storeCache $HOME/aws-amplify-cypress-api/cypress/videos ~aws-amplify-cypress-api/cypress/videos storeCache $HOME/aws-amplify-cypress-api/cypress/screenshots ~aws-amplify-cypress-api/cypress/screenshots - echo integration testing not implemented yet... + echo integration tests completed } function _cleanupResources { #restore cache