@@ -15,37 +15,29 @@ if [ -n "$LOCALE_OVERRIDE" ]; then
1515 # exit 1
1616 fi
1717fi
18+
1819if [[ " not network" == * " $PATTERN " * ]]; then
1920 export http_proxy=http://1.2.3.4 https_proxy=http://1.2.3.4;
2021fi
2122
22-
23- if [ -n " $PATTERN " ] ; then
24- PATTERN= " and $PATTERN "
23+ if [ " $COVERAGE " ] ; then
24+ COVERAGE_FNAME= " /tmp/test_coverage.xml "
25+ COVERAGE= " -s --cov=pandas --cov-report=xml: $COVERAGE_FNAME "
2526fi
2627
27- for TYPE in single multiple
28- do
29- if [ " $COVERAGE " ]; then
30- COVERAGE_FNAME=" /tmp/coc-$TYPE .xml"
31- COVERAGE=" -s --cov=pandas --cov-report=xml:$COVERAGE_FNAME "
32- fi
28+ PYTEST_CMD=" pytest -m \" $PATTERN \" -n auto --dist=loadfile -s --strict --durations=10 --junitxml=test-data.xml $TEST_ARGS $COVERAGE pandas"
3329
34- TYPE_PATTERN=$TYPE
35- NUM_JOBS=1
36- if [[ " $TYPE_PATTERN " == " multiple" ]]; then
37- TYPE_PATTERN=" not single"
38- NUM_JOBS=2
39- fi
30+ # Travis does not have have an X server
31+ if [[ " $TRAVIS_OS_NAME " == " linux" ]]; then
32+ DISPLAY=DISPLAY=:99.0
33+ PYTEST_CMD=" xvfb-run -e /dev/stdout $PYTEST_CMD "
34+ fi
4035
41- PYTEST_CMD=" pytest -m \" $TYPE_PATTERN$PATTERN \" -n $NUM_JOBS -s --strict --durations=10 --junitxml=test-data-$TYPE .xml $TEST_ARGS $COVERAGE pandas"
42- echo $PYTEST_CMD
43- # if no tests are found (the case of "single and slow"), pytest exits with code 5, and would make the script fail, if not for the below code
44- sh -c " $PYTEST_CMD ; ret=\$ ?; [ \$ ret = 5 ] && exit 0 || exit \$ ret"
36+ echo $PYTEST_CMD
37+ sh -c " $PYTEST_CMD "
4538
46- if [[ " $COVERAGE " && $? == 0 && " $TRAVIS_BRANCH " == " master" ]]; then
47- echo " uploading coverage for $TYPE tests"
48- echo " bash <(curl -s https://codecov.io/bash) -Z -c -F $TYPE -f $COVERAGE_FNAME "
49- bash <( curl -s https://codecov.io/bash) -Z -c -F $TYPE -f $COVERAGE_FNAME
50- fi
51- done
39+ if [[ " $COVERAGE " && $? == 0 && " $TRAVIS_BRANCH " == " master" ]]; then
40+ echo " uploading coverage"
41+ echo " bash <(curl -s https://codecov.io/bash) -Z -c -F $TYPE -f $COVERAGE_FNAME "
42+ bash <( curl -s https://codecov.io/bash) -Z -c -F $TYPE -f $COVERAGE_FNAME
43+ fi
0 commit comments