forked from prestodb/presto-admin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
58 lines (58 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
language: python
python: "2.7"
sudo: required
group: deprecated-2017Q2
dist: trusty
services:
- docker
env:
global:
- PYTHONPATH=$PYTHONPATH:$(pwd)
- LONG_PRODUCT_TESTS="tests/product/test_server_install.py tests/product/test_status.py tests/product/test_collect.py tests/product/test_catalog.py tests/product/test_control.py tests/product/test_server_uninstall.py"
matrix:
- ARTIFACTS=true
- OTHER_TESTS=true
- SHORT_PRODUCT_TEST_GROUP=0
- LONG_PRODUCT_TEST_GROUP_PRESTO_ADMIN="tests/product/test_server_install.py"
- LONG_PRODUCT_TEST_GROUP_PRESTO_ADMIN_AND_PRESTO="tests/product/test_status.py"
- LONG_PRODUCT_TEST_GROUP_PRESTO_ADMIN_AND_PRESTO="tests/product/test_collect.py tests/product/test_server_uninstall.py"
- LONG_PRODUCT_TEST_GROUP_PRESTO_ADMIN_AND_PRESTO="tests/product/test_catalog.py"
- LONG_PRODUCT_TEST_GROUP_PRESTO_ADMIN_AND_PRESTO="tests/product/test_control.py"
before_install:
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
- sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
- sudo apt-get update
- sudo apt-get -y install docker-ce
install:
- pip install --upgrade pip==9.0.1
- pip install -r requirements.txt
- pip install tox==3.0.0 tox-travis==0.10
before_script:
- make docker-images
- make presto-server-rpm.rpm
script:
- |
if [ -v ARTIFACTS ]; then
./bin/build-artifacts-in-docker.sh
elif [ -v SHORT_PRODUCT_TEST_GROUP ]; then
ALL_PRODUCT_TESTS=$(find tests/product/ -name 'test_*py' | grep -v __init__ | xargs wc -l | sort -n | head -n -1 | awk '{print $2}' | tr '\n' ' ')
for LONG_PRODUCT_TEST in ${LONG_PRODUCT_TESTS[@]}; do
ALL_PRODUCT_TESTS=${ALL_PRODUCT_TESTS//$LONG_PRODUCT_TEST/};
if [ $? -ne 0 ]; then
exit 1
fi
done
SHORT_PRODUCT_TESTS=$(echo $ALL_PRODUCT_TESTS | tr ' ' '\n' | awk "NR % 1 == $SHORT_PRODUCT_TEST_GROUP" | tr '\n' ' ')
./bin/ci-product.sh ${SHORT_PRODUCT_TESTS};
elif [ -v LONG_PRODUCT_TEST_GROUP_PRESTO_ADMIN ]; then
export IMAGE_NAMES="standalone_presto_admin"
./bin/ci-product.sh ${LONG_PRODUCT_TEST_GROUP_PRESTO_ADMIN};
elif [ -v LONG_PRODUCT_TEST_GROUP_PRESTO_ADMIN_AND_PRESTO ]; then
export IMAGE_NAMES="standalone_presto standalone_presto_admin"
./bin/ci-product.sh ${LONG_PRODUCT_TEST_GROUP_PRESTO_ADMIN_AND_PRESTO}
elif [ -v OTHER_TESTS ]; then
./bin/ci-basic.sh
else
echo "Unknown test"
exit 1
fi