From 9574daced32edad5468ef8a375cbb48a09f3345f Mon Sep 17 00:00:00 2001 From: Marc Garcia Date: Thu, 19 Sep 2019 16:28:20 +0100 Subject: [PATCH 01/14] TST: Call tests just once with --dist=loadscope --- ci/azure/posix.yml | 29 ++++++----------------------- ci/print_skipped.py | 19 +++++++++---------- ci/run_tests.sh | 39 ++++++++++++++------------------------- 3 files changed, 29 insertions(+), 58 deletions(-) diff --git a/ci/azure/posix.yml b/ci/azure/posix.yml index 281107559a38c..d92f0aaf68b5d 100644 --- a/ci/azure/posix.yml +++ b/ci/azure/posix.yml @@ -71,33 +71,16 @@ jobs: - task: PublishTestResults@2 inputs: - testResultsFiles: 'test-data-*.xml' + testResultsFiles: 'test-data.xml' testRunTitle: ${{ format('{0}-$(CONDA_PY)', parameters.name) }} displayName: 'Publish test results' - powershell: | - $junitXml = "test-data-single.xml" - $(Get-Content $junitXml | Out-String) -match 'failures="(.*?)"' - if ($matches[1] -eq 0) - { - Write-Host "No test failures in test-data-single" - } - else - { - # note that this will produce $LASTEXITCODE=1 - Write-Error "$($matches[1]) tests failed" - } - - $junitXmlMulti = "test-data-multiple.xml" - $(Get-Content $junitXmlMulti | Out-String) -match 'failures="(.*?)"' - if ($matches[1] -eq 0) - { - Write-Host "No test failures in test-data-multi" - } - else - { - # note that this will produce $LASTEXITCODE=1 - Write-Error "$($matches[1]) tests failed" + $(Get-Content "test-data.xml" | Out-String) -match 'failures="(.*?)"' + if ($matches[1] -eq 0) { + Write-Host "No test failures in test-data" + } else { + Write-Error "$($matches[1]) tests failed" # will produce $LASTEXITCODE=1 } displayName: 'Check for test failures' diff --git a/ci/print_skipped.py b/ci/print_skipped.py index e99e789a71fe8..51a2460e05fab 100755 --- a/ci/print_skipped.py +++ b/ci/print_skipped.py @@ -27,14 +27,13 @@ def main(filename): if __name__ == "__main__": print("SKIPPED TESTS:") i = 1 - for file_type in ("-single", "-multiple", ""): - for test_data in main("test-data{}.xml".format(file_type)): - if test_data is None: - print("-" * 80) - else: - print( - "#{i} {class_name}.{test_name}: {message}".format( - **dict(test_data, i=i) - ) + for test_data in main("test-data.xml"): + if test_data is None: + print("-" * 80) + else: + print( + "#{i} {class_name}.{test_name}: {message}".format( + **dict(test_data, i=i) ) - i += 1 + ) + i += 1 diff --git a/ci/run_tests.sh b/ci/run_tests.sh index 57f1ecf1e56f7..1866d974f7487 100755 --- a/ci/run_tests.sh +++ b/ci/run_tests.sh @@ -15,38 +15,27 @@ if [ -n "$LOCALE_OVERRIDE" ]; then # exit 1 fi fi + if [[ "not network" == *"$PATTERN"* ]]; then export http_proxy=http://1.2.3.4 https_proxy=http://1.2.3.4; fi - if [ -n "$PATTERN" ]; then PATTERN=" and $PATTERN" fi -for TYPE in single multiple -do - if [ "$COVERAGE" ]; then - COVERAGE_FNAME="/tmp/coc-$TYPE.xml" - COVERAGE="-s --cov=pandas --cov-report=xml:$COVERAGE_FNAME" - fi - - TYPE_PATTERN=$TYPE - NUM_JOBS=1 - if [[ "$TYPE_PATTERN" == "multiple" ]]; then - TYPE_PATTERN="not single" - NUM_JOBS=2 - fi +if [ "$COVERAGE" ]; then + COVERAGE_FNAME="/tmp/test_coverage.xml" + COVERAGE="-s --cov=pandas --cov-report=xml:$COVERAGE_FNAME" +fi - PYTEST_CMD="pytest -m \"$TYPE_PATTERN$PATTERN\" -n $NUM_JOBS -s --strict --durations=10 --junitxml=test-data-$TYPE.xml $TEST_ARGS $COVERAGE pandas" - echo $PYTEST_CMD - # 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 - sh -c "$PYTEST_CMD; ret=\$?; [ \$ret = 5 ] && exit 0 || exit \$ret" +PYTEST_CMD="pytest -m \"$PATTERN\" -n auto --dist=loadscope -s --strict --durations=10 --junitxml=test-data.xml $TEST_ARGS $COVERAGE pandas" +echo $PYTEST_CMD +sh -c "$PYTEST_CMD" - # 2019-08-21 disabling because this is hitting HTTP 400 errors GH#27602 - # if [[ "$COVERAGE" && $? == 0 && "$TRAVIS_BRANCH" == "master" ]]; then - # echo "uploading coverage for $TYPE tests" - # echo "bash <(curl -s https://codecov.io/bash) -Z -c -F $TYPE -f $COVERAGE_FNAME" - # bash <(curl -s https://codecov.io/bash) -Z -c -F $TYPE -f $COVERAGE_FNAME - # fi -done +# 2019-08-21 disabling because this is hitting HTTP 400 errors GH#27602 +# if [[ "$COVERAGE" && $? == 0 && "$TRAVIS_BRANCH" == "master" ]]; then +# echo "uploading coverage for $TYPE tests" +# echo "bash <(curl -s https://codecov.io/bash) -Z -c -F $TYPE -f $COVERAGE_FNAME" +# bash <(curl -s https://codecov.io/bash) -Z -c -F $TYPE -f $COVERAGE_FNAME +# fi From f772aa1fa1bbbb7914a1f68d48eff94cb3676b39 Mon Sep 17 00:00:00 2001 From: Marc Garcia Date: Thu, 19 Sep 2019 17:09:11 +0100 Subject: [PATCH 02/14] Remove code that was left by mistake --- ci/run_tests.sh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/ci/run_tests.sh b/ci/run_tests.sh index 1866d974f7487..b00a500455181 100755 --- a/ci/run_tests.sh +++ b/ci/run_tests.sh @@ -20,10 +20,6 @@ if [[ "not network" == *"$PATTERN"* ]]; then export http_proxy=http://1.2.3.4 https_proxy=http://1.2.3.4; fi -if [ -n "$PATTERN" ]; then - PATTERN=" and $PATTERN" -fi - if [ "$COVERAGE" ]; then COVERAGE_FNAME="/tmp/test_coverage.xml" COVERAGE="-s --cov=pandas --cov-report=xml:$COVERAGE_FNAME" From 490e0b709e515667c5999416115e36b34cb37647 Mon Sep 17 00:00:00 2001 From: Marc Garcia Date: Fri, 20 Sep 2019 14:37:01 +0100 Subject: [PATCH 03/14] Replacing loadscope by loadfile --- ci/run_tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/run_tests.sh b/ci/run_tests.sh index b00a500455181..d478400082921 100755 --- a/ci/run_tests.sh +++ b/ci/run_tests.sh @@ -25,7 +25,7 @@ if [ "$COVERAGE" ]; then COVERAGE="-s --cov=pandas --cov-report=xml:$COVERAGE_FNAME" fi -PYTEST_CMD="pytest -m \"$PATTERN\" -n auto --dist=loadscope -s --strict --durations=10 --junitxml=test-data.xml $TEST_ARGS $COVERAGE pandas" +PYTEST_CMD="pytest -m \"$PATTERN\" -n auto --dist=loadfile -s --strict --durations=10 --junitxml=test-data.xml $TEST_ARGS $COVERAGE pandas" echo $PYTEST_CMD sh -c "$PYTEST_CMD" From 432b352183668610cebc7266b65e695358b01b69 Mon Sep 17 00:00:00 2001 From: Marc Garcia Date: Tue, 1 Oct 2019 22:42:11 -0300 Subject: [PATCH 04/14] Empty commit to rerun CI From 5c7575a25d2b896bcfb731da1f2eabb4d3f93799 Mon Sep 17 00:00:00 2001 From: Marc Garcia Date: Thu, 3 Oct 2019 22:21:07 -0300 Subject: [PATCH 05/14] Pinning pytest-xdist --- environment.yml | 2 +- requirements-dev.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/environment.yml b/environment.yml index 7c3ec9064cba3..4835a17fc063d 100644 --- a/environment.yml +++ b/environment.yml @@ -56,7 +56,7 @@ dependencies: - pytest>=4.0.2 - pytest-cov - pytest-mock - - pytest-xdist + - pytest-xdist>=1.21 - seaborn - statsmodels diff --git a/requirements-dev.txt b/requirements-dev.txt index e677d835b56a5..db74c2cea2b52 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -33,7 +33,7 @@ moto pytest>=4.0.2 pytest-cov pytest-mock -pytest-xdist +pytest-xdist>=1.21 seaborn statsmodels ipywidgets From fba470b71a1ef9bfda4b6d39db47cc466a5b3f75 Mon Sep 17 00:00:00 2001 From: Marc Garcia Date: Sat, 19 Oct 2019 21:36:24 -0500 Subject: [PATCH 06/14] Adding xvfb --- ci/run_tests.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ci/run_tests.sh b/ci/run_tests.sh index 424411b7c3c1d..f8a7ab6d43741 100755 --- a/ci/run_tests.sh +++ b/ci/run_tests.sh @@ -26,6 +26,10 @@ if [ "$COVERAGE" ]; then fi PYTEST_CMD="pytest -m \"$PATTERN\" -n auto --dist=loadfile -s --strict --durations=10 --junitxml=test-data.xml $TEST_ARGS $COVERAGE pandas" +if [[ "$AGENT_OS" == "Linux" || "$TRAVIS_OS_NAME" == "linux" ]]; then + DISPLAY=DISPLAY=:99.0 + PYTEST_CMD="xvfb-run $PYTEST_CMD" +fi echo $PYTEST_CMD sh -c "$PYTEST_CMD" From b8487996aaeb13e89386e9a2ed982af8212a3ef0 Mon Sep 17 00:00:00 2001 From: Marc Garcia Date: Thu, 14 Nov 2019 02:29:13 +0000 Subject: [PATCH 07/14] Printing errors for xvfb-run --- ci/run_tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/run_tests.sh b/ci/run_tests.sh index f8a7ab6d43741..fb8f694ece70e 100755 --- a/ci/run_tests.sh +++ b/ci/run_tests.sh @@ -28,7 +28,7 @@ fi PYTEST_CMD="pytest -m \"$PATTERN\" -n auto --dist=loadfile -s --strict --durations=10 --junitxml=test-data.xml $TEST_ARGS $COVERAGE pandas" if [[ "$AGENT_OS" == "Linux" || "$TRAVIS_OS_NAME" == "linux" ]]; then DISPLAY=DISPLAY=:99.0 - PYTEST_CMD="xvfb-run $PYTEST_CMD" + PYTEST_CMD="xvfb-run -e /dev/stdout $PYTEST_CMD" fi echo $PYTEST_CMD sh -c "$PYTEST_CMD" From 88239191c556d193c83a41403e67d3545574e0cb Mon Sep 17 00:00:00 2001 From: Marc Garcia Date: Thu, 14 Nov 2019 03:26:27 +0000 Subject: [PATCH 08/14] Not failing if xvfb is already running --- ci/run_tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/run_tests.sh b/ci/run_tests.sh index fb8f694ece70e..4c026b877c70b 100755 --- a/ci/run_tests.sh +++ b/ci/run_tests.sh @@ -28,7 +28,7 @@ fi PYTEST_CMD="pytest -m \"$PATTERN\" -n auto --dist=loadfile -s --strict --durations=10 --junitxml=test-data.xml $TEST_ARGS $COVERAGE pandas" if [[ "$AGENT_OS" == "Linux" || "$TRAVIS_OS_NAME" == "linux" ]]; then DISPLAY=DISPLAY=:99.0 - PYTEST_CMD="xvfb-run -e /dev/stdout $PYTEST_CMD" + PYTEST_CMD="xvfb-run -a $PYTEST_CMD" fi echo $PYTEST_CMD sh -c "$PYTEST_CMD" From 699d7d9eacb7a703f1ebc6b8358a76125984196e Mon Sep 17 00:00:00 2001 From: Marc Garcia Date: Thu, 14 Nov 2019 17:26:32 +0000 Subject: [PATCH 09/14] Removing xvfb --- ci/run_tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/run_tests.sh b/ci/run_tests.sh index 4c026b877c70b..95355a3a0e72c 100755 --- a/ci/run_tests.sh +++ b/ci/run_tests.sh @@ -28,7 +28,7 @@ fi PYTEST_CMD="pytest -m \"$PATTERN\" -n auto --dist=loadfile -s --strict --durations=10 --junitxml=test-data.xml $TEST_ARGS $COVERAGE pandas" if [[ "$AGENT_OS" == "Linux" || "$TRAVIS_OS_NAME" == "linux" ]]; then DISPLAY=DISPLAY=:99.0 - PYTEST_CMD="xvfb-run -a $PYTEST_CMD" + PYTEST_CMD="$PYTEST_CMD" fi echo $PYTEST_CMD sh -c "$PYTEST_CMD" From a8f15c302d3836188c123bd058e2d7961f8c2cc0 Mon Sep 17 00:00:00 2001 From: Marc Garcia Date: Thu, 14 Nov 2019 18:28:29 +0000 Subject: [PATCH 10/14] Running xvfb only in travis --- ci/run_tests.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ci/run_tests.sh b/ci/run_tests.sh index 95355a3a0e72c..2641e9db6de9f 100755 --- a/ci/run_tests.sh +++ b/ci/run_tests.sh @@ -26,10 +26,13 @@ if [ "$COVERAGE" ]; then fi PYTEST_CMD="pytest -m \"$PATTERN\" -n auto --dist=loadfile -s --strict --durations=10 --junitxml=test-data.xml $TEST_ARGS $COVERAGE pandas" -if [[ "$AGENT_OS" == "Linux" || "$TRAVIS_OS_NAME" == "linux" ]]; then + +# Travis does not have xvfb active +if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then DISPLAY=DISPLAY=:99.0 - PYTEST_CMD="$PYTEST_CMD" + PYTEST_CMD="xvfb-run $PYTEST_CMD" fi + echo $PYTEST_CMD sh -c "$PYTEST_CMD" From 0c54fa0f75d94151d29adb8c23b423531d7e73bd Mon Sep 17 00:00:00 2001 From: Marc Garcia Date: Thu, 14 Nov 2019 20:19:18 +0000 Subject: [PATCH 11/14] Adding error information for xvfb --- ci/run_tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/run_tests.sh b/ci/run_tests.sh index 2641e9db6de9f..741ed48cf6918 100755 --- a/ci/run_tests.sh +++ b/ci/run_tests.sh @@ -30,7 +30,7 @@ PYTEST_CMD="pytest -m \"$PATTERN\" -n auto --dist=loadfile -s --strict --duratio # Travis does not have xvfb active if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then DISPLAY=DISPLAY=:99.0 - PYTEST_CMD="xvfb-run $PYTEST_CMD" + PYTEST_CMD="xvfb-run -e /dev/stdout $PYTEST_CMD" fi echo $PYTEST_CMD From 73934b6a773531fcceab2c1f62a12ace3ea0e07f Mon Sep 17 00:00:00 2001 From: Marc Garcia Date: Thu, 14 Nov 2019 20:36:06 +0000 Subject: [PATCH 12/14] Only run xvfb when DISPLAY is not defined --- ci/run_tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/run_tests.sh b/ci/run_tests.sh index 741ed48cf6918..6aaa3a71bb87f 100755 --- a/ci/run_tests.sh +++ b/ci/run_tests.sh @@ -28,7 +28,7 @@ fi PYTEST_CMD="pytest -m \"$PATTERN\" -n auto --dist=loadfile -s --strict --durations=10 --junitxml=test-data.xml $TEST_ARGS $COVERAGE pandas" # Travis does not have xvfb active -if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then +if [[ "$TRAVIS_OS_NAME" == "linux" && -z "$DISPLAY" ]]; then DISPLAY=DISPLAY=:99.0 PYTEST_CMD="xvfb-run -e /dev/stdout $PYTEST_CMD" fi From a27609dab646ef5c23e93b510faff4c382c1df67 Mon Sep 17 00:00:00 2001 From: Marc Garcia Date: Thu, 14 Nov 2019 21:03:25 +0000 Subject: [PATCH 13/14] Clarifying comment --- ci/run_tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/run_tests.sh b/ci/run_tests.sh index 6aaa3a71bb87f..6b076eda277e5 100755 --- a/ci/run_tests.sh +++ b/ci/run_tests.sh @@ -27,7 +27,7 @@ fi PYTEST_CMD="pytest -m \"$PATTERN\" -n auto --dist=loadfile -s --strict --durations=10 --junitxml=test-data.xml $TEST_ARGS $COVERAGE pandas" -# Travis does not have xvfb active +# Travis may not have xvfb active if [[ "$TRAVIS_OS_NAME" == "linux" && -z "$DISPLAY" ]]; then DISPLAY=DISPLAY=:99.0 PYTEST_CMD="xvfb-run -e /dev/stdout $PYTEST_CMD" From 2e79f38c42540a389a8e917805ee3c9149944c25 Mon Sep 17 00:00:00 2001 From: Marc Garcia Date: Sat, 16 Nov 2019 02:55:34 +0000 Subject: [PATCH 14/14] Removing xvfb in Travis config --- .travis.yml | 9 --------- ci/run_tests.sh | 4 ++-- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index 398dd07089ef9..048736e4bf1d0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -85,15 +85,6 @@ install: - ci/submit_cython_cache.sh - echo "install done" - -before_script: - # display server (for clipboard functionality) needs to be started here, - # does not work if done in install:setup_env.sh (GH-26103) - - export DISPLAY=":99.0" - - echo "sh -e /etc/init.d/xvfb start" - - if [ "$JOB" != "3.8-dev" ]; then sh -e /etc/init.d/xvfb start; fi - - sleep 3 - script: - echo "script start" - echo "$JOB" diff --git a/ci/run_tests.sh b/ci/run_tests.sh index 6b076eda277e5..b91cfb3bed8cc 100755 --- a/ci/run_tests.sh +++ b/ci/run_tests.sh @@ -27,8 +27,8 @@ fi PYTEST_CMD="pytest -m \"$PATTERN\" -n auto --dist=loadfile -s --strict --durations=10 --junitxml=test-data.xml $TEST_ARGS $COVERAGE pandas" -# Travis may not have xvfb active -if [[ "$TRAVIS_OS_NAME" == "linux" && -z "$DISPLAY" ]]; then +# Travis does not have have an X server +if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then DISPLAY=DISPLAY=:99.0 PYTEST_CMD="xvfb-run -e /dev/stdout $PYTEST_CMD" fi