Skip to content

TST: Call tests just once with --dist=loadscope #28531

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 26 commits into from
Nov 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
9574dac
TST: Call tests just once with --dist=loadscope
Sep 19, 2019
f772aa1
Remove code that was left by mistake
Sep 19, 2019
c527e55
Merge remote-tracking branch 'upstream/master' into remove_tests_mult…
Sep 20, 2019
490e0b7
Replacing loadscope by loadfile
Sep 20, 2019
f93999a
Merge remote-tracking branch 'upstream/master' into remove_tests_mult…
datapythonista Oct 1, 2019
a7fdb62
Merge remote-tracking branch 'upstream/master' into remove_tests_mult…
datapythonista Oct 1, 2019
432b352
Empty commit to rerun CI
datapythonista Oct 2, 2019
ff5148e
Merging from master
datapythonista Oct 4, 2019
5c7575a
Pinning pytest-xdist
datapythonista Oct 4, 2019
1055fc7
Merge remote-tracking branch 'upstream/master' into remove_tests_mult…
datapythonista Oct 12, 2019
5d49eba
Merge remote-tracking branch 'upstream/master' into remove_tests_mult…
datapythonista Oct 20, 2019
fba470b
Adding xvfb
datapythonista Oct 20, 2019
09618aa
Merging from master
datapythonista Nov 14, 2019
b848799
Printing errors for xvfb-run
datapythonista Nov 14, 2019
8823919
Not failing if xvfb is already running
datapythonista Nov 14, 2019
699d7d9
Removing xvfb
datapythonista Nov 14, 2019
a8f15c3
Running xvfb only in travis
datapythonista Nov 14, 2019
0c54fa0
Adding error information for xvfb
datapythonista Nov 14, 2019
73934b6
Only run xvfb when DISPLAY is not defined
datapythonista Nov 14, 2019
9972e4d
Merge remote-tracking branch 'upstream/master' into remove_tests_mult…
datapythonista Nov 14, 2019
a27609d
Clarifying comment
datapythonista Nov 14, 2019
2e79f38
Removing xvfb in Travis config
datapythonista Nov 16, 2019
bff544b
Merge remote-tracking branch 'upstream/master' into remove_tests_mult…
datapythonista Nov 16, 2019
a4b1397
Merge remote-tracking branch 'upstream/master' into remove_tests_mult…
datapythonista Nov 16, 2019
5750713
Merge remote-tracking branch 'upstream/master' into remove_tests_mult…
datapythonista Nov 16, 2019
bd100ac
Merge remote-tracking branch 'upstream/master' into remove_tests_mult…
datapythonista Nov 17, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
29 changes: 6 additions & 23 deletions ci/azure/posix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,33 +73,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'

Expand Down
19 changes: 9 additions & 10 deletions ci/print_skipped.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
42 changes: 17 additions & 25 deletions ci/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,37 +15,29 @@ 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"
if [ "$COVERAGE" ]; then
COVERAGE_FNAME="/tmp/test_coverage.xml"
COVERAGE="-s --cov=pandas --cov-report=xml:$COVERAGE_FNAME"
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
PYTEST_CMD="pytest -m \"$PATTERN\" -n auto --dist=loadfile -s --strict --durations=10 --junitxml=test-data.xml $TEST_ARGS $COVERAGE pandas"

TYPE_PATTERN=$TYPE
NUM_JOBS=1
if [[ "$TYPE_PATTERN" == "multiple" ]]; then
TYPE_PATTERN="not single"
NUM_JOBS=2
fi
# 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

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"
echo $PYTEST_CMD
sh -c "$PYTEST_CMD"

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
if [[ "$COVERAGE" && $? == 0 && "$TRAVIS_BRANCH" == "master" ]]; then
echo "uploading coverage"
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
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ dependencies:
- moto # mock S3
- pytest>=4.0.2
- pytest-cov
- pytest-xdist
- pytest-xdist>=1.21
- seaborn
- statsmodels

Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ hypothesis>=3.82
moto
pytest>=4.0.2
pytest-cov
pytest-xdist
pytest-xdist>=1.21
seaborn
statsmodels
ipywidgets
Expand Down