From ee7d86cb58b8818c351f1c2458c8af696c468331 Mon Sep 17 00:00:00 2001 From: Tom Augspurger Date: Wed, 31 Oct 2018 13:24:10 -0700 Subject: [PATCH] CI: Move durations to pytest call Having it in the setup.cfg meant it was used with doctests, which pushed errors further from the exit code. --- ci/azure/windows-py27.yml | 2 +- ci/azure/windows.yml | 2 +- ci/circle/run_circle.sh | 4 ++-- ci/script_multi.sh | 12 ++++++------ ci/script_single.sh | 8 ++++---- setup.cfg | 2 +- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/ci/azure/windows-py27.yml b/ci/azure/windows-py27.yml index 8718cc849b7a8..991e7adc4e9d6 100644 --- a/ci/azure/windows-py27.yml +++ b/ci/azure/windows-py27.yml @@ -37,7 +37,7 @@ jobs: displayName: 'Build' - script: | call activate %CONDA_ENV% - pytest --junitxml=test-data.xml --skip-slow --skip-network pandas -n 2 -r sxX --strict %* + pytest --junitxml=test-data.xml --skip-slow --skip-network pandas -n 2 -r sxX --strict --durations=10 %* displayName: 'Test' - task: PublishTestResults@2 inputs: diff --git a/ci/azure/windows.yml b/ci/azure/windows.yml index fe6c9c933d474..e2e545978e09d 100644 --- a/ci/azure/windows.yml +++ b/ci/azure/windows.yml @@ -28,7 +28,7 @@ jobs: displayName: 'Build' - script: | call activate %CONDA_ENV% - pytest --junitxml=test-data.xml --skip-slow --skip-network pandas -n 2 -r sxX --strict %* + pytest --junitxml=test-data.xml --skip-slow --skip-network pandas -n 2 -r sxX --strict --durations=10 %* displayName: 'Test' - task: PublishTestResults@2 inputs: diff --git a/ci/circle/run_circle.sh b/ci/circle/run_circle.sh index fc2a8b849a354..803724c2f492d 100755 --- a/ci/circle/run_circle.sh +++ b/ci/circle/run_circle.sh @@ -5,5 +5,5 @@ export PATH="$MINICONDA_DIR/bin:$PATH" source activate pandas -echo "pytest --strict --junitxml=$CIRCLE_TEST_REPORTS/reports/junit.xml $@ pandas" -pytest --strict --color=no --junitxml=$CIRCLE_TEST_REPORTS/reports/junit.xml $@ pandas +echo "pytest --strict --durations=10 --color=no --junitxml=$CIRCLE_TEST_REPORTS/reports/junit.xml $@ pandas" +pytest --strict --durations=10 --color=no --junitxml=$CIRCLE_TEST_REPORTS/reports/junit.xml $@ pandas diff --git a/ci/script_multi.sh b/ci/script_multi.sh index e076558e8fff3..e56d5da7232b2 100755 --- a/ci/script_multi.sh +++ b/ci/script_multi.sh @@ -27,17 +27,17 @@ if [ "$DOC" ]; then echo "We are not running pytest as this is a doc-build" elif [ "$COVERAGE" ]; then - echo pytest -s -n 2 -m "not single" --cov=pandas --cov-report xml:/tmp/cov-multiple.xml --junitxml=test-data-multiple.xml --strict $TEST_ARGS pandas - pytest -s -n 2 -m "not single" --cov=pandas --cov-report xml:/tmp/cov-multiple.xml --junitxml=test-data-multiple.xml --strict $TEST_ARGS pandas + echo pytest -s -n 2 -m "not single" --durations=10 --cov=pandas --cov-report xml:/tmp/cov-multiple.xml --junitxml=test-data-multiple.xml --strict $TEST_ARGS pandas + pytest -s -n 2 -m "not single" --durations=10 --cov=pandas --cov-report xml:/tmp/cov-multiple.xml --junitxml=test-data-multiple.xml --strict $TEST_ARGS pandas elif [ "$SLOW" ]; then TEST_ARGS="--only-slow --skip-network" - echo pytest -m "not single and slow" -v --junitxml=test-data-multiple.xml --strict $TEST_ARGS pandas - pytest -m "not single and slow" -v --junitxml=test-data-multiple.xml --strict $TEST_ARGS pandas + echo pytest -m "not single and slow" -v --durations=10 --junitxml=test-data-multiple.xml --strict $TEST_ARGS pandas + pytest -m "not single and slow" -v --durations=10 --junitxml=test-data-multiple.xml --strict $TEST_ARGS pandas else - echo pytest -n 2 -m "not single" --junitxml=test-data-multiple.xml --strict $TEST_ARGS pandas - pytest -n 2 -m "not single" --junitxml=test-data-multiple.xml --strict $TEST_ARGS pandas # TODO: doctest + echo pytest -n 2 -m "not single" --durations=10 --junitxml=test-data-multiple.xml --strict $TEST_ARGS pandas + pytest -n 2 -m "not single" --durations=10 --junitxml=test-data-multiple.xml --strict $TEST_ARGS pandas # TODO: doctest fi diff --git a/ci/script_single.sh b/ci/script_single.sh index 42d326e0965ee..ea0d48bc2da8a 100755 --- a/ci/script_single.sh +++ b/ci/script_single.sh @@ -26,13 +26,13 @@ if [ "$DOC" ]; then echo "We are not running pytest as this is a doc-build" elif [ "$COVERAGE" ]; then - echo pytest -s -m "single" --strict --cov=pandas --cov-report xml:/tmp/cov-single.xml --junitxml=test-data-single.xml $TEST_ARGS pandas - pytest -s -m "single" --strict --cov=pandas --cov-report xml:/tmp/cov-single.xml --junitxml=test-data-single.xml $TEST_ARGS pandas + echo pytest -s -m "single" --durations=10 --strict --cov=pandas --cov-report xml:/tmp/cov-single.xml --junitxml=test-data-single.xml $TEST_ARGS pandas + pytest -s -m "single" --durations=10 --strict --cov=pandas --cov-report xml:/tmp/cov-single.xml --junitxml=test-data-single.xml $TEST_ARGS pandas echo pytest -s --strict scripts pytest -s --strict scripts else - echo pytest -m "single" --junitxml=test-data-single.xml --strict $TEST_ARGS pandas - pytest -m "single" --junitxml=test-data-single.xml --strict $TEST_ARGS pandas + echo pytest -m "single" --durations=10 --junitxml=test-data-single.xml --strict $TEST_ARGS pandas + pytest -m "single" --durations=10 --junitxml=test-data-single.xml --strict $TEST_ARGS pandas fi diff --git a/setup.cfg b/setup.cfg index 26269c3318953..0b50006caea87 100644 --- a/setup.cfg +++ b/setup.cfg @@ -45,7 +45,7 @@ markers = high_memory: mark a test as a high-memory only clipboard: mark a pd.read_clipboard test doctest_optionflags = NORMALIZE_WHITESPACE IGNORE_EXCEPTION_DETAIL -addopts = --strict-data-files --durations=10 +addopts = --strict-data-files [coverage:run] branch = False