Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests(smoke): make specific assertions about deprecations #13191

Merged
merged 3 commits into from
Oct 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 20 additions & 4 deletions lighthouse-cli/test/smokehouse/report-assert.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,26 +200,42 @@ function pruneExpectations(localConsole, lhr, expected, reportOptions) {
JSON.stringify(value, null, 2),
`Actual Chromium version: ${getChromeVersion()}`,
].join(' '));
delete obj[key];
if (Array.isArray(obj)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removeKey helper?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not feeling DRY is necessary here

obj.splice(Number(key), 1);
} else {
delete obj[key];
}
} else if (value._legacyOnly && isFraggleRock) {
localConsole.log([
`[${key}] marked legacy only but run is Fraggle Rock, pruning expectation:`,
JSON.stringify(value, null, 2),
].join(' '));
delete obj[key];
if (Array.isArray(obj)) {
obj.splice(Number(key), 1);
} else {
delete obj[key];
}
} else if (value._fraggleRockOnly && !isFraggleRock) {
localConsole.log([
`[${key}] marked Fraggle Rock only but run is legacy, pruning expectation:`,
JSON.stringify(value, null, 2),
`Actual channel: ${lhr.configSettings.channel}`,
].join(' '));
delete obj[key];
if (Array.isArray(obj)) {
obj.splice(Number(key), 1);
} else {
delete obj[key];
}
} else if (value._skipInBundled && !isBundled) {
localConsole.log([
`[${key}] marked as skip in bundled and runner is bundled, pruning expectation:`,
JSON.stringify(value, null, 2),
].join(' '));
delete obj[key];
if (Array.isArray(obj)) {
obj.splice(Number(key), 1);
} else {
delete obj[key];
}
} else {
pruneRecursively(value);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,12 +314,18 @@ const expectations = {
'deprecations': {
score: 0,
details: {
items: {
// <M96 - Application Cache API manifest
// * - window.webkitStorageInfo
// * - Synchronous XMLHttpRequest
length: '>=2',
},
items: [
{
value: /Application Cache API manifest/,
_maxChromiumMilestone: 94,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops, is it 96?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

},
{
value: /'window.webkitStorageInfo' is deprecated/,
},
{
value: /Synchronous XMLHttpRequest on the main thread is deprecated/,
Copy link
Collaborator

@patrickhulce patrickhulce Oct 7, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how is this passing? won't this fail in later milestones because it's at index 1 not 2?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well currently canary crashes due to unrelated reasons, so I couldn't test it locally.. but you are correct. Added a quick fix to the report asserting that should make this better

},
],
},
},
'password-inputs-can-be-pasted-into': {
Expand Down