Skip to content

Commit 71c5619

Browse files
committed
Split product tests into short and long running groups
1 parent bc3a9f6 commit 71c5619

File tree

1 file changed

+20
-11
lines changed

1 file changed

+20
-11
lines changed

.travis.yml

+20-11
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ env:
99
global:
1010
- PA_TEST_ONLINE_INSTALLER=true
1111
- 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"
1213
matrix:
1314
- OTHER_TESTS=true
1415
- SHORT_PRODUCT_TEST_GROUP=0
1516
- SHORT_PRODUCT_TEST_GROUP=1
16-
- SHORT_PRODUCT_TEST_GROUP=2
1717
- LONG_PRODUCT_TEST_GROUP_STANDALONE_PRESTO_ADMIN="tests/product/test_server_install.py"
1818
- LONG_PRODUCT_TEST_GROUP_STANDALONE_PRESTO_ADMIN_AND_PRESTO="tests/product/test_status.py"
1919
- LONG_PRODUCT_TEST_GROUP_STANDALONE_PRESTO_ADMIN_AND_PRESTO="tests/product/test_collect.py"
@@ -26,29 +26,38 @@ install:
2626
before_script:
2727
- make docker-images
2828
- 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
2938
script:
3039
- |
3140
if [ -v SHORT_PRODUCT_TEST_GROUP ]; then
3241
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' ' ');
3342
for LONG_PRODUCT_TEST in ${LONG_PRODUCT_TESTS[@]}; do
3443
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 &&
3847
tox -e $TOX_PYTHON_VERSION -- -a '!quarantine,!offline_installer' ${SHORT_PRODUCT_TESTS};
3948
elif [ -v LONG_PRODUCT_TEST_GROUP_STANDALONE_PRESTO_ADMIN ]; then
4049
export IMAGE_NAMES="standalone_presto_admin";
4150
make test-images &&
4251
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
4453
export IMAGE_NAMES="standalone_presto standalone_presto_admin";
4554
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};
4756
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;
5160
else
52-
echo "Unknown test"
53-
exit 1
61+
echo "Unknown test" &&
62+
exit 1;
5463
fi

0 commit comments

Comments
 (0)