9
9
global :
10
10
- PA_TEST_ONLINE_INSTALLER=true
11
11
- PYTHONPATH=$(pwd)
12
+ - LONG_PRODUCT_TESTS="tests/product/test_server_install.py tests/product/test_status.py tests/product/test_collect.py tests/product/test_connectors.py tests/product/test_control.py tests/product/test_server_uninstall.py"
12
13
matrix :
13
14
- OTHER_TESTS=true
14
15
- SHORT_PRODUCT_TEST_GROUP=0
15
16
- SHORT_PRODUCT_TEST_GROUP=1
16
- - SHORT_PRODUCT_TEST_GROUP=2
17
17
- LONG_PRODUCT_TEST_GROUP_STANDALONE_PRESTO_ADMIN="tests/product/test_server_install.py"
18
18
- LONG_PRODUCT_TEST_GROUP_STANDALONE_PRESTO_ADMIN_AND_PRESTO="tests/product/test_status.py"
19
19
- LONG_PRODUCT_TEST_GROUP_STANDALONE_PRESTO_ADMIN_AND_PRESTO="tests/product/test_collect.py"
@@ -26,29 +26,38 @@ install:
26
26
before_script :
27
27
- make docker-images
28
28
- make presto-server-rpm.rpm
29
+ - PYTHON_VERSION=$(python -c 'import sys; print(".".join(map(str, sys.version_info[:3])))')
30
+ - |
31
+ if [[ ! $PYTHON_VERSION < "2.6" ]] && [[ $PYTHON_VERSION < "2.7" ]]; then
32
+ TOX_PYTHON_VERSION="py26"
33
+ elif [[ ! $PYTHON_VERSION < "2.7" ]] && [[ $PYTHON_VERSION < "2.8" ]]; then
34
+ TOX_PYTHON_VERSION="py27"
35
+ else
36
+ echo "Invalid version of python: "$PYTHON_VERSION && exit 1
37
+ fi
29
38
script :
30
39
- |
31
40
if [ -v SHORT_PRODUCT_TEST_GROUP ]; then
32
41
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' ' ');
33
42
for LONG_PRODUCT_TEST in ${LONG_PRODUCT_TESTS[@]}; do
34
43
ALL_PRODUCT_TESTS=${ALL_PRODUCT_TESTS//$LONG_PRODUCT_TEST/};
35
- done
36
- make test-images
37
- SHORT_PRODUCT_TESTS=$(echo $ALL_PRODUCT_TESTS | tr ' ' '\n' | awk "NR % 3 == $SHORT_PRODUCT_TEST_GROUP" | tr '\n' ' ');
44
+ done
45
+ SHORT_PRODUCT_TESTS=$(echo $ALL_PRODUCT_TESTS | tr ' ' '\n' | awk "NR % 2 == $SHORT_PRODUCT_TEST_GROUP" | tr '\n' ' ');
46
+ make test-images &&
38
47
tox -e $TOX_PYTHON_VERSION -- -a '!quarantine,!offline_installer' ${SHORT_PRODUCT_TESTS};
39
48
elif [ -v LONG_PRODUCT_TEST_GROUP_STANDALONE_PRESTO_ADMIN ]; then
40
49
export IMAGE_NAMES="standalone_presto_admin";
41
50
make test-images &&
42
51
tox -e $TOX_PYTHON_VERSION -- -a '!quarantine,!offline_installer' ${LONG_PRODUCT_TEST_GROUP_STANDALONE_PRESTO_ADMIN};
43
- elif [ -v LONG_PRODUCT_TEST_GROUP_STANDALONE_PRESTO_ADMIN_AND_PRESTO]; then
52
+ elif [ -v LONG_PRODUCT_TEST_GROUP_STANDALONE_PRESTO_ADMIN_AND_PRESTO ]; then
44
53
export IMAGE_NAMES="standalone_presto standalone_presto_admin";
45
54
make test-images &&
46
- tox -e $TOX_PYTHON_VERSION -- -a '!quarantine,!offline_installer' ${LONG_PRODCUT_TEST_GROUP_STANDALONE_PRESTO_ADMIN_AND_PRESTO };
55
+ tox -e $TOX_PYTHON_VERSION -- -a '!quarantine,!offline_installer' ${LONG_PRODUCT_TEST_GROUP_STANDALONE_PRESTO_ADMIN_AND_PRESTO };
47
56
elif [ -v OTHER_TESTS ]; then
48
- make clean lint dist docs test-rpm
49
- nosetests --with-timer --timer-ok 60s --timer-warning 300s - s tests.unit
50
- nosetests --with-timer --timer-ok 60s --timer-warning 300s - s tests.integration
57
+ make clean lint dist docs test-rpm &&
58
+ nosetests -s tests.unit &&
59
+ nosetests -s tests.integration;
51
60
else
52
- echo "Unknown test"
53
- exit 1
61
+ echo "Unknown test" &&
62
+ exit 1;
54
63
fi
0 commit comments