@@ -48,7 +48,9 @@ var_6: &only_pull_requests
48
48
only :
49
49
- /pull\/\d+/
50
50
51
+ # All e2e test suites
51
52
var_7 : &all_e2e_subsets ['npm', 'esbuild', 'yarn']
53
+ var_8 : &all_e2e_build_types ['e2e', 'snapshot']
52
54
53
55
# Executor Definitions
54
56
# https://circleci.com/docs/2.0/reusing-config/#authoring-reusable-executors
@@ -63,10 +65,20 @@ executors:
63
65
working_directory : ~/ng
64
66
resource_class : small
65
67
68
+ bazel-executor :
69
+ parameters :
70
+ nodeversion :
71
+ type : string
72
+ default : *default_nodeversion
73
+ docker :
74
+ - image : cimg/node:<< parameters.nodeversion >>-browsers
75
+ working_directory : ~/ng
76
+ resource_class : xlarge
77
+
66
78
windows-executor :
67
79
# Same as https://circleci.com/orbs/registry/orb/circleci/windows, but named.
68
80
working_directory : ~/ng
69
- resource_class : windows.medium
81
+ resource_class : windows.large
70
82
shell : powershell.exe -ExecutionPolicy Bypass
71
83
machine :
72
84
# Contents of this image:
@@ -116,7 +128,7 @@ commands:
116
128
- initialize_env
117
129
- run : nvm install 16.13
118
130
- run : nvm use 16.13
119
- - run : npm install -g yarn@1.22.10
131
+ - run : npm install -g yarn@1.22.10 @bazel/bazelisk@${BAZELISK_VERSION}
120
132
- run : node --version
121
133
- run : yarn --version
122
134
@@ -126,6 +138,7 @@ commands:
126
138
type : env_var_name
127
139
default : CIRCLE_PROJECT_REPONAME
128
140
steps :
141
+ - run : sudo cp .circleci/bazel.rc /etc/bazel.bazelrc
129
142
- devinfra/setup-bazel-remote-exec :
130
143
bazelrc : ./.bazelrc.user
131
144
@@ -269,23 +282,24 @@ jobs:
269
282
paths :
270
283
- dist/_*.tgz
271
284
272
- build-bazel-e2e :
273
- executor : action-executor
274
- resource_class : medium
285
+ bazel-build :
286
+ executor : bazel-executor
275
287
steps :
276
288
- custom_attach_workspace
277
- - run : yarn bazel build //tests/legacy-cli/...
289
+ - setup_bazel_rbe
290
+ - run :
291
+ name : Bazel Build Packages
292
+ command : yarn bazel build //...
293
+ - fail_fast
278
294
279
- unit-test :
280
- executor : action-executor
281
- resource_class : xlarge
295
+ bazel-test :
296
+ executor : bazel-executor
282
297
parameters :
283
298
nodeversion :
284
299
type : string
285
300
default : *default_nodeversion_major
286
301
steps :
287
302
- custom_attach_workspace
288
- - browser-tools/install-chrome
289
303
- setup_bazel_rbe
290
304
- run : sudo cp .circleci/bazel.rc /etc/bazel.bazelrc
291
305
- when :
@@ -311,6 +325,59 @@ jobs:
311
325
no_output_timeout : 40m
312
326
- fail_fast
313
327
328
+ bazel-e2e-tests :
329
+ executor : bazel-executor
330
+ parallelism : 8
331
+ parameters :
332
+ build_type :
333
+ type : enum
334
+ enum : *all_e2e_build_types
335
+ default : ' e2e'
336
+ subset :
337
+ type : enum
338
+ enum : *all_e2e_subsets
339
+ default : ' npm'
340
+ steps :
341
+ - custom_attach_workspace
342
+ - initialize_env
343
+ - setup_bazel_rbe
344
+ - run : mkdir /mnt/ramdisk/e2e
345
+ - run :
346
+ name : Test << parameters.build_type >> << parameters.subset >>
347
+ command : yarn bazel test --define=E2E_TEMP=/mnt/ramdisk/e2e --define=E2E_SHARD_TOTAL=${CIRCLE_NODE_TOTAL} --define=E2E_SHARD_INDEX=${CIRCLE_NODE_INDEX} --config=<< parameters.build_type >> //tests/legacy-cli:e2e.<< parameters.subset >>
348
+ no_output_timeout : 40m
349
+ - store_artifacts :
350
+ path : dist/testlogs/tests/legacy-cli/e2e.<< parameters.subset >>
351
+ - store_test_results :
352
+ path : dist/testlogs/tests/legacy-cli/e2e.<< parameters.subset >>
353
+ - fail_fast
354
+
355
+ bazel-test-browsers :
356
+ executor : bazel-executor
357
+ steps :
358
+ - custom_attach_workspace
359
+ - initialize_env
360
+ - setup_bazel_rbe
361
+ - run :
362
+ name : Initialize Saucelabs
363
+ command : setSecretVar SAUCE_ACCESS_KEY $(echo $SAUCE_ACCESS_KEY | rev)
364
+ - run :
365
+ name : Start Saucelabs Tunnel
366
+ command : ./scripts/saucelabs/start-tunnel.sh
367
+ background : true
368
+ # Waits for the Saucelabs tunnel to be ready. This ensures that we don't run tests
369
+ # too early without Saucelabs not being ready.
370
+ - run : ./scripts/saucelabs/wait-for-tunnel.sh
371
+ - run :
372
+ name : E2E Saucelabs Tests
373
+ command : yarn bazel test --config=saucelabs //tests/legacy-cli:e2e.saucelabs
374
+ - run : ./scripts/saucelabs/stop-tunnel.sh
375
+ - store_artifacts :
376
+ path : dist/testlogs/tests/legacy-cli/e2e.saucelabs
377
+ - store_test_results :
378
+ path : dist/testlogs/tests/legacy-cli/e2e.saucelabs
379
+ - fail_fast
380
+
314
381
snapshot_publish :
315
382
executor : action-executor
316
383
resource_class : medium
@@ -382,6 +449,48 @@ jobs:
382
449
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"
383
450
- fail_fast
384
451
452
+ bazel-e2e-cli-win :
453
+ executor : windows-executor
454
+ parallelism : 12
455
+ steps :
456
+ - checkout
457
+ - rebase_pr_win
458
+ - setup_windows
459
+ - restore_cache :
460
+ keys :
461
+ - *cache_key_win
462
+ - run :
463
+ # We use Arsenal Image Mounter (AIM) instead of ImDisk because of: https://github.com/nodejs/node/issues/6861
464
+ # Useful resources for AIM: http://reboot.pro/index.php?showtopic=22068
465
+ name : ' Arsenal Image Mounter (RAM Disk)'
466
+ command : |
467
+ pwsh ./.circleci/win-ram-disk.ps1
468
+ - run : yarn install --frozen-lockfile --cache-folder ~/.cache/yarn
469
+ - save_cache :
470
+ key : *cache_key_win
471
+ paths :
472
+ - ~/.cache/yarn
473
+ # Path where Arsenal Image Mounter files are downloaded.
474
+ # Must match path in .circleci/win-ram-disk.ps1
475
+ - ./aim
476
+ - run :
477
+ name : Execute E2E Tests
478
+ environment :
479
+ # Required by `yarn ng-dev`
480
+ # See https://github.com/angular/angular/issues/46858
481
+ PWD : .
482
+ command : |
483
+ mkdir X:/ramdisk/e2e
484
+ bazel test --define=E2E_TEMP=X:/ramdisk/e2e --define=E2E_SHARD_TOTAL=$env:CIRCLE_NODE_TOTAL --define=E2E_SHARD_INDEX=$env:CIRCLE_NODE_INDEX --config=e2e //tests/legacy-cli:e2e.npm
485
+ # This timeout provides time for the actual tests to timeout and report status
486
+ # instead of CircleCI stopping the job without test failure information.
487
+ no_output_timeout : 40m
488
+ - fail_fast
489
+ - store_artifacts :
490
+ path : dist/testlogs/tests/legacy-cli/e2e.npm
491
+ - store_test_results :
492
+ path : dist/testlogs/tests/legacy-cli/e2e.npm
493
+
385
494
workflows :
386
495
version : 2
387
496
default_workflow :
@@ -457,23 +566,67 @@ workflows:
457
566
# These jobs only really depend on Setup, but the build job is very quick to run (~35s) and
458
567
# will catch any build errors before proceeding to the more lengthy and resource intensive
459
568
# Bazel jobs.
460
- - unit -test :
569
+ - bazel -test :
461
570
name : test-node<< matrix.nodeversion >>
462
571
matrix :
463
572
parameters :
464
573
nodeversion : *all_nodeversion_major
465
574
requires :
466
- - build
467
-
468
- # Compile the e2e tests with bazel to ensure the non-runtime typescript
469
- # compilation completes succesfully.
470
- - build-bazel-e2e :
471
- requires :
472
- - build
575
+ - bazel-build
473
576
474
577
# Windows jobs
475
578
- e2e-cli-win
476
579
580
+ - bazel-e2e-cli-win
581
+
582
+ # Bazel jobs
583
+ - bazel-build :
584
+ requires :
585
+ - setup
586
+
587
+ - bazel-e2e-tests :
588
+ name : bazel-e2e-cli-<< matrix.subset >>
589
+ matrix :
590
+ parameters :
591
+ subset : *all_e2e_subsets
592
+ build_type : ' e2e'
593
+ filters :
594
+ branches :
595
+ ignore :
596
+ - main
597
+ - /\d+\.\d+\.x/
598
+ requires :
599
+ - bazel-build
600
+
601
+ - bazel-e2e-tests :
602
+ name : bazel-e2e-snapshots-<< matrix.subset >>
603
+ matrix :
604
+ parameters :
605
+ subset : *all_e2e_subsets
606
+ build_type : ' snapshot'
607
+ pre-steps :
608
+ - when :
609
+ condition :
610
+ and :
611
+ - not :
612
+ equal : [main, << pipeline.git.branch >>]
613
+ - not : << pipeline.parameters.snapshot_changed >>
614
+ steps :
615
+ # Don't run snapshot E2E's unless it's on the main branch or the snapshots file has been updated.
616
+ - run : circleci-agent step halt
617
+ requires :
618
+ - bazel-build
619
+ filters :
620
+ branches :
621
+ only :
622
+ - main
623
+ # This is needed to run this steps on Renovate PRs that amend the snapshots package.json
624
+ - /^pull\/.*/
625
+
626
+ - bazel-test-browsers :
627
+ requires :
628
+ - bazel-build
629
+
477
630
# Publish jobs
478
631
- snapshot_publish :
479
632
<< : *only_release_branches
0 commit comments