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

DevTools webtests improvements #11414

Closed
1 of 10 tasks
patrickhulce opened this issue Sep 11, 2020 · 11 comments
Closed
1 of 10 tasks

DevTools webtests improvements #11414

patrickhulce opened this issue Sep 11, 2020 · 11 comments
Assignees

Comments

@patrickhulce
Copy link
Collaborator

patrickhulce commented Sep 11, 2020

Summary

Now that we've started to bring the DevTools testing into core we can start to make them even stronger :)

Miscellaneous thoughts:

@patrickhulce
Copy link
Collaborator Author

cc @connorjclark I'm sure he has more ideas too :)

@brendankenny
Copy link
Member

Assertions on the rendering of the report

heh, I was going to suggest the same after seeing #11411 passing without the upstream changes landing yet :)

@connorjclark
Copy link
Collaborator

connorjclark commented Sep 11, 2020

Yeah, we should do all these things.

Assertions on the rendering of the report. AFAIK all our current tests assert on the LHR are obtained from a spy on internal methods.

We have these:

https://github.com/GoogleChrome/lighthouse/blob/master/third-party/chromium-webtests/webtests/http/tests/devtools/lighthouse/lighthouse-view-trace-run.js#L34
https://github.com/GoogleChrome/lighthouse/blob/master/third-party/chromium-webtests/webtests/http/tests/devtools/lighthouse/lighthouse-successful-run.js#L83
https://github.com/GoogleChrome/lighthouse/blob/master/third-party/chromium-webtests/webtests/http/tests/devtools/lighthouse/lighthouse-export-run.js#L39

Some sort of testing that the complete rendering pipeline works would be great for testing PRs like #11411

Right, I'd expect them to fail now, because we do have rendering tests. I think devtools doesn't run their layout tests in their repo yet. @TimvdLippe can you confirm if you run the tests in tests/webtests on trybots? That's where all the Lighthouse layout tests are.

I just ran yarn test-devtools and get:

ninja: Entering directory `out/Default'
ninja: error: '../../front_end/third_party/lighthouse/report-assets/report.d.ts', needed by 'resources/inspector/third_party/lighthouse/locales/ar-XB.json', missing and no known rule to make it
error Command failed with exit code 1.

Which I assume is also related to these changes. (EDIT: yea, here's a pr: #11418 )

@patrickhulce
Copy link
Collaborator Author

We have these:

Ah thanks yeah I forgot about those. That caching seems to explain why they didn't fail then haha. I wish we could also cache on some hash of devtools files to avoid going an entire week without learning about it (are we sure the cached assets fall out after a week no matter what or just a week after they're not used? their policy language makes me think these might last forever given our frequency of runs), but I guess that's a circular problem with the cache to begin with sooooo, no go. Darn.

@brendankenny
Copy link
Member

That caching seems to explain why they didn't fail then haha

wait, but why didn't #11411 break the renderer since it gets rid of Runtime.cachedResources and uses globalThis.EXPORTED_CACHED_RESOURCES_ONLY_FOR_LIGHTHOUSE but the cached devtools code presumably wouldn't have that new object yet?

@patrickhulce
Copy link
Collaborator Author

wait, but why didn't #11411 break the renderer since it gets rid of Runtime.cachedResources and uses globalThis.EXPORTED_CACHED_RESOURCES_ONLY_FOR_LIGHTHOUSE but the cached devtools code presumably wouldn't have that new object yet?

I don't know. At the time I said that I hadn't looked at #11417 yet 😆 I had it in my head that we wouldn't have rebuilt for devtools at all if the hash key wasn't changed (like how the lantern tests work), but now I'm seeing it should've been run with a mismatched old DevTools, so I have the same question as you.

@connorjclark
Copy link
Collaborator

I wish we could also cache on some hash of devtools files to avoid going an entire week without learning about it

Already on it #11417

(are we sure the cached assets fall out after a week no matter what or just a week after they're not used? their policy language makes me think these might last forever given our frequency of runs)

darn! totally right. This is quite important–we should write to disk a file that only changes every weeks (with some time maths or sumthin).

@patrickhulce
Copy link
Collaborator Author

Already on it #11417

I meant a hash of DevTools changes in Chromium like a hypothetical something that would have invalidated our cache when https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2398829/10/front_end/third_party/lighthouse/report-assets/report-generator.js landed. But figuring that out is the same as doing the work that we're caching, so it's moot haha

@brendankenny
Copy link
Member

wdyt about dropping the need for wget?

Sucks to have to install it so some scripts can basically curl some things :)

I don't see any unusual things going on, seems like it would be a simple replacement?

@connorjclark
Copy link
Collaborator

Closing because we're gonna replace webtests with e2e.

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

No branches or pull requests

5 participants