build: error when files specified in payload size limits are missing (#27250)
PR Close #27250
This commit is contained in:
parent
24ebdbd04b
commit
445f7896c1
|
@ -4,8 +4,7 @@
|
||||||
"uncompressed": {
|
"uncompressed": {
|
||||||
"runtime": 3881,
|
"runtime": 3881,
|
||||||
"main": 499953,
|
"main": 499953,
|
||||||
"polyfills": 53926,
|
"polyfills": 53926
|
||||||
"prettify": 14917
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,14 @@ for (const compressionType in limitSizes) {
|
||||||
const expectedSize = limitPerFile[filename];
|
const expectedSize = limitPerFile[filename];
|
||||||
const actualSize = currentSizes[`${compressionType}/${filename}`];
|
const actualSize = currentSizes[`${compressionType}/${filename}`];
|
||||||
|
|
||||||
if (Math.abs(actualSize - expectedSize) > expectedSize / 100) {
|
if (actualSize === undefined) {
|
||||||
|
failed = true;
|
||||||
|
// An expected compression type/file combination is missing. Maybe the file was renamed or
|
||||||
|
// removed. Report it as an error, so the user updates the corresponding limit file.
|
||||||
|
console.log(
|
||||||
|
`Commit ${commit} ${compressionType} ${filename} meassurement is missing. ` +
|
||||||
|
'Maybe the file was renamed or removed.');
|
||||||
|
} else if (Math.abs(actualSize - expectedSize) > expectedSize / 100) {
|
||||||
failed = true;
|
failed = true;
|
||||||
// We must also catch when the size is significantly lower than the payload limit, so
|
// We must also catch when the size is significantly lower than the payload limit, so
|
||||||
// we are forced to update the expected payload number when the payload size reduces.
|
// we are forced to update the expected payload number when the payload size reduces.
|
||||||
|
|
Loading…
Reference in New Issue