|
1 | 1 | ### Unit tests for Angular CDK/Material
|
2 |
| -The unit tests from angular/material2 run on CircleCI under the `material-unit-tests` job. |
3 |
| -Known failing tests are skipped based on the blocklist in |
4 |
| -`tools/material-ci/angular_material_test_blocklist.js`. Whenever the root cause of a known failure |
5 |
| -is identified, the `notes` field for the corresponding tests should be updated. Whenever a failure |
6 |
| -is resolved, the corresponding tests should be removed from the blocklist. |
| 2 | + |
| 3 | +Currently, all changes to Ivy are validated against the test suite of the |
| 4 | +`angular/components` repository. Known failing tests are skipped based on |
| 5 | +the blocklist in `tools/material-ci/test-blocklist.ts`. |
| 6 | + |
| 7 | +Whenever the root cause of a known failure is identified, the `notes` field |
| 8 | +for the corresponding tests should be updated. Whenever a failure is resolved, |
| 9 | +the corresponding tests should be removed from the blocklist. |
7 | 10 |
|
8 | 11 | ### Debugging
|
9 |
| -To debug a failure, you need to work against the angular/material2 repo: |
10 |
| -1. Clone `angular/material2` |
11 |
| -2. Checkout the `ivy-2019` branch |
12 |
| -3. Run `yarn` |
13 |
| -4. Run `scripts/ivy/install-angular.sh path/to/local/angular/repo` |
14 |
| -5. Run `gulp test` |
15 |
| - |
16 |
| -### Regenerating the blocklist |
17 |
| -If a problem has been fixed, you can regenerate the blocklist by: |
18 |
| -1. Clone `angular/material2` |
19 |
| -2. Checkout the `ivy-2019` branch |
20 |
| -3. Run `yarn` |
21 |
| -4. Run `scripts/ivy/install-angular.sh path/to/local/angular/repo` |
22 |
| -5. Run `gulp test`. Let it finish. It will take a few minutes. |
23 |
| -6. Run `scripts/ivy/generate-blocklist.js path/to/local/angular/repo` |
24 |
| -7. Copy the new blocklist from `dist/angular_material_test_blocklist.js` |
| 12 | + |
| 13 | +Information on debugging can be found [here](../../docs/DEBUG_MATERIAL_IVY.md). |
| 14 | + |
| 15 | +### Excluding new tests |
| 16 | + |
| 17 | +In case there are any tests in the components test suite that fail due to |
| 18 | +recent changes in the framework and you want to exclude the tests temporarily, |
| 19 | +a new entry can be added to the `test-blocklist.ts` file. |
| 20 | + |
| 21 | +Each property in the blocklist object corresponds to a test in the components |
| 22 | +repository. The name of the property **must** match the exact test name. Additionally |
| 23 | +it's **recommended** that every entry has a field with a note on why the test is disabled. |
| 24 | + |
| 25 | +```ts |
| 26 | +export const testBlocklist: any = { |
| 27 | + 'MatSlider should be able to drag thumb': { |
| 28 | + error: 'Cannot register event "dragstart".', |
| 29 | + notes: 'Breaking change where HammerJS module needs to be imported.' |
| 30 | + } |
| 31 | +} |
| 32 | +``` |
0 commit comments