Question

I'm going through the tutorial on YSlow and Phantom js in Jenkins here: http://yslow.org/phantomjs/

Everything appears to be working great except the Jenkins builds are failing. I think this is due to the violations that YSlow is finding (6 for the particular site I am measuring). I'd rather have the build be successful (or unstable) vs. failed though

Is that possible with this or will I have to resort to something like the postgroovy or text finder plugin?

This is the console output:

phantomjs.exe yslow.js -i grade -t 50 --format junit http://www.somesite.com 1>yslow.xml 
D:\Apps\Jenkins\workspace\YSlow_Test>exit 6 
Build step 'Execute Windows batch command' marked build as failure

Thanks

Was it helpful?

Solution

Any non-zero exit code at the end of your Execute Windows batch command build step will result in build step being marked as failure.

To have the build step marked as success, you need an exit code of 0. I don't know anything about "yslow" or "phantomjs" and why they are giving you exit code of non-zero, but from "batch" side of things, you need only write exit 0 at the end of your build step if you want to overwrite the exit code of your phantomjs command.

You can then use Text Finder plugin to parse the console log and mark build as unstable when certain conditions are met.

Reading over this answer, Configuring yslow on Jenkins looks like you need TAP plugin to have the functionality of unit testing marking the build as unstable automatically

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top