test(ivy): update Material to recent commit from master branch (#31569)

Previously, the ivy-2019 branch of the Material (aka components) repo was
used, which contains some changes that were necessary to work with Ivy.
These changes are not longer necessary, as Material's master branch is
fully working with Ivy today. To be up-to-date with recent Material
development and its support for more recent dependencies, e.g. TypeScript,
it is desirable for us to be on a newer version of Material.

This commit moves the Material tests away from the ivy-2019 branch, to a
recent commit on master. We are not targeting the master branch itself,
as that would introduce a moving target into Angular's CI checks, which
is undesirable.

Lastly, the usage of gulp to run Material's tests is changed into using
Bazel, as Material itself is now also built with Bazel.

PR Close #31569
This commit is contained in:
JoostK
2019-06-13 21:06:14 +02:00
committed by Miško Hevery
parent 85d051f8d5
commit 7e46a6d99d
6 changed files with 110 additions and 32 deletions

View File

@ -6,20 +6,28 @@ set -u -e -o pipefail
# Save the dir for the root of the Angular repo.
angular_dir=$(pwd)
# Disable full template type check, as Material doesn't build cleanly with it enabled.
# See https://github.com/angular/components/pull/16373 for details.
# The "ivyTemplateTypeCheck" flag is set to True so that a minimum amount of type checking still
# occurs, at a level compatible with that of VE's type checking. This ensures Ivy's type checker
# is still tested against the Material repo, albeit in its non-strict mode.
sed -i'.bak' "s/\(_ENABLE_NG_TYPE_CHECKING = \)True/\1False/g" ${MATERIAL_REPO_TMP_DIR}/tools/defaults.bzl
sed -i'.bak' "s/\(\"ivyTemplateTypeCheck\": \)False/\1True/g" dist/packages-dist-ivy-aot/bazel/src/ng_module.bzl
# Switch into Material directory.
cd ${MATERIAL_REPO_TMP_DIR}
# Install this version of Angular into the freshly cloned repo.
rm -rf ./node_modules/@angular/*
cp -r ${angular_dir}/dist/packages-dist-ivy-aot/* ./node_modules/@angular/
# The angular/material2 CI sets TEST_PLATFORM to either "local", "saucelabs", or "browserstack".
# For angular/angular, we only want to run the "local" tests.
export TEST_PLATFORM=local
# Updates Material's package.json to refer to the packages-dist-ivy-aot directory.
# Note that it's not necessary to perform a yarn install, as Bazel performs its own yarn install.
node ${angular_dir}/scripts/ci/update-deps-to-dist-packages.js ${MATERIAL_REPO_TMP_DIR}/package.json ${angular_dir}/dist/packages-dist-ivy-aot/
# Append the test blocklist into angular/material2's karma-test-shim.js.
# This filters out known-failing tests because the goal is to prevent regressions.
cat ${angular_dir}/tools/material-ci/angular_material_test_blocklist.js >> ./test/karma-test-shim.js
# Now actually run the tests.
yarn gulp test:single-run
# Create a symlink for the Bazel binary installed through NPM, as running through Yarn introduces OOM errors.
./scripts/circleci/setup_bazel_binary.sh
# Now actually run the tests. The dev-app target is excluded as it fails to compile due to
# limitations in Ivy's type checker (see FW-1352 and FW-1433)
bazel test src/... --deleted_packages=//src/dev-app --build_tag_filters=-docs-package,-e2e,-browser:firefox-local --test_tag_filters=-e2e,-browser:firefox-local --define=compile=aot