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: add script to automatically test lighthouse on a page from devtools #11539

Merged
merged 16 commits into from
Nov 4, 2020

Conversation

adamraine
Copy link
Member

@adamraine adamraine commented Oct 8, 2020

This script is based heavily on run-web-tests.sh. It's a hacky solution that executes a single DevTools web test which runs lighthouse on a page and then prints the LHR. The solution divides run-web-tests.sh into two parts so the phony web test can be inserted after Lighthouse is rolled into DevTools.

This should help test #11508 in GCP.

Currently, the script always has a NO_SCREENSHOTS error for Speed Index. Will this be a problem when searching for PROTOCOL_TIMEOUT errors?

Fixes #11529
Part of #6512

@connorjclark
Copy link
Collaborator

connorjclark commented Oct 8, 2020

Currently, the script always has a NO_SCREENSHOTS error for Speed Index. Will this be a problem when searching for PROTOCOL_TIMEOUT errors?

I don't remember (or maybe we never knew) why this happens, but the current layout tests do mark speed-index as flaky. I think it's safe to just ignore.

@patrickhulce
Copy link
Collaborator

I don't remember (or maybe we never knew) why this happens, but the current layout tests do mark speed-index as flaky

IIRC it had something to do with the content shell used by layout tests, but it's been a very long time since we looked into it AFAIK.

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.

thanks @adamraine this will be great for tracking down our PROTOCOL_TIMEOUT nemesis (and just general explorations into DevTools errors compared to CLI 🎉 )!

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.

worked like a charm! just a few things to help us in the future, but LGTM

lighthouse-core/test/chromium-web-tests/run-web-tests.sh Outdated Show resolved Hide resolved
@@ -6,81 +6,13 @@
# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
##

set -euo pipefail
Copy link
Collaborator

Choose a reason for hiding this comment

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

set -u at least still seems relevant, no?

Copy link
Member Author

Choose a reason for hiding this comment

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

@patrickhulce Adding set -u causes the DevTools check to fail in GitHub check. Seems to be failing on the yarn --frozen-lockfile step: https://github.com/GoogleChrome/lighthouse/runs/1327351848.

This appears to be a failure of the script but I can't tell where. What do you make of this?

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm maybe set -u was not the problem?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah that error has been happening for the past several weeks (maybe even months?) and seems like we hit some sort of github network troubles after downloading all of chromium build tooling all the time heh 😄

I think this is unrelated to set -u

lighthouse-core/test/chromium-web-tests/roll-devtools.sh Outdated Show resolved Hide resolved
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.

@adamraine any chance you could add a brief note about this somewhere? https://github.com/GoogleChrome/lighthouse/blob/master/lighthouse-core/test/chromium-web-tests/README.md maybe?

(we should probably put together a "so you're trying to test/debug lighthouse in devtools..." doc soon)

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 though a comment in the readme about our devtools suite that this thing exists like @brendankenny suggested would be cool too :)

package.json Outdated Show resolved Hide resolved
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.

Script to automate running Lighthouse in DevTools
5 participants