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.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
date: 2017-07-04
title: How to use Google PageSpeed Test in CI
summary: Is it possible to test site using Google PageSpeed Insight in CI ? The answer is YES!
slug: how-to-use-google-pagespeed-test-in-ci
lang: en-US
tags: [ci, performance]
Motivation
You know site performance is important for SEO, Conversion but it is difficult to find how to test it continuously. (It was difficult for me...).
So I will explain how to set up peformance test in CI using Google PageSpeed Insights.
Outline
I will explain continuous performance test settings using Google PageSpeed Insights in Travis CI with heroku.
Application I want to test is this blog which is generated by Pelican so the application is totally static site (no need DB and server side program).
Heroku app
Travis CI connected with github repository
Basic flow is below.
1 Make PR in github repository
2 Start test process in Travis CI
1 Install depandencies
2 Build application
3 Push built application to heroku
4 Run Google Page Insight test
Prepare heroku
First step is setup heroku for test the application.
date: 2017-07-04
title: How to use Google PageSpeed Test in CI
summary: Is it possible to test site using Google PageSpeed Insight in CI ? The answer is YES!
slug: how-to-use-google-pagespeed-test-in-ci
lang: en-US
tags: [ci, performance]
Motivation
You know site performance is important for SEO, Conversion but it is difficult to find how to test it continuously. (It was difficult for me...).
So I will explain how to set up peformance test in CI using Google PageSpeed Insights.
Outline
I will explain continuous performance test settings using Google PageSpeed Insights in Travis CI with heroku.
Application I want to test is this blog which is generated by Pelican so the application is totally static site (no need DB and server side program).
Basic flow is below.
Prepare heroku
First step is setup heroku for test the application.
This article could be good reference to make static server on heroku !
Edit CI settings
Second step is setup travis CI.
You can see travis CI settings for repository like below.
You need those settings in
Environment Variables
section.HEROKU_API_KEY
Heroku app is git repository and it's private so to clone it in travis server you need this token.
You can see it thru this command.
bash $ heroku auth:token
TEST_SITE_GIT_REMOTE
heroku app git url. git protocol would be better
[email protected]:${app_name}.git
instead of https protocol not to be asked id/password everytime.TEST_SITE_URL
heroku app url to test.
Edit CI tasks
Basic
travis.yml
is here.You need replace
${your install process here}
and${your build process here}
for your applicationsetup_heroku.sh
setup_heroku.sh
This script add
ssh private key
to heroku to clone repository thu heroku CLI.I use nodejs heroku command which is not recommended by heroku because I could not install other installation methods...
If you have idea let me know!
npm test $TEST_SITE_URL
psi is npm module to do Google pageSpeed Insights.
Reference
You can check example here !
https://github.com/tomoyukikashiro/blog.tomoyukikashiro.me
Let me know if you have question !!
The text was updated successfully, but these errors were encountered: