Skip to content

Commit 5e9e41b

Browse files
authored
build: fix error in size check tests (#20808)
Fixes an error that was being thrown in the size checking tests, because a file can't be resolved through `angular_material/tools/angular_ivy_enabled` anymore. With these changes the file is resolved relatively by looking for the closest `bin` directory and constructing the path from there. It's unclear how long the change has been failing for, because it isn't set up to break the CI. These changes also update the expected sizes since they were outdated.
1 parent e03a4d6 commit 5e9e41b

File tree

2 files changed

+30
-18
lines changed

2 files changed

+30
-18
lines changed

goldens/size-test.yaml

+17-17
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
cdk/drag-drop/all-directives: 154096
2-
cdk/drag-drop/basic: 151353
1+
cdk/drag-drop/all-directives: 152772
2+
cdk/drag-drop/basic: 150132
33
material-experimental/mdc-chips/basic: 147607
4-
material-experimental/mdc-form-field/advanced: 251959
5-
material-experimental/mdc-form-field/basic: 251127
6-
material/autocomplete/without-optgroup: 210028
7-
material/button-toggle/standalone: 119486
8-
material/chips/basic: 162776
9-
material/datepicker/range-picker/without-form-field: 332500
10-
material/expansion/without-accordion: 130701
11-
material/form-field/advanced: 186274
12-
material/form-field/basic: 185048
13-
material/list/nav-list: 130611
14-
material/menu/without-lazy-content: 212600
15-
material/radio/without-group: 121590
16-
material/select/basic: 258518
17-
material/tabs/advanced: 183621
18-
material/tabs/basic: 182818
4+
material-experimental/mdc-form-field/advanced: 218024
5+
material-experimental/mdc-form-field/basic: 217187
6+
material/autocomplete/without-optgroup: 207393
7+
material/button-toggle/standalone: 118062
8+
material/chips/basic: 157441
9+
material/datepicker/range-picker/without-form-field: 327358
10+
material/expansion/without-accordion: 127950
11+
material/form-field/advanced: 180868
12+
material/form-field/basic: 179631
13+
material/list/nav-list: 128605
14+
material/menu/without-lazy-content: 208165
15+
material/radio/without-group: 120615
16+
material/select/basic: 253529
17+
material/tabs/advanced: 181016
18+
material/tabs/basic: 180213

integration/size-test/rollup.config.js

+13-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
const {buildOptimizer} = require('@angular-devkit/build-optimizer');
22
const node = require('rollup-plugin-node-resolve');
3-
const {ivyEnabled} = require('angular_material/tools/angular_ivy_enabled');
3+
const path = require('path');
4+
const {ivyEnabled} = require(getIvyEnabledHelperPath());
45

56
console.info(`Processing rollup bundle in ${ivyEnabled ? 'Ivy' : 'View Engine'} mode.`);
67

@@ -36,3 +37,14 @@ module.exports = {
3637
}),
3738
],
3839
};
40+
41+
function getIvyEnabledHelperPath() {
42+
const parts = path.normalize(__dirname).split(path.sep);
43+
const binIndex = parts.indexOf('bin');
44+
45+
if (binIndex === -1) {
46+
throw Error('Cannot resolve Ivy helper path.');
47+
}
48+
49+
return path.join(parts.slice(0, binIndex).join(path.sep), 'bin/tools/angular_ivy_enabled');
50+
}

0 commit comments

Comments
 (0)