Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: run e2e tests in parallel #674

Merged
merged 20 commits into from
Nov 17, 2023
Merged

test: run e2e tests in parallel #674

merged 20 commits into from
Nov 17, 2023

Conversation

sobolk
Copy link
Member

@sobolk sobolk commented Nov 16, 2023

Issue #, if available:

Description of changes:

This PR enables parallelization in our e2e tests.

Runtime before:
image

Runtime after:
image

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@sobolk sobolk added the run-e2e Label that will include e2e tests in PR checks workflow label Nov 16, 2023
Copy link

changeset-bot bot commented Nov 16, 2023

🦋 Changeset detected

Latest commit: 1213a13

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@aws-amplify/integration-tests Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@sobolk sobolk marked this pull request as ready for review November 16, 2023 21:37

createProject = async (e2eProjectDir: string): Promise<TestProjectBase> => {
const { projectName, projectRoot, projectAmplifyDir } =
await createEmptyAmplifyProject('typescript-idiom', e2eProjectDir);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can use the this.name here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we move these files in a test-project-setup directory or something? Keep the test files only here

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file no longer returns test_projects or contains, perhaps it should be renamed test_project_creator_creator 🤣 ?

Amplifiyer
Amplifiyer previously approved these changes Nov 16, 2023
@@ -10,7 +10,7 @@ runs:
path: |
node_modules
packages/**/node_modules
key: ${{ runner.os }}-${{ hashFiles('package-lock.json') }}
key: ${{ runner.os }}-${{ hashFiles('package-lock.json') }}-v2
Copy link
Member Author

@sobolk sobolk Nov 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is needed to invalidate cache that's incompatible with larger worker and is leading to, will be reverted in subsequent PRs:

Prepare all required actions
Getting action download info
Download action repository 'actions/cache@885[2](https://github.com/aws-amplify/amplify-backend/actions/runs/6899407583/job/18770983822#step:4:2)2ab9f39a2ea568f7027eddc7d8d8bc9d59c8' (SHA:88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8)
Run ./.github/actions/restore_build_cache
Prepare all required actions
Getting action download info
Run ./.github/actions/restore_install_cache
Run actions/cache@88522ab9f[3](https://github.com/aws-amplify/amplify-backend/actions/runs/6899407583/job/18770983822#step:4:3)9a2ea568f7027eddc7d8d8bc9d59c8
Received 13[4](https://github.com/aws-amplify/amplify-backend/actions/runs/6899407583/job/18770983822#step:4:4)217728 of 24[5](https://github.com/aws-amplify/amplify-backend/actions/runs/6899407583/job/18770983822#step:4:6)825942 (54.[6](https://github.com/aws-amplify/amplify-backend/actions/runs/6899407583/job/18770983822#step:4:7)%), 126.2 MBs/sec
Received 245825942 of 245825942 (100.0%), 133.0 MBs/sec
Cache Size: ~234 MB (245825942 B)
"C:\Program Files\Git\usr\bin\tar.exe" -xf C:/a/_temp/00c0e1[7](https://github.com/aws-amplify/amplify-backend/actions/runs/6899407583/job/18770983822#step:4:8)2-e349-4f14-92f9-10005a622fb[8](https://github.com/aws-amplify/amplify-backend/actions/runs/6899407583/job/18770983822#step:4:10)/cache.tzst -P -C C:/a/amplify-backend/amplify-backend --force-local --use-compress-program "zstd -d"
Cache restored successfully
Cache restored from key: Windows-418f36fb2696ff545b34d4f90f527534293b1ff5110a4729ea71303b9b53485d
Run actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8
Received 1342[17](https://github.com/aws-amplify/amplify-backend/actions/runs/6899407583/job/18770983822#step:4:20)728 of 167938[22](https://github.com/aws-amplify/amplify-backend/actions/runs/6899407583/job/18770983822#step:4:25)8 (79.9%), 114.7 MBs/sec
Received 167938228 of 167938228 (100.0%), 116.9 MBs/sec
Cache Size: ~160 MB (167938228 B)
"C:\Program Files\Git\usr\bin\tar.exe" -xf C:/a/_temp/bb0ebe96-47ed-43e9-890f-ead3ad[23](https://github.com/aws-amplify/amplify-backend/actions/runs/6899407583/job/18770983822#step:4:26)ea8b/cache.tzst -P -C C:/a/amplify-backend/amplify-backend --force-local --use-compress-program "zstd -d"
/usr/bin/tar: node_modules/@aws-amplify/auth-construct-alpha/lib: Cannot mkdir: No medium found
/usr/bin/tar: node_modules/@aws-amplify/auth-construct-alpha/lib/defaults.d.ts.map: Cannot open: No medium found
/usr/bin/tar: node_modules/@aws-amplify/auth-construct-alpha/lib/string_maps.d.ts.map: Cannot open: No medium found
/usr/bin/tar: node_modules/@aws-amplify/auth-construct-alpha/lib/construct.js: Cannot open: No medium found
/usr/bin/tar: node_modules/@aws-amplify/auth-construct-alpha/lib/string_maps.js: Cannot open: No medium found
/usr/bin/tar: node_modules/@aws-amplify/auth-construct-alpha/lib/trigger_events.d.ts: Cannot open: No medium found
/usr/bin/tar: node_modules/@aws-amplify/auth-construct-alpha/lib/index.js: Cannot open: No medium found
/usr/bin/tar: node_modules/@aws-amplify/auth-construct-alpha/lib/trigger_events.js: Cannot open: No medium found

Comment on lines +17 to +20
# Windows install must happen on the same worker size as subsequent jobs.
# Larger workers use different drive (C: instead of D:) to check out project and NPM installation
# creates file system links that include drive letter.
os: [ubuntu-latest, macos-latest, amplify-backend_windows-latest_8-core]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

@alharris-at alharris-at left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving, since I don't think the dup changeset has any negative impact.

Comment on lines +1 to +2
---
---
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a duplicate changeset file?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, I had to add non-empty to force local publish.
This is harmless and disappears during releases.

await testProject.tearDown(branchBackendIdentifier);
});

void it(`[${testProjectCreator.name}] deploys fully`, async () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: having project name here and on line 39 is repetitive

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same for sandbox, but it doesn't seem to produce bad output, so I skipped this.

@sobolk sobolk merged commit fe2d96f into main Nov 17, 2023
22 checks passed
@sobolk sobolk deleted the parallelize-deployment-tests branch November 17, 2023 16:13

void describe(
'create-amplify script',
{ concurrency: testConcurrencyLevel },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's where the parallel magic happens. ref: https://nodejs.org/api/test.html#testname-options-fn

This was referenced Dec 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
run-e2e Label that will include e2e tests in PR checks workflow
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants