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

core: remove NO_ERROR from default responses #7358

Merged
merged 5 commits into from
Mar 5, 2019
Merged

Conversation

exterkamp
Copy link
Member

@exterkamp exterkamp commented Mar 2, 2019

Summary
Removes NO_ERROR codes from default responses that contain no errors.
From some initial testing I did, this should have no effect on LR.

Related Issues/PRs
part of: #6336

Copy link
Member

@brendankenny brendankenny left a comment

Choose a reason for hiding this comment

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

nice! This will be great.

Does this completely close #6336, though? e.g. do we give a bad exit code when there is a runtimeError? I can't remember where we fell on that.

lighthouse-core/runner.js Show resolved Hide resolved
@exterkamp
Copy link
Member Author

Added exit code 1 when there is a runtime error present. I was trying to add a exit code 1 when there was no LHR but that got complicated since there isn't an LHR when it is print-config or in gather-only mode. Which are valid cases to not see an LHR. So we can refactor more to detect those/return blank empty LHRs, but I wanted to get feedback on those ideas/if it was worth it @paulirish.

@brendankenny
Copy link
Member

sorry, I wasn't trying to tell you you needed to add that to this PR, just that we might not be done with that issue yet :)

Copy link
Member

@brendankenny brendankenny left a comment

Choose a reason for hiding this comment

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

I was trying to add a exit code 1 when there was no LHR

as you said, there are valid cases that don't output an LHR, and I don't think it's actually possible to get no LHR from a regular return in any other case...every other path there should be a thrown error (already caught in run.js). So just adding a check for a runtimeError should be enough.

But maybe defer to another PR so we can discuss/land that separately?

require('./bin.js').begin().catch(err => {
require('./bin.js').begin().then((lhr) => {
// Exit with non-zero exit code if LHR contains runtime error.
if (lhr && lhr.lhr.runtimeError) {
Copy link
Member

Choose a reason for hiding this comment

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

ideally we can handle this in run.js with the other runtime error/exiting code

@exterkamp
Copy link
Member Author

Rolled back exit code changes for follow up PR. Added test.

Ready for re-review 😄

Copy link
Collaborator

@patrickhulce patrickhulce left a comment

Choose a reason for hiding this comment

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

hurray! :D

@brendankenny brendankenny merged commit ffc430d into master Mar 5, 2019
@brendankenny brendankenny deleted the no-no-errors branch March 5, 2019 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants