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(lightwallet): add perf-budget smoke test #8853

Merged
merged 2 commits into from
May 6, 2019
Merged

Conversation

brendankenny
Copy link
Member

@brendankenny brendankenny commented May 4, 2019

added a smoke test for the resource-summary (#8522) and performance-budget (#8539) audits.

This just rips off some things from the two other perf testing pages so we could get a decent mix of resources loaded. Feel free to make suggestions for improvements :)

Three other things done in the process:

  • moved the perf smoke test to its own config file (off of --preset=perf) so that it could include a budget
  • made undefined in smoke expectations match with a property not found on the actual result. Previously the matching actual property had to explicitly be set to undefined to match, which isn't even possible because smoke test results are saved/loaded from JSON, where undefined properties get dropped.
  • added '±' as an alias for '+/-' as one of the allowed operators, cause it's cooler :)

part of #8331

@brendankenny
Copy link
Member Author

cc @khempenius

displayValue: '11 requests • 164 KB',
details: {
items: [
{resourceType: 'total', requestCount: 11, size: '168000±1000'},
Copy link
Member Author

Choose a reason for hiding this comment

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

used ± to leave some leeway on some of the assets because most of them are shared with other smoke tests. This will allow the test to absorb changes to them of a few hundred bytes or so, but we can always make it exact.

{
resourceType: 'image',
countOverBudget: '1 request',
sizeOverBudget: undefined,
Copy link
Member Author

Choose a reason for hiding this comment

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

Letting undefined values in the expectations match not defined properties in actual allows testing for things like sizeOverBudget when not over budget, when its value is set to undefined and so it lost in the JSON shuffle.

If we just left this sizeOverBudget off the expectations it would indeed match an actual undefined value, which is good...but it would also match if actual was erroneously returning a numeric sizeOverBudget, so it would be useless.

Copy link
Collaborator

Choose a reason for hiding this comment

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

should we add a comment somewhere to this effect?

Copy link
Member Author

Choose a reason for hiding this comment

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

should we add a comment somewhere to this effect?

added a comment to make it clear to anyone reading the expectations file

{
resourceType: 'image',
countOverBudget: '1 request',
sizeOverBudget: undefined,
Copy link
Collaborator

Choose a reason for hiding this comment

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

should we add a comment somewhere to this effect?

throttlingMethod: 'devtools',
onlyCategories: ['performance'],

// A mixture of under, over, and meeting budget to exercise all paths.
Copy link
Collaborator

Choose a reason for hiding this comment

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

maybe include the path to the file where these budgets are being tested so we can look them up for correctness later? it's a bit weird that our "expectations" are basically here in the config that's shared with several other smokes

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 a bit weird that our "expectations" are basically here in the config
I mean, that's kind of what all configs are :)

that's shared with several other smokes

I could split it into a new smoke budget category? Or is it fine to leave as one big perf category

{resourceType: 'other', budget: 2}, // meets budget
{resourceType: 'third-party', budget: 0},
],
timings: [
Copy link
Collaborator

Choose a reason for hiding this comment

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

these aren't being used right now, correct?

Copy link
Member Author

Choose a reason for hiding this comment

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

these aren't being used right now, correct?

right, they're parsed by budget.js, but the audit doesn't check them yet

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.

meant to LGTM, none of those are blocking from my perspective :)

@paulirish paulirish added the P1 label May 5, 2019
@paulirish paulirish merged commit b6c28d6 into master May 6, 2019
@paulirish paulirish deleted the smokebudget branch May 6, 2019 04:30
@paulirish paulirish mentioned this pull request May 6, 2019
67 tasks
paulirish pushed a commit that referenced this pull request May 28, 2019
* tests(lightwallet): add perf-budget smoke test

* add undefined comment
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.

3 participants