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(runner): save lhr on -A #11509

Merged
merged 2 commits into from
Oct 2, 2020
Merged

core(runner): save lhr on -A #11509

merged 2 commits into from
Oct 2, 2020

Conversation

connorjclark
Copy link
Collaborator

No description provided.

@connorjclark connorjclark requested a review from a team as a code owner October 1, 2020 21:12
@connorjclark connorjclark requested review from adamraine and removed request for a team October 1, 2020 21:12
@@ -156,6 +156,12 @@ class Runner {
// LHR has now been localized.
const lhr = /** @type {LH.Result} */ (i18nLhr);

// Save lhr to ./latest-run, but only if -A is used.
if (settings.auditMode) {
const path = Runner._getDataSavePath(settings);
Copy link
Collaborator Author

@connorjclark connorjclark Oct 1, 2020

Choose a reason for hiding this comment

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

I noticed an lhr file will linger if you do -G ... I nearly wrote some code to delete the latest run folder before running, but that seems dangerous.

Copy link
Collaborator

@patrickhulce patrickhulce Oct 1, 2020

Choose a reason for hiding this comment

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

I nearly wrote some code to delete the latest run folder before running, but that seems dangerous.

thank goodness you didn't, that would have been horrifying to me and the important examples I keep in that folder due to its gitignore properties 😅

(bad idea I know)

@connorjclark connorjclark changed the title core(runner): save lhr on lifecycle runs core(runner): save lhr on -A Oct 1, 2020
Copy link
Member

@adamraine adamraine left a comment

Choose a reason for hiding this comment

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

Looks good, can you update the readme with new description for -A?

Screen Shot 2020-10-02 at 3 00 35 PM

@@ -0,0 +1,140 @@
{
Copy link
Member

Choose a reason for hiding this comment

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

nit: Is lhr considered an artifact? If not, does it make sense to have these under a folder named "artifacts"? If it's too destructive to rename this folder I'm totally fine leaving it as well.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This doesn't bother me, and I'd prefer to avoid the churn.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Looks like this breaks our travis assertion that no source files change by running the tests (something we should add to github assertion suite 👍 ).

Actually looking at the code now, I'm a little confused why are these checked in at all. It doesn't look like they're normalized, and we never check equality (or even their existence?). Seems like an accidental add with git -A.

Copy link
Collaborator

@patrickhulce patrickhulce Oct 5, 2020

Choose a reason for hiding this comment

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

something we should add to github assertion suite 👍

soooo we already do this and now I'm confused why github passes but travis doesn't... figured it out we don't run it after the unit tests!

Copy link
Member

Choose a reason for hiding this comment

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

figured it out we don't run it after the unit tests!

😢 😢

Should we fix that and revert these lhrs (unless there was a non-apparent reason to add them)? Future tests that might need an lhr with these artifacts can always generate them (and normalize them, etc) when needed.

Copy link
Member

Choose a reason for hiding this comment

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

lol you're already on it

@@ -156,6 +156,12 @@ class Runner {
// LHR has now been localized.
const lhr = /** @type {LH.Result} */ (i18nLhr);

// Save lhr to ./latest-run, but only if -A is used.
Copy link
Member

Choose a reason for hiding this comment

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

Add something like this to comment on line 54?

@connorjclark
Copy link
Collaborator Author

Looks good, can you update the readme with new description for -A?

I actually think we should avoid mentioning in the readme, because we don't want people to get the idea that this is how you get a LHR. I think it'd be more confusing than anything. this feature is really only meant for contributors imo.

Copy link
Member

@adamraine adamraine left a comment

Choose a reason for hiding this comment

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

LGTM

@connorjclark connorjclark merged commit 3e4592d into master Oct 2, 2020
@connorjclark connorjclark deleted the save-lhr branch October 2, 2020 20:17
@brendankenny
Copy link
Member

because we don't want people to get the idea that this is how you get a LHR. I think it'd be more confusing than anything. this feature is really only meant for contributors imo.

Contributors read readmes, too :) It seems as worth documenting as anything else in that screenshot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants