Travis-CI and MongoDB
It is very easy to use travis-ci w/ projects using MongoDB in unit tests. It took only minutes to prepare my github project ttrelle/spring-batch-mongodb-support.
1) I had to log in to travis-ci, sync my github projects and activate travis for the above mentioned project.
2) Wrote a .travis.yml file:
language: java
services: mongodb
The 2nd option will provide a mongod process on port 27017 (default) during the unit tests.
3) Pushed to github to trigger a travis build.
Et voilá: https://travis-ci.org/ttrelle/spring-batch-mongodb-support
Written by Tobias Trelle
Related protips
3 Responses
Hi Tobias,
thanks for the tip!
Saved my day yesterday when I wanted to make my newly added mongo tests pass on travis.
cheerio, Mike
Hi Ryan,
I never ran into problems (yet). The Travis lifecycle is as follows:
- compile the sources
- start up the needed database(s)
- run tests
But I have to admit, my github sources are rather static, so the Travis build isn't fired that often.
This was surprisingly simple, thanks for the tip.