-
Notifications
You must be signed in to change notification settings - Fork 61
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
Conversation
🦋 Changeset detectedLatest commit: 1213a13 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
|
||
createProject = async (e2eProjectDir: string): Promise<TestProjectBase> => { | ||
const { projectName, projectRoot, projectAmplifyDir } = | ||
await createEmptyAmplifyProject('typescript-idiom', e2eProjectDir); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
🤣 ?
@@ -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 |
There was a problem hiding this comment.
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
# 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] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this 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.
--- | ||
--- |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 () => { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
|
||
void describe( | ||
'create-amplify script', | ||
{ concurrency: testConcurrencyLevel }, |
There was a problem hiding this comment.
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
Issue #, if available:
Description of changes:
This PR enables parallelization in our e2e tests.
Runtime before:
Runtime after:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.