ayb_la
Last Updated: May 15, 2019
·
3.806K
· tobiastrelle

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

3 Responses
Add your response

12218

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

over 1 year ago ·
13321

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.

over 1 year ago ·
13656

This was surprisingly simple, thanks for the tip.

over 1 year ago ·