Skip to content

Commit 2589df0

Browse files
alan-agius4angular-robot[bot]
authored andcommitted
Revert "test: run legacy-cli e2e tests via bazel"
This reverts commit 794e33a.
1 parent c9608f5 commit 2589df0

26 files changed

+119
-652
lines changed

.bazelrc

-4
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,6 @@ build:snapshot --workspace_status_command="yarn -s ng-dev release build-env-stam
9090
build:snapshot --stamp
9191
build:snapshot --//:enable_snapshot_repo_deps
9292

93-
build:e2e --workspace_status_command="yarn -s ng-dev release build-env-stamp --mode=release"
94-
build:e2e --stamp
95-
test:e2e --test_timeout=3600
96-
9793
build:local --//:enable_package_json_tar_deps
9894

9995
###############################

.circleci/dynamic_config.yml

+18-171
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,7 @@ var_6: &only_pull_requests
4848
only:
4949
- /pull\/\d+/
5050

51-
# All e2e test suites
5251
var_7: &all_e2e_subsets ['npm', 'esbuild', 'yarn']
53-
var_8: &all_e2e_build_types ['e2e', 'snapshot']
5452

5553
# Executor Definitions
5654
# https://circleci.com/docs/2.0/reusing-config/#authoring-reusable-executors
@@ -65,20 +63,10 @@ executors:
6563
working_directory: ~/ng
6664
resource_class: small
6765

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-
7866
windows-executor:
7967
# Same as https://circleci.com/orbs/registry/orb/circleci/windows, but named.
8068
working_directory: ~/ng
81-
resource_class: windows.large
69+
resource_class: windows.medium
8270
shell: powershell.exe -ExecutionPolicy Bypass
8371
machine:
8472
# Contents of this image:
@@ -128,7 +116,7 @@ commands:
128116
- initialize_env
129117
- run: nvm install 16.13
130118
- run: nvm use 16.13
131-
- run: npm install -g [email protected] @bazel/bazelisk@${BAZELISK_VERSION}
119+
- run: npm install -g [email protected]
132120
- run: node --version
133121
- run: yarn --version
134122

@@ -138,7 +126,6 @@ commands:
138126
type: env_var_name
139127
default: CIRCLE_PROJECT_REPONAME
140128
steps:
141-
- run: sudo cp .circleci/bazel.rc /etc/bazel.bazelrc
142129
- devinfra/setup-bazel-remote-exec:
143130
bazelrc: ./.bazelrc.user
144131

@@ -282,24 +269,23 @@ jobs:
282269
paths:
283270
- dist/_*.tgz
284271

285-
bazel-build:
286-
executor: bazel-executor
272+
build-bazel-e2e:
273+
executor: action-executor
274+
resource_class: medium
287275
steps:
288276
- custom_attach_workspace
289-
- setup_bazel_rbe
290-
- run:
291-
name: Bazel Build Packages
292-
command: yarn bazel build //...
293-
- fail_fast
277+
- run: yarn bazel build //tests/legacy-cli/...
294278

295-
bazel-test:
296-
executor: bazel-executor
279+
unit-test:
280+
executor: action-executor
281+
resource_class: xlarge
297282
parameters:
298283
nodeversion:
299284
type: string
300285
default: *default_nodeversion_major
301286
steps:
302287
- custom_attach_workspace
288+
- browser-tools/install-chrome
303289
- setup_bazel_rbe
304290
- run: sudo cp .circleci/bazel.rc /etc/bazel.bazelrc
305291
- when:
@@ -325,59 +311,6 @@ jobs:
325311
no_output_timeout: 40m
326312
- fail_fast
327313

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-
381314
snapshot_publish:
382315
executor: action-executor
383316
resource_class: medium
@@ -449,48 +382,6 @@ jobs:
449382
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"
450383
- fail_fast
451384

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-
494385
workflows:
495386
version: 2
496387
default_workflow:
@@ -566,66 +457,22 @@ workflows:
566457
# These jobs only really depend on Setup, but the build job is very quick to run (~35s) and
567458
# will catch any build errors before proceeding to the more lengthy and resource intensive
568459
# Bazel jobs.
569-
- bazel-test:
460+
- unit-test:
570461
name: test-node<< matrix.nodeversion >>
571462
matrix:
572463
parameters:
573464
nodeversion: *all_nodeversion_major
574465
requires:
575-
- bazel-build
576-
577-
# Windows jobs
578-
- e2e-cli-win
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
466+
- build
600467

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
468+
# Compile the e2e tests with bazel to ensure the non-runtime typescript
469+
# compilation completes succesfully.
470+
- build-bazel-e2e:
617471
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\/.*/
472+
- build
625473

626-
- bazel-test-browsers:
627-
requires:
628-
- bazel-build
474+
# Windows jobs
475+
- e2e-cli-win
629476

630477
# Publish jobs
631478
- snapshot_publish:

.circleci/env.sh

-5
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,3 @@ 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

