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: include finished state on hidden network-requests audit #10530

Merged
merged 3 commits into from
Apr 1, 2020

Conversation

brendankenny
Copy link
Member

},
{
url: 'http://localhost:10200/favicon.ico',
finished: true,
Copy link
Member Author

@brendankenny brendankenny Mar 31, 2020

Choose a reason for hiding this comment

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

it's nice to have smoke coverage, but clearly we're not too worried about covering this audit's entire output given the assertions here (and two other places where we assert just details.items.length), so this could be removed if it feels excessive

Copy link
Collaborator

Choose a reason for hiding this comment

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

I like the idea of asserting these somewhere so seems fine 🤷‍♂

@@ -62,6 +63,7 @@ class NetworkRequests extends Audit {
};
});

// NOTE(i18n): this audit is only for debug info in the LHR and does not appear in the report.
Copy link
Member Author

@brendankenny brendankenny Mar 31, 2020

Choose a reason for hiding this comment

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

the other options are:

  • actually i18n this file. Many of these column names already exist in our strings, but some ('Status Code', 'MIME Type', etc) do not and will have to be translated. Seems not worth it?
  • remove the headings and make this debugdata, which it really already is. Seems like there's benefit to having it be the common table format, though, and the headings kind of serve as documentation for the columns?

I'm fine with any of these.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I like what we have here, continue to leave it un-i18n'd 👍

const networkRecordsToDevtoolsLog = require('../network-records-to-devtools-log.js');

const acceptableDevToolsLog = require('../fixtures/traces/progressive-app-m60.devtools.log.json');
const cutoffLoadDevtoolsLog = require('../fixtures/traces/cutoff-load-m83.devtoolslog.json');
Copy link
Member Author

@brendankenny brendankenny Mar 31, 2020

Choose a reason for hiding this comment

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

introduced a new test devtoolsLog/trace of a load of the report viewer, devtools throttling, cut off at 1500ms (via --max-wait-for-load). Six network requests, three unfinished.

Seems handy to have a kind of gross load like that with relatively small fixture file sizes.

@@ -27,4 +28,16 @@ expect.extend({

return {actual, message, pass};
},

// Expose toBeCloseTo() so it can be used as an asymmetric matcher.
toBeApproximately(...args) {
Copy link
Member Author

Choose a reason for hiding this comment

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

it's really dumb you can't use toBeCloseTo in toMatchObject, so this takes care of that :)

/**
* Asserts that an i18n string (using en-US) matches an expected pattern.
*/
toBeDisplayString: (pattern: RegExp) => R;
Copy link
Member Author

Choose a reason for hiding this comment

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

below toBeApproximately is just indent fix and correcting s/object/R

@brendankenny
Copy link
Member Author

(there's not much interesting happening in this audit or its tests, so replaced the basic test with the new cutoff-devtoolsLog test rather than accumulating file-loading slowish tests that do the same thing)

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.

LGTM % false smoke test

},
{
url: 'http://localhost:10200/byte-efficiency/script.js?gzip=1',
transferSize: '1100 +/- 100',
resourceSize: '53000 +/- 1000',
finished: false,
Copy link
Collaborator

Choose a reason for hiding this comment

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

wait, why is this false? 😕

Copy link
Collaborator

Choose a reason for hiding this comment

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

oh phew it's failing, this is true :)

Copy link
Member Author

Choose a reason for hiding this comment

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

wait, why is this false? 😕

Whoops, was checking that it really was asserting and pushed that version :)

},
{
url: 'http://localhost:10200/favicon.ico',
finished: true,
Copy link
Collaborator

Choose a reason for hiding this comment

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

I like the idea of asserting these somewhere so seems fine 🤷‍♂

@@ -62,6 +63,7 @@ class NetworkRequests extends Audit {
};
});

// NOTE(i18n): this audit is only for debug info in the LHR and does not appear in the report.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I like what we have here, continue to leave it un-i18n'd 👍

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.

4 participants