Skip to content

Commit

Permalink
ci: use RAM disk for Windows tests
Browse files Browse the repository at this point in the history
Windows is IO bound which causes tests to take signifintly longer than Linux.

With this change we introduce the use of RAM disk on Windows instead of a physical disk to store tests projects files which reduces this overhead.

While Circle CI docs mention to use `ImDisk` https://support.circleci.com/hc/en-us/articles/4411520952091-Create-a-windows-RAM-disk, we use a different tool Arsenal Image Mounter `aim_ll` due to following Node.js issue: nodejs/node#6861

The `aim_ll` CLI is based on `ImDisk` and is parameter compatible.

From testing a full run of the Windows E2E full test suit goes from ~56min to ~35mins

With RAM disk
https://app.circleci.com/pipelines/github/angular/angular-cli/23286/workflows/4b1dc425-f7ed-49d6-aeba-b2c503d08756/jobs/309423/parallel-runs/2?filterBy=ALL

Without RAM Disk
https://app.circleci.com/pipelines/github/angular/angular-cli/23256/workflows/3f551c3c-fbb0-445f-80f9-1801d4adc664/jobs/309312
  • Loading branch information
alan-agius4 committed Jun 9, 2022
1 parent 511988a commit 60dfc10
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,25 @@ commands:
at: *workspace_location
setup_windows:
steps:
- run:
# We use Arsenal Image Mounter (AIM) instead of ImDisk because of: https://github.com/nodejs/node/issues/6861
# Useful resources for AIM: http://reboot.pro/index.php?showtopic=22068
name: 'Arsenal Image Mounter (RAM Disk)'
command: |
# Download AIM Drivers
Invoke-WebRequest 'https://github.com/ArsenalRecon/Arsenal-Image-Mounter/raw/988930e4b3180ec34661504e6f9906f98943a022/DriverSetup/DriverFiles.zip' -OutFile 'aim_drivers.zip' -UseBasicParsing
Expand-Archive -Path 'aim_drivers.zip'
# Download AIM CLI
Invoke-WebRequest 'https://github.com/ArsenalRecon/Arsenal-Image-Mounter/raw/988930e4b3180ec34661504e6f9906f98943a022/Command%20line%20applications/aim_ll.zip' -OutFile 'aim_ll.zip' -UseBasicParsing
Expand-Archive -Path 'aim_ll.zip'
# Install AIM drivers
./aim_ll/x64/aim_ll.exe --install ./aim_drivers
# Setup RAM disk mount. Same parameters as ImDisk
# See: https://support.circleci.com/hc/en-us/articles/4411520952091-Create-a-windows-RAM-disk
./aim_ll/x64/aim_ll.exe -a -s 5G -m X: -p "/fs:ntfs /q /y"
- run: nvm install 16.10
- run: nvm use 16.10
- run: npm install -g yarn@1.22.10
Expand Down Expand Up @@ -326,10 +345,11 @@ jobs:
- run:
name: Execute E2E Tests
command: |
mkdir X:/ramdisk/e2e-main
if (Test-Path env:CIRCLE_PULL_REQUEST) {
node tests\legacy-cli\run_e2e.js "--glob={tests/basic/**,tests/i18n/extract-ivy*.ts,tests/build/profile.ts,tests/test/test-sourcemap.ts,tests/misc/check-postinstalls.ts}" --nb-shards=$env:CIRCLE_NODE_TOTAL --shard=$env:CIRCLE_NODE_INDEX
node tests\legacy-cli\run_e2e.js "--glob={tests/basic/**,tests/i18n/extract-ivy*.ts,tests/build/profile.ts,tests/test/test-sourcemap.ts,tests/misc/check-postinstalls.ts}" --nb-shards=$env:CIRCLE_NODE_TOTAL --shard=$env:CIRCLE_NODE_INDEX --tmpdir=X:/ramdisk/e2e-main
} else {
node tests\legacy-cli\run_e2e.js --nb-shards=$env:CIRCLE_NODE_TOTAL --shard=$env:CIRCLE_NODE_INDEX
node tests\legacy-cli\run_e2e.js --nb-shards=$env:CIRCLE_NODE_TOTAL --shard=$env:CIRCLE_NODE_INDEX --tmpdir=X:/ramdisk/e2e-main
}
- fail_fast

Expand Down

0 comments on commit 60dfc10

Please sign in to comment.