forked from Parisson/TimeSide
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
74 lines (64 loc) · 2.5 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
language: python
python:
- "2.7"
sudo: required
services:
- docker
env:
global:
- DOCKER_COMPOSE_VERSION: 1.5.2
matrix:
- TEST_TARGET=default # Default unit test
- TEST_TARGET=cli # Test for TimeSide command line interfaces
- TEST_TARGET=doc # Test documentation and included doctest
- TEST_TARGET=server # Test timeside.server
before_install:
- docker-compose --version
- sudo rm /usr/local/bin/docker-compose
- curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose
- chmod +x docker-compose
- sudo mv docker-compose /usr/local/bin
- docker-compose --version
# Install TimeSide
install:
- docker-compose -f docker-compose.yml -f conf/build.yml build
# command to run tests
#before_script:
# # -------------DEFAULT--------------------
# - if [[ $TEST_TARGET == 'default' ]]; then
# pip install coverage;
# fi
# # -------------DOC------------------------
# - if [[ $TEST_TARGET == 'doc' ]]; then
# pip install sphinx numpydoc;
# fi
script:
# -------------DEFAULT--------------------
- if [[ $TEST_TARGET == 'default' ]]; then
docker-compose -f docker-compose.yml -f conf/dev.yml run app sh -c "cd /srv/src/timeside; pip install -U coverage; coverage run --source=timeside --omit=timeside/plugins/analyzer/external/yaafe.py setup.py test";
fi
# -------------DOC------------------------
- if [[ $TEST_TARGET == 'doc' ]]; then
docker-compose -f docker-compose.yml -f conf/build.yml run app sh -c "cd /srv/src/timeside/doc; pip install sphinx numpydoc; make html; make doctest";
fi
# # -------------CLI-------------------------
- if [[ $TEST_TARGET == 'cli' ]]; then
docker-compose -f docker-compose.yml -f conf/build.yml run app sh -c "cd /srv/src/timeside; ./tests/test_scripts.sh";
fi
# # -------------SERVER-------------------------
# # Get environment variables from .env file and run test
- if [[ $TEST_TARGET == 'server' ]]; then
docker-compose up -d;
sleep 20;
curl --fail --retry 10 --retry-delay 5 -v http://localhost:8000/timeside/items/1/;
fi
#
after_script:
- if [[ $TEST_TARGET == 'server' ]]; then
docker-compose stop;
fi
after_success:
# - # -------------DEFAULT--------------------
- if [[ $TEST_TARGET == 'default' ]]; then
docker-compose -f docker-compose.yml -f conf/dev.yml run app sh -c "cd /srv/src/timeside; pip install coveralls; coveralls";
fi