-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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
misc(runner): add assertion for devtoolsLog as requiredArtifact #9290
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -289,11 +289,13 @@ class Runner { | |
for (const artifactName of audit.meta.requiredArtifacts) { | ||
const noArtifact = artifacts[artifactName] === undefined; | ||
|
||
// If trace required, check that DEFAULT_PASS trace exists. | ||
// TODO: need pass-specific check of networkRecords and traces. | ||
const noTrace = artifactName === 'traces' && !artifacts.traces[Audit.DEFAULT_PASS]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hm I wasn't even aware we did this, I guess it's impossible to eliminate the defaultPass then even with a custom config if you want any network or trace data? |
||
// If trace/devtoolsLog required, check that DEFAULT_PASS trace/devtoolsLog exists. | ||
// TODO: need pass-specific check of traces and devtoolsLogs. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would personally just get rid of this TODO, are we really going to move to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I think we're going to run into this sooner or later for the custom config/plugin reason you mention above. I think there are solutions, e.g. we could use a Main thing is that if/when that situation does come up, this is where the error will occur, so it would be good to have a comment on it. I can definitely make it not a TODO, though. |
||
const noRequiredTrace = artifactName === 'traces' && !artifacts.traces[Audit.DEFAULT_PASS]; | ||
const noRequiredDevtoolsLog = artifactName === 'devtoolsLogs' && | ||
!artifacts.devtoolsLogs[Audit.DEFAULT_PASS]; | ||
|
||
if (noArtifact || noTrace) { | ||
if (noArtifact || noRequiredTrace || noRequiredDevtoolsLog) { | ||
log.warn('Runner', | ||
`${artifactName} gatherer, required by audit ${audit.meta.id}, did not run.`); | ||
throw new Error(`Required ${artifactName} gatherer did not run.`); | ||
|
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.
networkRecords
! This is old :)