I am starting a new project, and investigating Yeoman and Mocha for use on the project. We use Jenkins for CI.
So far, I have figured out how to get client side testing working, but I am struggling to generate test results (and eventually coverage reports) that can be tracked by Jenkins. Has anybody successfully done this?
The Emma Plugin for Jenkins is a reporting plugin. This means it runs after the build and tests are complete, in order to process the Emma output into a form which Jenkins understands.
jacoco-plugin A plugin for Jenkins to capture and visualize code coverage testing results for projects using the JaCoCo for code-coverage analysis. Note: Version 2.0. 0 and higher requires using JaCoCo 0.7.
The xunit reporter works well, for generating test reports.
Command line:
mocha -R xunit | grep "<" > reports/mocha.xml
With Jenkins, just 'publish JUnit test result report', it should work.
But, I'm still finding a solution to publish the coverage report.
I have been able to add code coverage reports to my Jasmine tests using testem. Testem seems to work with Mocha too. https://github.com/airportyh/testem
Follow the instructions on the read me file. It explains how to use testem ci in continuous integration mode.
You will need to get the tap plugin - https://wiki.jenkins-ci.org/display/JENKINS/TAP+Plugin - from jenkins.
Vytch
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With