-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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): support full chrome version for pruning #13896
Conversation
// TODO: translate these strings. | ||
// see https://github.com/GoogleChrome/lighthouse/issues/13895 | ||
// @ts-expect-error: .type hasn't released to npm yet | ||
.filter(deprecation => !deprecation.type || deprecation.type === 'Untranslated') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is what ToT CDT does right now (but not for much longer, there's a pending CL): just hides these translated strings.
3eb5a89
to
5f8a886
Compare
|
||
describe('report-assert', () => { | ||
it('compares chromium versions correctly', async () => { | ||
expect(compareChromiumVersions([100, 0, 0, 0], [100, 0, 0, 0])).toBe(0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ideally if we're going to be exporting a function and testing it, it would be the whole kit and caboodle, like expect(failsChromeVersionCheck(hostVersion, {_minChromiumVersion: '100'}).toBe(whatever)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
5f8a886
to
215d643
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I meant more like
/**
* @param {string} hostVersionString
* @param {*} obj
*/
function failsChromeVersionCheck(hostVersionString, obj) {
const hostVersion = hostVersionString.split('.').map(Number); // or keep parseVersion()
if (obj._minChromiumVersion) {
const minVersion = obj._minChromiumVersion.split('.').map(Number);
for (let i = 0; i < hostVersion.length; i++) {
if (hostVersion[i] < minVersion[i]) return true;
}
}
if (obj._maxChromiumVersion) {
const maxVersion = obj._maxChromiumVersion.split('.').map(Number);
for (let i = 0; i < hostVersion.length; i++) {
if (hostVersion[i] > maxVersion[i]) return true;
}
}
return false;
}
so it's not in several pieces and it avoids having to remember the -1/1 convention.
Up to you, but let's land whatever so we can unblock CI
Framing it as a comparator function helps me understand (or at least write?) these things better, so I'll keep it like this. splitting it out is a good for readability, thanks for recommending. |
Two commits here:
_minChromium/_maxChromium
properties. Just the milestone number is too coarse to be useful for addressing regressions that have immediately occurred in ToT (but not landed in canary).