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

tests(legacy-javascript): cache variants, check in lockfile, … #10568

Merged
merged 12 commits into from
Apr 22, 2020

Conversation

connorjclark
Copy link
Collaborator

Fixes #10566

@connorjclark
Copy link
Collaborator Author

@brendankenny bump :) kinda-sorta a blocker on #10564

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.

sorry, I had these comments but forgot to flush them. But you changed the crypto to js in the meantime so it's even better now :)

A few notes/possibilities but LGTM!

* summary-sizes.txt
* summary-signals.json

`summary-sizes.txt` lists each of the variants (grouped by type) and sorted by their byte size. This is mostly a diagnostic tool and changes in this can be ignored. This is checked in because whenever the lockfile is updated, `summary-sizes.txt` tells us things like if transforms are getting worse. And it is a quick reference for the relative weight of each of these transform/polyfills.
Copy link
Member

Choose a reason for hiding this comment

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

I don't think variant is defined anywhere, so it might be good to add that to the readme as well

* summary-sizes.txt
* summary-signals.json

`summary-sizes.txt` lists each of the variants (grouped by type) and sorted by their byte size. This is mostly a diagnostic tool and changes in this can be ignored. This is checked in because whenever the lockfile is updated, `summary-sizes.txt` tells us things like if transforms are getting worse. And it is a quick reference for the relative weight of each of these transform/polyfills.
Copy link
Member

Choose a reason for hiding this comment

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

mostly a diagnostic tool and changes in this can be ignored
This is checked in because whenever the lockfile is updated, summary-sizes.txt tells us things like if transforms are getting worse

seem somewhat contradictory, but is this saying this file is an indicator of transforms (out in the developer ecosystem) getting better/worse so the file is checked in so that can be seen in the github UI, but any changes aren't important (they're changes in the transforms, not in lighthouse) so commit freely if there is a diff?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yeah, I tried capturing that better with a rewording

4774 variants/core-js-2-only-polyfill/es6-array-species/main.bundle.min.js
3410 variants/core-js-2-only-polyfill/es6-function-name/main.bundle.min.js
core-js-2-only-polyfill
47738 es6-typed-uint8-clamped-array/main.bundle.min.js
Copy link
Member

Choose a reason for hiding this comment

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

maybe worth putting a header somewhere? bytes and whatever the other thing is :) polyfilled bundle of something?

lighthouse-core/test/audits/legacy-javascript-test.js Outdated Show resolved Hide resolved
removeCoreJs(); // (in case the script was canceled halfway - there shouldn't be a core-js dep checked in.)

const hash = crypto
.createHash('sha256')
Copy link
Member

Choose a reason for hiding this comment

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

👍

@@ -258,6 +272,36 @@ function makeSummary() {
};
}

function createSummarySizes() {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
function createSummarySizes() {
function createSizesSummary() {

?
:)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ehhhhh I wanted symmetry with summary-signals, i'll just leave it as is

lines.push(path.relative(VARIANT_DIR, variantGroupFolder));

const variants = [];
for (const variantFolder of glob.sync(`${variantGroupFolder}/**/main.bundle.min.js `)) {
Copy link
Member

Choose a reason for hiding this comment

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

variantFile or variantBundle?

// Create variants in a directory named-cached by contents of this script and the lockfile.
// This folder is in the CI cache, so that the time consuming part of this test only runs if
// the output would change.
removeCoreJs(); // (in case the script was canceled halfway - there shouldn't be a core-js dep checked in.)
Copy link
Member

Choose a reason for hiding this comment

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

it does seem a little odd to control this here (both running here and not in main() and yarn commands inside this file in general), but I haven't reviewed the full control flow so I'll assume it makes sense :)

@connorjclark connorjclark changed the title tests(legacy-javascript): cache variants, check in lockfile, more readme, jest tests(legacy-javascript): cache variants, check in lockfile, … Apr 22, 2020
@connorjclark connorjclark merged commit 57a3048 into master Apr 22, 2020
@connorjclark connorjclark deleted the legacy-test-fixes branch April 22, 2020 23:35
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.

test-legacy-javascript improvements
4 participants