Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove non Bazel E2E CI jobs #24696

Merged
merged 6 commits into from Feb 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
222 changes: 33 additions & 189 deletions .circleci/dynamic_config.yml
Expand Up @@ -29,7 +29,7 @@ var_3: &default_nodeversion '14.20'
var_3_major: &default_nodeversion_major '14'
# The major version of node toolchains. See tools/toolchain_info.bzl
# NOTE: entries in this array may be repeated elsewhere in the file, find them before adding more
var_3_all_major: &all_nodeversion_major ['14', '16']
var_3_all_major: &all_nodeversion_major ['14', '16', '18']
# Workspace initially persisted by the `setup` job, and then enhanced by `setup-and-build-win`.
# https://circleci.com/docs/2.0/workflows/#using-workspaces-to-share-data-among-jobs
# https://circleci.com/blog/deep-diving-into-circleci-workspaces/
Expand Down Expand Up @@ -129,6 +129,7 @@ commands:
steps:
- attach_workspace:
at: *workspace_location

setup_windows:
steps:
- initialize_env
Expand Down Expand Up @@ -158,15 +159,6 @@ commands:
- devinfra/setup-bazel-remote-exec:
shell: bash

install_python:
steps:
- run:
name: 'Install Python 2'
command: |
sudo apt-get update > /dev/null 2>&1
sudo apt-get install -y python
python --version

# Job definitions
jobs:
setup:
Expand Down Expand Up @@ -219,86 +211,7 @@ jobs:
- run: yarn -s admin validate
- run: yarn -s check-tooling-setup

e2e-tests:
parameters:
nodeversion:
type: string
default: *default_nodeversion
snapshots:
type: boolean
default: false
subset:
type: enum
enum: *all_e2e_subsets
default: 'npm'
executor:
name: action-executor
nodeversion: << parameters.nodeversion >>
parallelism: 8
resource_class: large
steps:
- custom_attach_workspace
- browser-tools/install-chrome
- initialize_env
- run: mkdir /mnt/ramdisk/e2e
- when:
condition:
equal: ['npm', << parameters.subset >>]
steps:
- run:
name: Execute CLI E2E Tests with NPM
command: |
node ./tests/legacy-cli/run_e2e --nb-shards=${CIRCLE_NODE_TOTAL} --shard=${CIRCLE_NODE_INDEX} <<# parameters.snapshots >>--ng-snapshots<</ parameters.snapshots >> --tmpdir=/mnt/ramdisk/e2e --ignore="tests/misc/browsers.ts"
- when:
condition:
equal: ['esbuild', << parameters.subset >>]
steps:
- run:
name: Execute CLI E2E Tests Subset with Esbuild
command: |
node ./tests/legacy-cli/run_e2e --nb-shards=${CIRCLE_NODE_TOTAL} --shard=${CIRCLE_NODE_INDEX} <<# parameters.snapshots >>--ng-snapshots<</ parameters.snapshots >> --esbuild --tmpdir=/mnt/ramdisk/e2e --glob="{tests/basic/**,tests/build/prod-build.ts,tests/build/relative-sourcemap.ts,tests/build/styles/scss.ts,tests/build/styles/include-paths.ts,tests/commands/add/add-pwa.ts}" --ignore="tests/basic/{environment,rebuild,serve,scripts-array}.ts"
- when:
condition:
equal: ['yarn', << parameters.subset >>]
steps:
- run:
name: Execute CLI E2E Tests Subset with Yarn
command: |
node ./tests/legacy-cli/run_e2e --nb-shards=${CIRCLE_NODE_TOTAL} --shard=${CIRCLE_NODE_INDEX} <<# parameters.snapshots >>--ng-snapshots<</ parameters.snapshots >> --yarn --tmpdir=/mnt/ramdisk/e2e --glob="{tests/basic/**,tests/update/**,tests/commands/add/**}"
- fail_fast

test-browsers:
executor:
name: action-executor
resource_class: medium
steps:
- custom_attach_workspace
- initialize_env
- run:
name: Initialize Saucelabs
command: setSecretVar SAUCE_ACCESS_KEY $(echo $SAUCE_ACCESS_KEY | rev)
- run:
name: Start Saucelabs Tunnel
command: ./scripts/saucelabs/start-tunnel.sh
background: true
# Waits for the Saucelabs tunnel to be ready. This ensures that we don't run tests
# too early without Saucelabs not being ready.
- run: ./scripts/saucelabs/wait-for-tunnel.sh
- run: node ./tests/legacy-cli/run_e2e --glob="tests/misc/browsers.ts"
- run: ./scripts/saucelabs/stop-tunnel.sh
- fail_fast

build:
executor: action-executor
steps:
- custom_attach_workspace
- run: yarn build
- persist_to_workspace:
root: *workspace_location
paths:
- dist/_*.tgz

