• Welcome to the new COTI server. We've moved the Citizens to a new server. Please let us know in the COTI Website issue forum if you find any problems.

Using Travis

Leitz

SOC-14 1K
Admin Award
Baron
For those who like to test in addition to your tests, check out travis-ci.org. When you link your GitHub repo to Travis, and have a good ".travis.yml" file (note the preceding dot), any git push triggers a travis run. You can specify a few things like what version(s) of your language to run, etc. Seeing that green "passed" is a nice way to end your coding session.

Here's the .travis.yml file for my rb_tools repo:
Code:
language: ruby

rvm:
  - 2

install: gem install sqlite3

This one is for the py_tools repo:
Code:
language: python

python:
 - "2.6"
 - "2.7"
 - "3.6"
 - "nightly"

script:
  pytest
 
I've been learning how to use MongoDB and Ruby together, but the Travis runs failed because I was testing against an already populated data set. Figured out how to drop the data set between tests and set Travis up to pass. Yay!

Code:
# .travis.yml

language: ruby

rvm:
  - 2

install: 
  - gem install sqlite3 mongo

services:
  - mongodb
 
Back
Top