Skip to content
This repository was archived by the owner on Mar 20, 2024. It is now read-only.

Commit 3eaa1e4

Browse files
gkalpakthePunderWoman
authored andcommitted
ci: re-enable the @angular/components unit tests (#41816)
Previously, the `components-repo-unit-tests` CI job was temporarily disabled due to a version mismatch between the `rules_nodejs` dependency version on the two repos (angular/angular and angular/components). Now that both repos have been updated to a `rules_nodejs` version >=2.0.0, we can re-enable the job and have `@angular/components` unit tests run on every build. PR Close #41816
1 parent 7219d1b commit 3eaa1e4

File tree

2 files changed

+12
-19
lines changed

2 files changed

+12
-19
lines changed

.circleci/config.yml

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ var_4_win: &cache_key_win_fallback v4-angular-win-node-12-{{ checksum "month.txt
3636

3737
# Cache key for the `components-repo-unit-tests` job. **Note** when updating the SHA in the
3838
# cache keys also update the SHA for the "COMPONENTS_REPO_COMMIT" environment variable.
39-
var_5: &components_repo_unit_tests_cache_key v1-angular-components-{{ checksum "month.txt" }}-09e68db8ed5b1253f2fe38ff954ef0df019fc25a
39+
var_5: &components_repo_unit_tests_cache_key v1-angular-components-{{ checksum "month.txt" }}-7cc42f5d835b7971e9ff73e220b801cf7834d515
4040
var_6: &components_repo_unit_tests_cache_key_fallback v1-angular-components-{{ checksum "month.txt" }}
4141

4242
# Workspace initially persisted by the `setup` job, and then enhanced by `build-npm-packages` and
@@ -730,11 +730,7 @@ jobs:
730730
- run:
731731
# Run yarn install to fetch the Bazel binaries as used in the components repo.
732732
name: Installing dependencies.
733-
# TODO: remove this once the repo has been updated to use NodeJS v12 and Yarn 1.19.1.
734-
# We temporarily ignore the "engines" because the Angular components repository has
735-
# minimum dependency on NodeJS v12 and Yarn 1.19.1, but the framework repository uses
736-
# older versions.
737-
command: yarn --ignore-engines --cwd ${COMPONENTS_REPO_TMP_DIR} install --frozen-lockfile --non-interactive --cache-folder ~/.cache/yarn
733+
command: yarn --cwd ${COMPONENTS_REPO_TMP_DIR} install --frozen-lockfile --non-interactive --cache-folder ~/.cache/yarn
738734
- save_cache:
739735
key: *components_repo_unit_tests_cache_key
740736
paths:
@@ -744,10 +740,14 @@ jobs:
744740
- "/tmp/angular-components-repo"
745741
- run:
746742
# Updates the `angular/components` `package.json` file to refer to the release output
747-
# inside the `packages-dist` directory. Note that it's not necessary to perform a yarn
748-
# install as Bazel runs Yarn automatically when needed.
743+
# inside the `packages-dist` directory.
749744
name: Setting up release packages.
750745
command: node scripts/ci/update-deps-to-dist-packages.js ${COMPONENTS_REPO_TMP_DIR}/package.json dist/packages-dist/
746+
- run:
747+
# Run `yarn install` again to install the Angular packages from `packages-dist/` and update the lockfile.
748+
# NOTE: We cannot rely on Bazel to run `yarn install`, because it uses the `--frozen-lockfile` flag and fails.
749+
name: Installing local Angular packages.
750+
command: yarn --cwd ${COMPONENTS_REPO_TMP_DIR} install --non-interactive --cache-folder ~/.cache/yarn
751751
- run:
752752
name: "Running `angular/components` unit tests"
753753
command: ./scripts/ci/run_angular_components_unit_tests.sh
@@ -890,16 +890,9 @@ workflows:
890890
- build-npm-packages
891891
- build-ivy-npm-packages
892892
- legacy-unit-tests-saucelabs
893-
# Temporarily disabled components-repo-unit-tests to update rules_nodejs to 2.0.0. Breaking changes in
894-
# rules_nodejs create a dependency sandwich between angular/angular & angular/components that are very
895-
# difficult and time consuming to resolve and involve patching @angular/bazel in components repo such
896-
# as https://github.com/angular/components/commit/9e7ba251207df77164d73d66620e619bcbc4d2ad. It is simpler to
897-
# 1) land angular/angular upgrade to rule_nodejs 2.0.0 which has breaking changes
898-
# 2) land angular/components upgrade to rules_nodejs 2.0.0 using the @angular/bazel builds snapshot
899-
# 3) update angular/angular to the landed components commit and re-enable these tests
900-
# - components-repo-unit-tests:
901-
# requires:
902-
# - build-npm-packages
893+
- components-repo-unit-tests:
894+
requires:
895+
- build-npm-packages
903896
- test_zonejs:
904897
requires:
905898
- setup

.circleci/env.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ setPublicVar COMPONENTS_REPO_TMP_DIR "/tmp/angular-components-repo"
7474
setPublicVar COMPONENTS_REPO_URL "https://github.com/angular/components.git"
7575
setPublicVar COMPONENTS_REPO_BRANCH "master"
7676
# **NOTE**: When updating the commit SHA, also update the cache key in the CircleCI `config.yml`.
77-
setPublicVar COMPONENTS_REPO_COMMIT "09e68db8ed5b1253f2fe38ff954ef0df019fc25a"
77+
setPublicVar COMPONENTS_REPO_COMMIT "7cc42f5d835b7971e9ff73e220b801cf7834d515"
7878

7979

8080
####################################################################################################

0 commit comments

Comments
 (0)