bazel-build:
executor: bazel-executor
steps:
- custom_attach_workspace
Expand All @@ -308,7 +221,7 @@ jobs:
command: yarn bazel build //...
- fail_fast

bazel-test:
test:
executor: bazel-executor
parameters:
nodeversion:
Expand All @@ -323,7 +236,7 @@ jobs:
equal: [*default_nodeversion_major, << parameters.nodeversion >>]
steps:
- run:
command: yarn bazel test --test_tag_filters=-node16,-node<< parameters.nodeversion >>-broken //packages/...
command: yarn bazel test --test_tag_filters=-node16,-node18,-node<< parameters.nodeversion >>-broken //packages/...
# This timeout provides time for the actual tests to timeout and report status
# instead of CircleCI stopping the job without test failure information.
no_output_timeout: 40m
Expand All @@ -340,10 +253,13 @@ jobs:
no_output_timeout: 40m
- fail_fast

bazel-e2e-tests:
e2e-tests:
executor: bazel-executor
parallelism: 8
parameters:
nodeversion:
type: string
default: *default_nodeversion
snapshots:
type: boolean
default: false
Expand All @@ -358,15 +274,15 @@ jobs:
- run: mkdir /mnt/ramdisk/e2e
- run:
name: Execute CLI E2E Tests with << parameters.subset >>
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=e2e //tests/legacy-cli:e2e<<# parameters.snapshots >>.snapshots<</ parameters.snapshots >>.<< parameters.subset >>
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=e2e //tests/legacy-cli:e2e<<# parameters.snapshots >>.snapshots<</ parameters.snapshots >>.<< parameters.subset >>_node<< parameters.nodeversion >>
no_output_timeout: 40m
- store_artifacts:
path: dist/testlogs/tests/legacy-cli/e2e.<< parameters.subset >>
path: dist/testlogs/tests/legacy-cli/e2e.<<parameters.nodeversion>>.<< parameters.subset >>
- store_test_results:
path: dist/testlogs/tests/legacy-cli/e2e.<< parameters.subset >>
path: dist/testlogs/tests/legacy-cli/e2e.<<parameters.nodeversion>>.<< parameters.subset >>
- fail_fast

bazel-test-browsers:
test-browsers:
executor: bazel-executor
steps:
- custom_attach_workspace
Expand Down Expand Up @@ -397,7 +313,6 @@ jobs:
resource_class: medium
steps:
- custom_attach_workspace
- install_python
- run:
name: Deployment to Snapshot
command: yarn admin snapshots --verbose
Expand All @@ -423,40 +338,6 @@ jobs:

# Windows jobs
e2e-cli-win:
executor: windows-executor
parallelism: 16
steps:
- checkout
- rebase_pr_win
- setup_windows
- restore_cache:
keys:
- *cache_key_win
- 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: |
pwsh ./.circleci/win-ram-disk.ps1
- run: yarn install --frozen-lockfile --cache-folder ../.cache/yarn
- save_cache:
key: *cache_key_win
paths:
- ~/.cache/yarn
# Path where Arsenal Image Mounter files are downloaded.
# Must match path in .circleci/win-ram-disk.ps1
- ./aim
# Build the npm packages for the e2e tests
- run: yarn build
# Run partial e2e suite on PRs only. Release branches will run the full e2e suite.
- run:
name: Execute E2E Tests
command: |
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 --ignore="tests/misc/browsers.ts"
- fail_fast

bazel-e2e-cli-win:
executor: windows-executor
parallelism: 12
steps:
Expand Down Expand Up @@ -489,7 +370,7 @@ jobs:
PWD: .
command: |
mkdir X:/ramdisk/e2e
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
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_node16
# This timeout provides time for the actual tests to timeout and report status
# instead of CircleCI stopping the job without test failure information.
no_output_timeout: 40m
Expand All @@ -511,17 +392,28 @@ workflows:
- validate:
requires:
- setup
- build:
requires:
- setup

- test-browsers:
# These jobs only really depend on Setup, but the build job is very quick to run (~35s) and
# will catch any build errors before proceeding to the more lengthy and resource intensive
- test:
name: test-node<< matrix.nodeversion >>
matrix:
parameters:
# Disable running this on Node.js 18 for now. This causes failures when using RBE.
# Example: `GLIBC_2.28' not found.
# Likely this is caused by outdated Ubuntu image https://github.com/angular/dev-infra/blob/main/bazel/remote-execution/BUILD.bazel#L21
nodeversion: ['14', '16']
requires:
- build

# Bazel jobs
- build:
requires:
- setup

- e2e-tests:
name: e2e-cli-<< matrix.subset >>
nodeversion: '14.20'
nodeversion: *default_nodeversion_major
matrix:
parameters:
subset: *all_e2e_subsets
Expand All @@ -538,15 +430,15 @@ workflows:
matrix:
alias: e2e-cli
parameters:
nodeversion: ['14.20', '16.13', '18.10']
nodeversion: *all_nodeversion_major
subset: *all_e2e_subsets
requires:
- build
<<: *only_release_branches