+1-2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,5 @@ if (-not (Test-Path -Path $aimContents)) {
2626
./aim/cli/x64/aim_ll.exe --install ./aim/drivers
2727

2828
# Setup RAM disk mount. Same parameters as ImDisk
29-
# Ensure size is large enough to support the bazel 'shard_count's such as for e2e tests.
3029
# See: https://support.circleci.com/hc/en-us/articles/4411520952091-Create-a-windows-RAM-disk
31-
./aim/cli/x64/aim_ll.exe -a -s 12G -m X: -p "/fs:ntfs /q /y"
30+
./aim/cli/x64/aim_ll.exe -a -s 5G -m X: -p "/fs:ntfs /q /y"

BUILD.bazel

-9
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
# Use of this source code is governed by an MIT-style license that can be
44
# found in the LICENSE file at https://angular.io/license
55
load("@bazel_skylib//rules:common_settings.bzl", "bool_flag")
6-
load("@build_bazel_rules_nodejs//:index.bzl", "copy_to_bin")
76

87
package(default_visibility = ["//visibility:public"])
98

@@ -17,14 +16,6 @@ exports_files([
1716
"package.json",
1817
])
1918

20-
# Files required by e2e tests
21-
copy_to_bin(
22-
name = "config-files",
23-
srcs = [
24-
"package.json",
25-
],
26-
)
27-
2819
# Detect if the build is running under --stamp
2920
config_setting(
3021
name = "stamp",

WORKSPACE

-11
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,3 @@ nodejs_register_toolchains(
9898
name = "node16",
9999
node_version = "16.13.1",
100100
)
101-
102-
register_toolchains(
103-
"@npm//@angular/build-tooling/bazel/git-toolchain:git_linux_toolchain",
104-
"@npm//@angular/build-tooling/bazel/git-toolchain:git_macos_x86_toolchain",
105-
"@npm//@angular/build-tooling/bazel/git-toolchain:git_macos_arm64_toolchain",
106-
"@npm//@angular/build-tooling/bazel/git-toolchain:git_windows_toolchain",
107-
)
108-
109-
load("@npm//@angular/build-tooling/bazel/browsers:browser_repositories.bzl", "browser_repositories")
110-
111-
browser_repositories()

docs/DEVELOPER.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ You can find more info about debugging [tests with Bazel in the docs.](https://g
8585
- Compile the packages being tested: `yarn build`
8686
- Run all tests: `node tests/legacy-cli/run_e2e.js`
8787
- Run a subset of the tests: `node tests/legacy-cli/run_e2e.js tests/legacy-cli/e2e/tests/i18n/ivy-localize-*`
88-
- Run on a custom set of npm packages (tar files): `node tests/legacy-cli/run_e2e.js --package _angular_cli.tgz _angular_create.tgz dist/*.tgz tests/legacy-cli/e2e/tests/i18n/ivy-localize-*`
88+
- Run on a custom set of npm packages (tar files): `node tests/legacy-cli/run_e2e.js --package _angular_cli.tgz _angular_create.tgz dist/*.tgz ...`
8989

9090
When running the debug commands, Node will stop and wait for a debugger to attach.
9191
You can attach your IDE to the debugger to stop on breakpoints and step through the code. Also, see [IDE Specific Usage](#ide-specific-usage) for a

packages/angular/cli/src/utilities/version.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class Version {
2323
}
2424
}
2525

26-
// TODO(bazel): Convert this to use build-time version stamping after flipping the build script to use bazel
26+
// TODO: Convert this to use build-time version stamping after flipping the build script to use bazel
2727
// export const VERSION = new Version('0.0.0-PLACEHOLDER');
2828
export const VERSION = new Version(
2929
(

tests/legacy-cli/BUILD.bazel

+1-11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
load("//tools:defaults.bzl", "ts_library")
2-
load(":e2e.bzl", "e2e_suites")
32

43
ts_library(
54
name = "runner",
@@ -12,25 +11,16 @@ ts_library(
1211
deps = [
1312
"//packages/angular_devkit/core",
1413
"//packages/angular_devkit/core/node",
14+
"//tests/legacy-cli/e2e/assets",
1515
"//tests/legacy-cli/e2e/utils",
1616
"@npm//@types/glob",
1717
"@npm//@types/yargs-parser",
1818
"@npm//ansi-colors",
1919
"@npm//yargs-parser",
20-
],
21-
)
2220

23-
e2e_suites(
24-
name = "e2e",
25-
data = [
26-
":runner",
27-
28-
# Tests + setup
2921
# Loaded dynamically at runtime, not compiletime deps
30-
"//tests/legacy-cli/e2e/assets",
3122
"//tests/legacy-cli/e2e/setup",
3223
"//tests/legacy-cli/e2e/initialize",
3324
"//tests/legacy-cli/e2e/tests",
3425
],
35-
runner = ":e2e_runner.ts",
3626
)

0 commit comments

Comments
 (0)