Skip to content

Commit

Permalink
Integration with Travis CI
Browse files Browse the repository at this point in the history
Add continuous integration for installation and test running on push
  • Loading branch information
fmaguire committed Feb 23, 2018
1 parent 67a32dd commit f03e232
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 1 deletion.
19 changes: 19 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
language: python

python:
- "3.5"
- "3.6"

before_install:
- sudo apt-get -qq update
- sudo apt-get install -y ncbi-blast+ prodigal
- wget http://github.com/bbuchfink/diamond/releases/download/v0.9.18/diamond-linux64.tar.gz
- tar xzf diamond-linux64.tar.gz
- sudo mv diamond /usr/bin

install:
- pip install -r requirements.txt
- pip install .

script:
- ./test.sh
6 changes: 5 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
requests==2.18.2
biopython>=1.60
filetype>=1.0.0
pytest>=3.0.0
mock>=2.0.0
pandas>=0.15.0
23 changes: 23 additions & 0 deletions test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash
# run unit tests for RGI

# get latest card database
wget -O card_data.tar.bz2 https://card.mcmaster.ca/latest/data
mkdir -p card_data
tar xvf card_data.tar.bz2 -C card_data

# load rgi
rgi load -i card_data/card.json

# for test_1.py
cp card_data/card.json app/_data

# for test_3.py
cp card_data/card.json tests/input

# run unit tests
cd tests
pytest -v -rxs

# exit with the exitcode thrown by pytest
exit $?

0 comments on commit f03e232

Please sign in to comment.