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

misc: fix typo in performance-budget smoke test #9244

Merged
merged 2 commits into from
Jun 26, 2019

Conversation

connorjclark
Copy link
Collaborator

this smoke test wasn't reading the correct parameter off ArrayBuffer. nor was the class correct for the stylesheet to apply, so now that it does I updated the font expectation to comply

trivial and silly, i know

},
{
resourceType: 'script',
countOverBudget: '2 requests',
sizeOverBudget: '25000±1000',
},
{
resourceType: 'font',
countOverBudget: undefined,
Copy link
Member

Choose a reason for hiding this comment

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

the intention was to make sure we got a good mixture of the combinations of defined and undefined for these entries, so ideally this wouldn't change from undefined.

Maybe the "Undefined items" comment above could be changed to be a little more strongly worded to warn about that and we could change corsfont to something completely different so it doesn't look like a bug that it's not getting the font?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

change corsfont to something completely different so it doesn't look like a bug that it's not getting the font?

yea, sounds good i'll do that and revert all these expectation changes

@@ -30,7 +30,7 @@
// Load file as 'other' resource.
const response = await fetch('http://localhost:10503/preload.html');
const ab = await response.arrayBuffer();
document.querySelector('#corsfont').textContent = ab.length;
document.querySelector('.corsfont').textContent = ab.byteLength;
Copy link
Member

Choose a reason for hiding this comment

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

ha, good catch. Clearly QA was lying down on the job for this page :)

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.

I'm not sure why we need to do any of this, but seems harmless :)

@@ -72,11 +72,11 @@ module.exports = [
audits: {
'resource-summary': {
score: null,
displayValue: '11 requests • 164 KB',
Copy link
Collaborator

Choose a reason for hiding this comment

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

for anyone else scratching their head how in the world this was affected by the fixture change when .corsfont doesn't appear anywhere else in load-things.html, the CSS rule is defined over in cors-fonts.css :)

Copy link
Member

Choose a reason for hiding this comment

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

my fault, it was sloppy to change it only a little and then draw a line in the sand for the budgets at that point :)

No memory of why I didn't change the classname itself from what's in fonts.html, just operating as a human fuzzer at the time, I think :)

Copy link
Collaborator

Choose a reason for hiding this comment

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

oh I'm still not clear why we need to use it at all no harm no foul I was just baffled how his text change could result in fonts getting requested 😆

I think I was just slow on the uptake that this was modeled after another file

@@ -30,7 +30,7 @@
// Load file as 'other' resource.
const response = await fetch('http://localhost:10503/preload.html');
const ab = await response.arrayBuffer();
document.querySelector('#corsfont').textContent = ab.length;
Copy link
Collaborator

Choose a reason for hiding this comment

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

this change is just about text and doesn't matter at all right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

idk, would the font be loaded if there were no text?

Copy link
Collaborator

Choose a reason for hiding this comment

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

oh, oh I see what I'm missing now sorry :)

  1. new ArrayBuffer().length === undefined, not just a semantic difference like in node
  2. el.textContent = undefined clears all textContent, and does not do some sort of string coercion to "undefined"

Copy link
Member

Choose a reason for hiding this comment

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

el.textContent = undefined clears all textContent, and does not do some sort of string coercion to "undefined"

just to be clear, while the actual behavior is unintended and pointless, the intended behavior was also pointless. There's no reason to add this to the page at all, just making sure (poorly, it turns out) the thing is actually loaded and used :)

@connorjclark
Copy link
Collaborator Author

I'm not sure why we need to do any of this, but seems harmless :)

I was testing something entirely unrelated, and chose this fixture as my playground. That's how it jumped out at me :)

@@ -110,7 +110,7 @@ module.exports = [
{
resourceType: 'document',
countOverBudget: '1 request',
sizeOverBudget: '1100±50',
sizeOverBudget: '1150±50',
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

added just enough bytes to the main doc to require this change

@brendankenny brendankenny changed the title misc: ArrayBuffer.byteLength instead of .length in perf budge smoke test misc: fix typo in performance-budget smoke test Jun 26, 2019
@brendankenny brendankenny merged commit 904dfbd into master Jun 26, 2019
@brendankenny brendankenny deleted the trivial-smoke-change branch June 26, 2019 01:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants