Running Lighthouse audits

Jeffrey Paul edited this page Apr 20, 2018 · 2 revisions

This section outlines the components included in the Lighthouse integration with Tide, demonstrates how the integration processes Lighthouse audits of WordPress.org themes, and provides examples of the Tide API with Lighthouse audit results.

Status

Lighthouse auditing of WordPress themes has been integrated by running each theme from wp-themes.com through the Lighthouse CLI, stores the full report, and includes the summary results and a link to the full report in the Tide API. This currently functions locally, XWP is working to get this running on GCP.

Components

The following outlines the components added to Tide in order to integrate Lighthouse in overall Tide auditing of WordPress themes.

  1. Docker Container
    • Lighthouse CLI
    • Lighthouse Server binary (lighthouse-server) Note: Uses an Alpine Image with working Chromium version. Produces consistent results with Lighthouse Chrome extension. Allows reduced image size of 432MB.
  2. Go Lighthouse Server Source Code

Process

The following demonstrates how a WordPress theme is run through a Lighthouse audit and has its results stored and returned via the Tide API.

  1. tide-cluster

    • Starts all Tide services and listens...

  2. lighthouse-server

    • authenticate with Tide API

    • polls a job queue (SQS) for messages to process

    • downloads theme and calculates checksum

    • runs source through gocloc to get code information
    • scans source for Theme header information (required for Lighthouse Report)

    • runs theme through lighthouse at https://wp-themes.com/<theme-slug> and keeps polling for next job.

    • take full report and generate detailed report
    • saves full report to a file store (S3)

    • grabs subset of results reportCategories with only:
      • category name
      • score
      • Description

    • bundles summary result and reference to full report as a message payload
    • payload sent to Tide API instance

Lighthouse Results in Tide API

The following are example responses from the Tide API showing a summary of a Lighthouse report and a detailed result of a Lighthouse report.

Checksum Endpoint (Summary Only)

https://tide.local/api/tide/v1/audit/ab38727534cbeeef043faf1e54a786e22e4e7c6a172a5ccccf23fe6b2f3d28bd?standards=lighthouse

Checksum Endpoint (Details Included)

https://tide.local/api/tide/v1/audit/ab38727534cbeeef043faf1e54a786e22e4e7c6a172a5ccccf23fe6b2f3d28bd?standards=lighthouse&details=all

Note: Results for details is exactly the same as the output from a Lighthouse CI report.

Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.