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

Make PageSpeed Insights part of CI #486

Merged
merged 1 commit into from
Nov 29, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion grunt/aliases.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,5 +94,10 @@ module.exports = {
'compile-docs',
'compile-annotated-src',
'compile-downloads'
],

'pagespeed': [
'psiNgrok',
'connect:server:keepalive'
]
}
};
4 changes: 4 additions & 0 deletions gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ module.exports = function(grunt) {
output: 'dist/data'
}
}
},

psiNgrok: {
marionette: {}
}
});
};
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"compile-docs": "grunt dev-docs",
"compile-all": "grunt compile-all",
"compile-downloads": "grunt compile-downloads",
"pagespeed": "grunt pagespeed",
"deploy": "./ship.sh",
"setup": "./setup.sh",
"lint": "grunt lint",
Expand Down Expand Up @@ -68,6 +69,7 @@
"load-grunt-tasks": "^0.6.0",
"marked": "^0.3.2",
"mkdirp": "^0.5.0",
"psi-ngrok": "^0.1.0",
"semver": "^4.2.0",
"underscore": "^1.6.0"
}
Expand Down
25 changes: 25 additions & 0 deletions tasks/psi-ngrok.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
var psiNgrok = require('psi-ngrok');

module.exports = function(grunt) {
grunt.registerMultiTask('psiNgrok', function() {
var async = this.async;

grunt.event.once('connect.server.listening', function(host, port) {
psiNgrok({
pages: ['/', 'additional-resources', 'downloads', 'docs/current', 'updates'],
onError: function(error) {
grunt.fatal(error)
},
port: port,
options: {
//@todo up it to 85-90 when pages speed will be fixed
threshold: 10
Copy link
Member

Choose a reason for hiding this comment

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

What's the impact on testing runtime?

Copy link
Member Author

@denar90 denar90 Sep 19, 2016

Choose a reason for hiding this comment

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

I think impact is not so much but it worth it. Right now we have issue about page speed #394 After fixing it I really don't wanna go back and fix it once more. If someone propose changes which downgrade pagespeed then CI automatically fail it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Or maybe you asking about purpose of adding threshold: 10 so low. I think to add PSI asap to already have it. threshold can be increased after next pr's with pagespeed fixes.
Also it helpful for testing during developing pagespeed fixes.

Copy link
Member

Choose a reason for hiding this comment

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

I think I was referring more to your TODO there - it sounds like PageSpeed is having some impact on the build times and I was curious as to whether it would cause issues in future.

With the threshold being low, what's needed to bring it up?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ideally pages have to have threshold about 85, but right now on some pages it's lower. So value is set threshold: 10 to successfully pass the build process. When page speed will be fixed we can up it.
Other then that, it will be not run during deploy, so it's only just for checking new changes.

Copy link
Member

Choose a reason for hiding this comment

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

Ohh I see, it's related to scoring. For some reason I though threshold was related to a number of pages to run through it! My bad :P

Copy link
Member Author

Choose a reason for hiding this comment

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

No problem 👍

}
}).then(function() {
var done = async();

done();
});
});
});
};
2 changes: 1 addition & 1 deletion travis-runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ then
git commit -m "deploy"
git push --force --quiet "https://${GH_TOKEN}@github.com/marionettejs/marionettejs.com.git" master:gh-pages > /dev/null 2>&1
else
npm run lint && npm run test
npm run lint && npm run test && npm run pagespeed
fi