forked from cBioPortal/cbioportal
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
104 lines (104 loc) · 3.27 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
100
101
102
103
104
sudo: required
language: java
jdk: oraclejdk8
services:
- docker
cache:
directories:
- $HOME/.m2
- $HOME/maven
env:
matrix:
- MAVEN_VERSION=3.3.9 TEST=core
- MAVEN_VERSION=3.3.9 TEST=python-validator
- MAVEN_VERSION=3.3.9 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
- |
if [[ "${TEST}" == python-validator ]]
then
sudo apt-get install python3.4-venv
python3.4 -m venv ~/python-env-validator
source ~/python-env-validator/bin/activate
trap 'deactivate' EXIT
pip install -r requirements.txt
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:
- export PORTAL_HOME=$(pwd)
- |
if [[ "${TEST}" == python-validator ]]
then
source ~/python-env-validator/bin/activate
trap 'deactivate' EXIT
export PYTHONPATH="$PORTAL_HOME/core/src/main/scripts:$PYTHONPATH" && \
pushd $PORTAL_HOME/core/src/test/scripts/ && \
python $PORTAL_HOME/core/src/test/scripts/unit_tests_validate_data.py && \
python $PORTAL_HOME/core/src/test/scripts/system_tests_validate_data.py && \
python $PORTAL_HOME/core/src/test/scripts/system_tests_validate_studies.py && \
popd
fi
- |
if [[ "${TEST}" == core ]]
then
mkdir -p ~/.m2 && \
cp .travis/settings.xml ~/.m2
fi
- |
if [[ "${TEST}" == core ]]
then
~/maven/$MAVEN_VERSION/bin/mvn \
-e \
-DPORTAL_HOME=$PORTAL_HOME \
-Ppublic \
-Dfinal.war.name=cbioportal \
-Ddb.user=cbio_user \
-Ddb.password=somepassword \
-Ddb.host=127.0.0.1 \
-Ddb.connection_string=jdbc:mysql://127.0.0.1:3306/ \
clean integration-test
fi
- |
if [[ "${TEST}" == end-to-end ]]
then
~/maven/$MAVEN_VERSION/bin/mvn \
-e -DPORTAL_HOME=$PORTAL_HOME \
-Ppublic -DskipTests \
-Dfinal.war.name=cbioportal \
-Ddb.user=cbio_user \
-Ddb.password=cbio_pass \
-Ddb.portal_db_name=public_test \
-Ddb.connection_string=jdbc:mysql://devdb.cbioportal.org:3306/ \
-Ddb.host=devdb.cbioportal.org \
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
notifications:
slack: cbioportal:S2qVTFTFMtizONhCOe8BYxS6