- e2e-tests:
name: e2e-snapshots-<< matrix.subset >>
nodeversion: '16.13'
nodeversion: *default_nodeversion_major
matrix:
parameters:
subset: *all_e2e_subsets
Expand All @@ -565,61 +457,13 @@ workflows:
- build
<<: *only_snapshot_branches

# Bazel jobs
# These jobs only really depend on Setup, but the build job is very quick to run (~35s) and
# will catch any build errors before proceeding to the more lengthy and resource intensive
# Bazel jobs.
- bazel-test:
name: test-node<< matrix.nodeversion >>
matrix:
parameters:
nodeversion: *all_nodeversion_major
- test-browsers:
requires:
- bazel-build
- build

# Windows jobs
- e2e-cli-win

- bazel-e2e-cli-win

# Bazel jobs
- bazel-build:
requires:
- setup

- bazel-e2e-tests:
name: bazel-e2e-cli-<< matrix.subset >>
matrix:
parameters:
subset: *all_e2e_subsets
snapshots: false
requires:
- bazel-build

- bazel-e2e-tests:
name: bazel-e2e-snapshots-<< matrix.subset >>
matrix:
parameters:
subset: *all_e2e_subsets
snapshots: true
pre-steps:
- when:
# Don't run snapshot E2E's unless it's on the main branch or the snapshots file has been updated.
condition:
and:
- not:
equal: [main, << pipeline.git.branch >>]
- not: << pipeline.parameters.snapshot_changed >>
steps:
- run: circleci-agent step halt
requires:
- bazel-build
<<: *only_snapshot_branches

- bazel-test-browsers:
requires:
- bazel-build

# Publish jobs
- snapshot_publish:
<<: *only_release_branches
Expand Down
5 changes: 5 additions & 0 deletions WORKSPACE
Expand Up @@ -99,6 +99,11 @@ nodejs_register_toolchains(
node_version = "16.13.1",
)

nodejs_register_toolchains(
name = "node18",
node_version = "18.10.0",
)

register_toolchains(
"@npm//@angular/build-tooling/bazel/git-toolchain:git_linux_toolchain",
"@npm//@angular/build-tooling/bazel/git-toolchain:git_macos_x86_toolchain",
Expand Down
14 changes: 7 additions & 7 deletions docs/DEVELOPER.md
Expand Up @@ -78,22 +78,22 @@ There are two different test suites which can be run locally:
- Run a subset of the tests, use the full Bazel target example: `yarn bazel test //packages/schematics/angular:angular_test`
- For a complete list of test targets use the following Bazel query: `yarn bazel query "tests(//packages/...)"`

When debugging a specific test, change `describe()` or `it()` to `fdescribe()`
and `fit()` to focus execution to just that one test. This will keep the output clean and speed up execution by not running irrelevant tests.

You can find more info about debugging [tests with Bazel in the docs.](https://github.com/angular/angular-cli/blob/main/docs/process/bazel.md#debugging-jasmine_node_test)

### End to end tests

- Compile the packages being tested: `yarn build`
- Run all tests: `node tests/legacy-cli/run_e2e.js`
- Run a subset of the tests: `node tests/legacy-cli/run_e2e.js tests/legacy-cli/e2e/tests/i18n/ivy-localize-*`
- 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-*`
- For a complete list of test targets use the following Bazel query: `yarn bazel query "tests(//tests/...)"`
- Run a subset of the tests: `yarn bazel test //tests/legacy-cli:e2e_node16 --test_filter="tests/i18n/ivy-localize-*"`
- Use `bazel run` to debug failing tests debugging: `yarn bazel run //tests/legacy-cli:e2e_node16 --test_arg="--glob=tests/basic/aot.ts"`
- Provide additional `e2e_runner` options using `--test_arg`: `--test_arg="--yarn"`

When running the debug commands, Node will stop and wait for a debugger to attach.
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
simpler debug story.

When debugging a specific test, change `describe()` or `it()` to `fdescribe()`
and `fit()` to focus execution to just that one test. This will keep the output clean and speed up execution by not running irrelevant tests.

## IDE Specific Usage

Some additional tips for developing in specific IDEs.
Expand Down
4 changes: 3 additions & 1 deletion tests/legacy-cli/BUILD.bazel
Expand Up @@ -4,7 +4,9 @@ load(":e2e.bzl", "e2e_suites")
ts_library(
name = "runner",
testonly = True,
srcs = glob(["**/*.ts"]),
srcs = [
"e2e_runner.ts",
],
data = [
"verdaccio.yaml",
"verdaccio_auth.yaml",
Expand Down