Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Automate performance testing with lighthouse CI

Automate performance testing with lighthouse CI

An introduction to performance testing and walkthrough of how to integrate lighthouse CI into your project

Hassan Hafez

January 01, 2020
Tweet

Other Decks in Programming

Transcript

  1. Hassan H Hassan Hafez F r o n t e

    n d E n g i n e e r @ b u l k w h i z @ H a s s a n h a f e z z
  2. Interesting Fac • A one-second delay in mobile load times

    can impact conversion rate by up to 20% Interesting Facts • 53% of people abandon a mobile site if takes more than 3 seconds to load. References https://bit.ly/2PM9BMd https://bit.ly/35JYngH https://www.thinkwithgoogle.com/feature/testmysite/ • To see how can speed potentially affect your revenue see Impact Calculator tool.
  3. 2- From the command line Install Lighthouse module: npm install

    -g lighthouse Run an audit lighthouse <url>
  4. It's not enough to make a one time effort you

    have to change your lifestyle. Performance is a lot like getting fit A study found that 40% websites get regressed in performance after 6 months of the initial optimization. References https://www.youtube.com/watch?v=YJGCZCaIZkQ
  5. My automation w Get a Lighthouse report alongside every PR.

    My automation wishlist Have quick pass/fail status with each PR right away in Github. Test against my own rules/ thresholds. Be able to track performance metrics and Lighthouse scores over time. Compare between versions to find improvements and regressions.
  6. GitHub Checks 1- install the app to the target repo.

    2- add the token to your build environment as LHCI_GITHUB_APP_TOKEN
  7. My automation w Get a Lighthouse report alongside every PR.

    My automation wishlist Have quick pass/fail status with each PR right away in Github. Test against my own rules/ thresholds. Be able to track performance metrics and Lighthouse scores over time. Compare between versions to find improvements and regressions.
  8. Setting up LHCI server on Heroku 1- Create account and

    install Heroku CLI and login 2- Setting up your repo with LHCI node server
  9. Connect the server to your repo Add your token to

    CI with the environment variable LHCI_TOKEN
  10. Sum up Sum up Get a Lighthouse report alongside every

    PR and prevent regressions Have quick pass/fail status with each PR right away in Github. Test against my own rules/ thresholds. Track performance metrics and Lighthouse scores over time. Compare between versions to find improvements and regressions.