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 e5426b9
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,31 @@ 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
- run: node --version
- run: yarn --version
- run: git config --global core.longpaths true

setup_bazel_rbe:
parameters:
key:
Expand Down Expand Up @@ -326,11 +344,8 @@ jobs:
- run:
name: Execute E2E Tests
command: |
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
} else {
node tests\legacy-cli\run_e2e.js --nb-shards=$env:CIRCLE_NODE_TOTAL --shard=$env:CIRCLE_NODE_INDEX
}
mkdir X:/ramdisk/e2e-main
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

workflows:
Expand Down

0 comments on commit e5426b9

Please sign in to comment.