-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
core: require score in audit product; make rawValue numeric only #8343
Conversation
Only done a quick scan, but it's fair to say those two files are the only meat right? |
yeah, |
@@ -389,7 +390,7 @@ describe('Runner', () => { | |||
return Runner.run({}, {config}).then(results => { | |||
const audits = results.lhr.audits; | |||
assert.equal(audits['critical-request-chains'].displayValue, '5 chains found'); | |||
assert.equal(audits['critical-request-chains'].rawValue, false); | |||
assert.equal(audits['critical-request-chains'].details.longestChain.transferSize, 2468); |
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 guess not quite string replace in this file because it made no sense to assert the score on these. They're all null
since the audit is INFORMATIVE
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.
LGTM! rename those strings 🖊
return { | ||
id: 'numeric-time', | ||
title: 'Numbersssss', | ||
description: '01000000001011011111100001010100', |
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.
@-�T
?
c'mon gotta have some next level messaging in here :)
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.
01101101011001010110111101110111
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.
not everything's a character :P
new Float32Array(new Uint32Array([0b01000000001011011111100001010100]).buffer)[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.
touche :)
const auditResult = Audit.generateAuditResult(PassOrFailAudit, | ||
{score: 0, errorMessage: 'what errors lurk'}); | ||
assert.strictEqual(auditResult.score, null); | ||
assert.equal(auditResult.title, 'Passing'); |
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.
we use the passing title for errors? funny the things you learn in testing :)
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.
we use the passing title for errors? funny the things you learn in testing :)
yeah, I was really surprised when I made score === null
explicitly use the failureTitle
and a whole bunch of things changed in sample_v2.json
:)
I'm not entirely convinced it was on purpose, but it makes sense for NOT_APPLICABLE
and INFORMATIVE
, and it kind of makes sense for ERROR
, since we don't know the page was doing the failure thing.
The majority of the change in #6199 (comment).
score
a required part ofLH.Audit.Product
, either a number or null (in case of ERROR, NOT_APPLICABLE, or INFORMATIVE)rawValue
into ascore
of 0 or 1, then drop thoserawValue
sMostly string replace, except in
audit.js
andaudit-test.js
after this I think we want to (at least) rename
rawValue
to finish out #6199