Skip to content

Commit

Permalink
chore: reduce size of generated e2e buildspec (#12686)
Browse files Browse the repository at this point in the history
* chore: noop trigger cb

* chore: move compute type for migration tests to specific buildspec files

* chore: shoreten upload_pkg_binaries identifier to reduce buildspec size
  • Loading branch information
goldbez authored May 25, 2023
1 parent e93c218 commit 0dce156
Show file tree
Hide file tree
Showing 7 changed files with 543 additions and 1,037 deletions.
2 changes: 1 addition & 1 deletion codebuild_specs/e2e_workflow_base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ batch:
compute-type: BUILD_GENERAL1_LARGE
depend-on:
- publish_to_local_registry
- identifier: upload_pkg_binaries
- identifier: upb
buildspec: codebuild_specs/upload_pkg_binaries.yml
env:
compute-type: BUILD_GENERAL1_LARGE
Expand Down
1,535 changes: 524 additions & 1,011 deletions codebuild_specs/e2e_workflow_generated.yml

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions codebuild_specs/migration_tests_v10.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
version: 0.2
env:
shell: bash
compute-type: BUILD_GENERAL1_SMALL
variables:
CI: true
CIRCLECI: true
Expand Down
1 change: 1 addition & 0 deletions codebuild_specs/migration_tests_v5.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
version: 0.2
env:
shell: bash
compute-type: BUILD_GENERAL1_SMALL
variables:
CI: true
CIRCLECI: true
Expand Down
1 change: 1 addition & 0 deletions codebuild_specs/migration_tests_v6.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
version: 0.2
env:
shell: bash
compute-type: BUILD_GENERAL1_SMALL
variables:
CI: true
CIRCLECI: true
Expand Down
2 changes: 2 additions & 0 deletions codebuild_specs/run_e2e_tests_windows.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
version: 0.2
env:
shell: powershell.exe
type: WINDOWS_SERVER_2019_CONTAINER
image: $WINDOWS_IMAGE_2019
variables:
CLI_REGION: us-east-1
TEST_SUITE: src/__tests__/auth_2a.test.ts|src/__tests__/auth_2b.test.ts|src/__tests__/auth_2d.test.ts|src/__tests__/auth_2f.test.ts
Expand Down
38 changes: 13 additions & 25 deletions scripts/split-e2e-tests-codebuild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export function loadConfigBase() {
return yaml.load(fs.readFileSync(CODEBUILD_CONFIG_BASE_PATH, 'utf8'));
}
export function saveConfig(config: any): void {
const output = ['# auto generated file. DO NOT EDIT manually', yaml.dump(config, { noRefs: true })];
const output = ['# auto generated file. DO NOT EDIT manually', yaml.dump(config, { noRefs: true, lineWidth: -1 })];
fs.writeFileSync(`${CODEBUILD_GENERATE_CONFIG_PATH}.yml`, output.join('\n'));
}
function getTestFiles(dir: string, pattern = 'src/**/*.test.ts'): string[] {
Expand All @@ -110,7 +110,7 @@ type COMPUTE_TYPE = 'BUILD_GENERAL1_MEDIUM' | 'BUILD_GENERAL1_LARGE';
type BatchBuildJob = {
identifier: string;
env: {
'compute-type': COMPUTE_TYPE;
'compute-type'?: COMPUTE_TYPE;
variables: [string: string];
};
};
Expand Down Expand Up @@ -271,7 +271,7 @@ const splitTestsV3 = (
variables: { WAIT_FOR_IDS_FILE_PATH: waitForIdsFilePath },
},
buildspec: 'codebuild_specs/aggregate_e2e_reports.yml',
'depend-on': ['upload_pkg_binaries'],
'depend-on': ['upb'],
};
result.push(reportsAggregator);
}
Expand All @@ -285,20 +285,14 @@ function main(): void {
{
identifier: 'run_e2e_tests_linux',
buildspec: 'codebuild_specs/run_e2e_tests_linux.yml',
env: {
'compute-type': 'BUILD_GENERAL1_MEDIUM',
},
'depend-on': ['upload_pkg_binaries'],
env: {},
'depend-on': ['upb'],
},
{
identifier: 'run_e2e_tests_windows',
buildspec: 'codebuild_specs/run_e2e_tests_windows.yml',
env: {
type: 'WINDOWS_SERVER_2019_CONTAINER',
'compute-type': 'BUILD_GENERAL1_MEDIUM',
image: '$WINDOWS_IMAGE_2019',
},
'depend-on': ['build_windows', 'upload_pkg_binaries'],
env: {},
'depend-on': ['build_windows', 'upb'],
},
join(REPO_ROOT, 'packages', 'amplify-e2e-tests'),
false,
Expand All @@ -309,10 +303,8 @@ function main(): void {
{
identifier: 'migration_tests_v5',
buildspec: 'codebuild_specs/migration_tests_v5.yml',
env: {
'compute-type': 'BUILD_GENERAL1_SMALL',
},
'depend-on': ['upload_pkg_binaries'],
env: {},
'depend-on': ['upb'],
},
undefined,
join(REPO_ROOT, 'packages', 'amplify-migration-tests'),
Expand All @@ -325,10 +317,8 @@ function main(): void {
{
identifier: 'migration_tests_v6',
buildspec: 'codebuild_specs/migration_tests_v6.yml',
env: {
'compute-type': 'BUILD_GENERAL1_SMALL',
},
'depend-on': ['upload_pkg_binaries'],
env: {},
'depend-on': ['upb'],
},
undefined,
join(REPO_ROOT, 'packages', 'amplify-migration-tests'),
Expand All @@ -341,10 +331,8 @@ function main(): void {
{
identifier: 'migration_tests_v10',
buildspec: 'codebuild_specs/migration_tests_v10.yml',
env: {
'compute-type': 'BUILD_GENERAL1_SMALL',
},
'depend-on': ['upload_pkg_binaries'],
env: {},
'depend-on': ['upb'],
},
undefined,
join(REPO_ROOT, 'packages', 'amplify-migration-tests'),
Expand Down

0 comments on commit 0dce156

Please sign in to comment.