Skip to content

Commit 085a852

Browse files
committed
ci: use RAM disk for Windows tests
Windows is IO bound which causes tests to take significantly 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
1 parent 0600c77 commit 085a852

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

.circleci/config.yml

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,25 @@ commands:
8383
at: *workspace_location
8484
setup_windows:
8585
steps:
86+
- run:
87+
# We use Arsenal Image Mounter (AIM) instead of ImDisk because of: https://github.com/nodejs/node/issues/6861
88+
# Useful resources for AIM: http://reboot.pro/index.php?showtopic=22068
89+
name: 'Arsenal Image Mounter (RAM Disk)'
90+
command: |
91+
# Download AIM Drivers
92+
Invoke-WebRequest 'https://github.com/ArsenalRecon/Arsenal-Image-Mounter/raw/988930e4b3180ec34661504e6f9906f98943a022/DriverSetup/DriverFiles.zip' -OutFile 'aim_drivers.zip' -UseBasicParsing
93+
Expand-Archive -Path 'aim_drivers.zip'
94+
95+
# Download AIM CLI
96+
Invoke-WebRequest 'https://github.com/ArsenalRecon/Arsenal-Image-Mounter/raw/988930e4b3180ec34661504e6f9906f98943a022/Command%20line%20applications/aim_ll.zip' -OutFile 'aim_ll.zip' -UseBasicParsing
97+
Expand-Archive -Path 'aim_ll.zip'
98+
99+
# Install AIM drivers
100+
./aim_ll/x64/aim_ll.exe --install ./aim_drivers
101+
102+
# Setup RAM disk mount. Same parameters as ImDisk
103+
# See: https://support.circleci.com/hc/en-us/articles/4411520952091-Create-a-windows-RAM-disk
104+
./aim_ll/x64/aim_ll.exe -a -s 5G -m X: -p "/fs:ntfs /q /y"
86105
- run: nvm install 16.10
87106
- run: nvm use 16.10
88107
- run: npm install -g [email protected]
@@ -326,10 +345,11 @@ jobs:
326345
- run:
327346
name: Execute E2E Tests
328347
command: |
348+
mkdir X:/ramdisk/e2e-main
329349
if (Test-Path env:CIRCLE_PULL_REQUEST) {
330-
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
350+
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
331351
} else {
332-
node tests\legacy-cli\run_e2e.js --nb-shards=$env:CIRCLE_NODE_TOTAL --shard=$env:CIRCLE_NODE_INDEX
352+
node tests\legacy-cli\run_e2e.js --nb-shards=$env:CIRCLE_NODE_TOTAL --shard=$env:CIRCLE_NODE_INDEX --tmpdir=X:/ramdisk/e2e-main
333353
}
334354
- fail_fast
335355

0 commit comments

Comments
 (0)