Skip to content

Continuous Integration

jbpros edited this page May 13, 2011 · 4 revisions

Using Cucumber in a Continuous Integration (CI) environment is relatively straightforward.

The cucumber executable will exit with an exit status different from 0 if one or more scenarios are failing, and this is all your CI server needs to know.

First, you have to make sure your CI server executes cucumber. Most CI setups invoke some kind of build tool, typically Rake, Ant or Maven and we recommend you execute cucumber from one of these.

Rake

If your CI server is using Rake, just make sure it executes your cucumber task.

Ant, Maven and JUnit output

Many CI servers can interpret XML files produced by the Ant JUnit task and display them as HTML. Some can even create reports over time.

If you’re using such a CI server we recommend you use Cucumber with the junit formatter.

Example. To get started using cucumber in Hudson, just add a build step running
cucumber -f junit --out %WORKSPACE%’ and then check the
‘Publish JUnit test result report’, and enter *.xml in the ‘Test report XMLs’ field.
Save and run. (Later improve by using a rake task and placing your output in a subfolder).

If you’re using Ant, you can run cucumber with the exec task. If you’re using JRuby or cuke4duke you can also take a peek at cuke4duke’s Ant documentation

If you’re using Maven, we recommend you follow cuke4duke’s Maven documentation

Clone this wiki locally