forked from cBioPortal/cbioportal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
99 lines (99 loc) · 2.76 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
sudo: required
language: java
jdk: openjdk8
services:
- docker
- mysql
cache:
directories:
- $HOME/.m2
- $HOME/maven
env:
matrix:
- MAVEN_VERSION=3.5.4 TEST=core
- MAVEN_VERSION=3.5.4 TEST=python-validator
- MAVEN_VERSION=3.5.4 TEST=sanity-checks
- MAVEN_VERSION=3.5.4 TEST=end-to-end
install:
- |
if [[ "${TEST}" == core || "${TEST}" == end-to-end ]]
then
mkdir -p ~/maven
test -d ~/maven/$MAVEN_VERSION/bin || { \
find ~/maven -mindepth 1 -delete && \
mkdir -p ~/maven/$MAVEN_VERSION && \
wget -O - http://www-us.apache.org/dist/maven/maven-3/${MAVEN_VERSION}/binaries/apache-maven-${MAVEN_VERSION}-bin.tar.gz | \
tar -C ~/maven/$MAVEN_VERSION --strip-components=1 -xzf -; }
fi
before_script:
- |
if [[ "${TEST}" == core ]]
then
mysql --user root --password= <<< 'CREATE DATABASE cgds_test' && \
mysql --user root --password= <<< "CREATE USER 'cbio_user'@'localhost' IDENTIFIED BY 'somepassword'" && \
mysql --user root --password= <<< "GRANT ALL ON cgds_test.* TO 'cbio_user'@'localhost'" && \
mysql --user root --password= <<< "flush privileges"
fi
script:
- |
if [[ "${TEST}" == python-validator ]]
then
docker run -v ${PWD}:/cbioportal python:3.4 /bin/sh -c '
cd /cbioportal &&
pip install -r requirements.txt &&
export PYTHONPATH=/cbioportal/core/src/main/scripts &&
cd /cbioportal/core/src/test/scripts/ &&
python unit_tests_validate_data.py &&
python system_tests_validate_data.py &&
python system_tests_validate_studies.py'
fi
- |
if [[ "${TEST}" == sanity-checks ]]
then
bash test/test_db_version.sh
fi
- |
if [[ "${TEST}" == core ]]
then
mkdir -p ~/.m2 && \
cp .travis/settings.xml ~/.m2
fi
- |
if [[ "${TEST}" == core ]]
then
~/maven/$MAVEN_VERSION/bin/mvn \
-e \
-U \
-Ppublic \
-Dauthenticate=false \
-Dfinal.war.name=cbioportal \
-Ddb.test.username=cbio_user \
-Ddb.test.password=somepassword \
clean \
install \
integration-test
fi
- |
if [[ "${TEST}" == end-to-end ]]
then
~/maven/$MAVEN_VERSION/bin/mvn \
-q \
-U \
-Ppublic \
-DskipTests \
-Dauthenticate=false \
-Dfinal.war.name=cbioportal \
clean \
install
fi
- |
if [[ "${TEST}" == end-to-end ]]
then
cd test/end-to-end && \
docker-compose up -d && \
sleep 30s && \
cd ../.. && \
# spot visual regression by comparing screenshots in the repo with
# screenshots of this portal loaded with the data from the amazon db
bash test/end-to-end/test_make_screenshots.sh test/end-to-end/screenshots.yml
fi