Skip to content

Commit ece191e

Browse files
committed
test: enable bazel e2e windows ci job
1 parent 361ba88 commit ece191e

5 files changed

Lines changed: 55 additions & 4 deletions

File tree

.bazelrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ build:snapshot --//:enable_snapshot_repo_deps
9292

9393
build:e2e --workspace_status_command="yarn -s ng-dev release build-env-stamp --mode=release"
9494
build:e2e --stamp
95-
test:e2e --test_timeout=1800
95+
test:e2e --test_timeout=3600
9696

9797
build:local --//:enable_package_json_tar_deps
9898

.circleci/dynamic_config.yml

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ executors:
8787
windows-executor:
8888
# Same as https://circleci.com/orbs/registry/orb/circleci/windows, but named.
8989
working_directory: ~/ng
90-
resource_class: windows.medium
90+
resource_class: windows.2xlarge
9191
shell: powershell.exe -ExecutionPolicy Bypass
9292
machine:
9393
# Contents of this image:
@@ -138,7 +138,7 @@ commands:
138138
- initialize_env
139139
- run: nvm install 16.10
140140
- run: nvm use 16.10
141-
- run: npm install -g yarn@1.22.10
141+
- run: npm install -g yarn@1.22.10 @bazel/bazelisk@${BAZELISK_VERSION}
142142
- run: node --version
143143
- run: yarn --version
144144

@@ -470,6 +470,44 @@ jobs:
470470
node tests\legacy-cli\run_e2e.js --nb-shards=$env:CIRCLE_NODE_TOTAL --shard=$env:CIRCLE_NODE_INDEX --tmpdir=X:/ramdisk/e2e-main --ignore="tests/misc/browsers.ts"
471471
- fail_fast
472472

473+
bazel-e2e-cli-win:
474+
executor: windows-executor
475+
parallelism: 8
476+
steps:
477+
- checkout
478+
- rebase_pr
479+
- setup_windows
480+
- restore_cache:
481+
keys:
482+
- *cache_key_win
483+
- run:
484+
# We use Arsenal Image Mounter (AIM) instead of ImDisk because of: https://github.com/nodejs/node/issues/6861
485+
# Useful resources for AIM: http://reboot.pro/index.php?showtopic=22068
486+
name: 'Arsenal Image Mounter (RAM Disk)'
487+
command: |
488+
pwsh ./.circleci/win-ram-disk.ps1
489+
- run: yarn install --frozen-lockfile --cache-folder ~/.cache/yarn
490+
- save_cache:
491+
key: *cache_key_win
492+
paths:
493+
- ~/.cache/yarn
494+
# Path where Arsenal Image Mounter files are downloaded.
495+
# Must match path in .circleci/win-ram-disk.ps1
496+
- ./aim
497+
- run:
498+
name: Execute E2E Tests
499+
command: |
500+
mkdir X:/ramdisk/e2e
501+
bazel test --define=E2E_TEMP=X:/ramdisk/e2e --define=E2E_SHARD_TOTAL=${CIRCLE_NODE_TOTAL} --define=E2E_SHARD=${CIRCLE_NODE_INDEX} //tests/legacy-cli:e2e.npm
502+
# This timeout provides time for the actual tests to timeout and report status
503+
# instead of CircleCI stopping the job without test failure information.
504+
no_output_timeout: 40m
505+
- fail_fast
506+
- store_artifacts:
507+
path: dist/testlogs/tests/legacy-cli/e2e.npm
508+
- store_test_results:
509+
path: dist/testlogs/tests/legacy-cli/e2e.npm
510+
473511
workflows:
474512
version: 2
475513
default_workflow:
@@ -556,6 +594,8 @@ workflows:
556594
# Windows jobs
557595
- e2e-cli-win
558596

597+
- bazel-e2e-cli-win
598+
559599
# Bazel jobs
560600
- bazel-build:
561601
requires:

.circleci/env.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,8 @@ source $BASH_ENV;
3636

3737
# Disable husky.
3838
setPublicVar HUSKY 0
39+
40+
# Expose the Bazelisk version. We need to run Bazelisk globally since Windows has problems launching
41+
# Bazel from a node modules directoy that might be modified by the Bazel Yarn install then.
42+
setPublicVar BAZELISK_VERSION \
43+
"$(cd ${PROJECT_ROOT}; node -p 'require("./package.json").devDependencies["@bazel/bazelisk"]')"

.circleci/win-ram-disk.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ if (-not (Test-Path -Path $aimContents)) {
2727

2828
# Setup RAM disk mount. Same parameters as ImDisk
2929
# See: https://support.circleci.com/hc/en-us/articles/4411520952091-Create-a-windows-RAM-disk
30-
./aim/cli/x64/aim_ll.exe -a -s 5G -m X: -p "/fs:ntfs /q /y"
30+
./aim/cli/x64/aim_ll.exe -a -s 12G -m X: -p "/fs:ntfs /q /y"

tests/legacy-cli/e2e/tests/build/esbuild-unsupported.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
import { join } from 'path';
2+
import { IS_BAZEL } from '../../utils/bazel';
23
import { execWithEnv } from '../../utils/process';
34

45
export default async function () {
6+
// TODO(bazel): fails with bazel on windows
7+
if (IS_BAZEL && process.platform.startsWith('win')) {
8+
return;
9+
}
10+
511
// Set the esbuild native binary path to a non-existent file to simulate a spawn error.
612
// The build should still succeed by falling back to the WASM variant of esbuild.
713
await execWithEnv('ng', ['build'], {

0 commit comments

Comments
 (0)