|
1 | 1 | #!/usr/bin/env bash |
2 | 2 | set -u -e -o pipefail |
3 | 3 |
|
4 | | - |
5 | 4 | # This script runs unit tests from angular/material2. |
6 | 5 |
|
7 | 6 | # Save the dir for the root of the Angular repo. |
8 | 7 | angular_dir=$(pwd) |
9 | 8 |
|
10 | | -# Clone the angular/material2 repo into tmp so we can run the tests from there. |
11 | | -# We specifically use /tmp here because we want the cloned repo to be completely |
12 | | -# isolated from angular/angular in order to avoid any bad interactions between their |
13 | | -# separate build setups. Also note that this is using the ivy-2019 branch, which has |
14 | | -# previously been set up to work with ivy. |
15 | | -cd /tmp |
16 | | -rm -rf /tmp/material2 |
17 | | -git clone --depth 1 --branch ivy-2019 https://github.com/angular/material2.git |
| 9 | +# Switch into Material directory. |
| 10 | +cd ${MATERIAL_REPO_TMP_DIR} |
18 | 11 |
|
19 | 12 | # Install dependencies for the freshly cloned repo. |
20 | | -cd /tmp/material2 |
21 | | -yarn install --frozen-lockfile --non-interactive # TODO: cache |
| 13 | +yarn install --frozen-lockfile --non-interactive |
22 | 14 |
|
23 | 15 | # Install this version of Angular into the freshly cloned repo. |
24 | | -rm -rf /tmp/material2/node_modules/@angular/* |
25 | | -cp -r ${angular_dir}/dist/packages-dist-ivy-aot/* /tmp/material2/node_modules/@angular/ |
| 16 | +rm -rf ./node_modules/@angular/* |
| 17 | +cp -r ${angular_dir}/dist/packages-dist-ivy-aot/* ./node_modules/@angular/ |
26 | 18 |
|
27 | | -# The angular/material2 CI sets TEST_PLATFORM to either local, saucelabs, or browserstack. |
28 | | -# For angular/angular, we only want to run the local tests. |
| 19 | +# The angular/material2 CI sets TEST_PLATFORM to either "local", "saucelabs", or "browserstack". |
| 20 | +# For angular/angular, we only want to run the "local" tests. |
29 | 21 | export TEST_PLATFORM=local |
30 | 22 |
|
31 | 23 | # Append the test blocklist into angular/material2's karma-test-shim.js. |
32 | 24 | # This filters out known-failing tests because the goal is to prevent regressions. |
33 | | -cat ${angular_dir}/tools/material-ci/angular_material_test_blocklist.js >> /tmp/material2/test/karma-test-shim.js |
| 25 | +cat ${angular_dir}/tools/material-ci/angular_material_test_blocklist.js >> ./test/karma-test-shim.js |
34 | 26 |
|
35 | 27 | # Now actually run the tests. |
36 | 28 | yarn gulp test:single-run |
0 commit comments