Skip to content

Commit 8041303

Browse files
committed
Split product tests into short and long running groups
1 parent a1cc532 commit 8041303

File tree

1 file changed

+30
-36
lines changed

1 file changed

+30
-36
lines changed

.travis.yml

+30-36
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,18 @@ 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
14-
- PRODUCT_TEST_GROUP_SA_BARE="tests/product/test_installer.py tests/product/standalone/test_installation.py"
15-
- PRODUCT_TEST_GROUP_SA_PRESTO="tests/product/test_authentication.py tests/product/test_configuration.py tests/product/test_server_upgrade.py"
16-
- PRODUCT_TEST_GROUP_SA_PA="tests/product/test_error_handling.py tests/product/test_package_install.py tests/product/test_plugin.py tests/product/test_script.py tests/product/test_topology.py"
17-
- PRODUCT_TEST_GROUP_SA_PA="tests/product/test_server_install.py"
18-
- PRODUCT_TEST_GROUP_SA_PA_PRESTO="tests/product/test_status.py"
19-
- PRODUCT_TEST_GROUP_SA_PA_PRESTO="tests/product/test_collect.py"
20-
- PRODUCT_TEST_GROUP_SA_PA_PRESTO="tests/product/test_connectors.py"
21-
- PRODUCT_TEST_GROUP_SA_PA_PRESTO="tests/product/test_control.py"
22-
- PRODUCT_TEST_GROUP_SA_PA_PRESTO="tests/product/test_server_uninstall.py"
23-
- PRODUCT_TEST_GROUP_YS_PA="tests/product/yarn_slider/test_slider_installation.py"
24-
#-QUARANTINED="tests/product/yarn_slider/test_server_install.py"
15+
- SHORT_PRODUCT_TEST_GROUP=0
16+
- SHORT_PRODUCT_TEST_GROUP=1
17+
- SHORT_PRODUCT_TEST_GROUP=2
18+
- LONG_PRODUCT_TEST_GROUP_SA_PA="tests/product/test_server_install.py"
19+
- LONG_PRODUCT_TEST_GROUP_SA_PA_PRESTO="tests/product/test_status.py"
20+
- LONG_PRODUCT_TEST_GROUP_SA_PA_PRESTO="tests/product/test_collect.py"
21+
- LONG_PRODUCT_TEST_GROUP_SA_PA_PRESTO="tests/product/test_connectors.py"
22+
- LONG_PRODUCT_TEST_GROUP_SA_PA_PRESTO="tests/product/test_control.py"
23+
- LONG_PRODUCT_TEST_GROUP_SA_PA_PRESTO="tests/product/test_server_uninstall.py"
2524
install:
2625
- pip install --upgrade pip==6.1.1
2726
- pip install -r requirements.txt
@@ -30,31 +29,26 @@ before_script:
3029
- make presto-server-rpm.rpm
3130
script:
3231
- |
33-
if [ -v PRODUCT_TEST_GROUP_SA_BARE ]; then
34-
export IMAGE_NAMES="standalone_bare"
35-
make test-images
36-
tox -e py26 -- -a '!quarantine,!offline_installer' ${PRODUCT_TEST_GROUP_SA_BARE}
37-
elif [ -v PRODUCT_TEST_GROUP_SA_PRESTO ]; then
38-
export IMAGE_NAMES="standalone_presto"
39-
make test-images
40-
tox -e py26 -- -a '!quarantine,!offline_installer' ${PRODUCT_TEST_GROUP_SA_PRESTO}
41-
elif [ -v PRODUCT_TEST_GROUP_SA_PA ]; then
42-
export IMAGE_NAMES="standalone_pa"
43-
make test-images
44-
tox -e py26 -- -a '!quarantine,!offline_installer' ${PRODUCT_TEST_GROUP_SA_PA}
45-
elif [ -v PRODUCT_TEST_GROUP_SA_PA_PRESTO ]; then
46-
export IMAGE_NAMES="standalone_presto standalone_pa"
47-
make test-images
48-
tox -e py26 -- -a '!quarantine,!offline_installer' ${PRODUCT_TEST_GROUP_SA_PA_PRESTO}
49-
elif [ -v PRODUCT_TEST_GROUP_YS_PA ]; then
50-
export IMAGE_NAMES="yarn_slider_pa"
51-
make test-images
52-
tox -e py26 -- -a '!quarantine,!offline_installer' ${PRODUCT_TEST_GROUP_YS_PA}
32+
if [ -v SHORT_PRODUCT_TEST_GROUP ]; then
33+
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' ' ';
34+
for LONG_PRODUCT_TEST in ${LONG_PRODUCT_TESTS[@]}; do
35+
ALL_PRODUCT_TESTS=${ALL_PRODUCT_TESTS//$LONG_PRODUCT_TEST/};
36+
done
37+
SHORT_PRODUCT_TESTS=$(echo $ALL_PRODUCT_TESTS | tr ' ' '\n' | awk "NR % 3 == $SHORT_PRODUCT_TEST_GROUP" | tr '\n' ' ');
38+
tox -e py26 -- -a '!quarantine,!offline_installer' ${SHORT_PRODUCT_TESTS};
39+
elif [ -v LONG_PRODUCT_TEST_GROUP_SA_PA ]; then
40+
export IMAGE_NAMES="standalone_pa";
41+
make test-images &&
42+
tox -e py26 -- -a '!quarantine,!offline_installer' ${PRODUCT_TEST_GROUP_SA_PA};
43+
elif [ -v LONG_PRODUCT_TEST_GROUP_SA_PA_PRESTO ]; then
44+
export IMAGE_NAMES="standalone_presto standalone_pa";
45+
make test-images &&
46+
tox -e py26 -- -a '!quarantine,!offline_installer' ${PRODUCT_TEST_GROUP_SA_PA_PRESTO};
5347
elif [ -v OTHER_TESTS ]; then
54-
make clean lint dist docs test-rpm
55-
nosetests --with-timer --timer-ok 60s --timer-warning 300s -s tests.unit
56-
nosetests --with-timer --timer-ok 60s --timer-warning 300s -s tests.integration
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;
5751
else
58-
echo "Unknown test"
59-
exit 1
52+
echo "Unknown test" &&
53+
exit 1;
6054
fi

0 commit comments

Comments
 (0)