-
-
Notifications
You must be signed in to change notification settings - Fork 18.3k
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
TST/CI: Unify CI test scripts (single and multi) and simplify the system #23924
Changes from 4 commits
252729c
be9fb9b
12bb059
9fac328
93c41db
18446b2
a17a9ce
8c9b557
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/bin/bash | ||
|
||
# Workaround for pytest-xdist flaky collection order | ||
# https://github.com/pytest-dev/pytest/issues/920 | ||
# https://github.com/pytest-dev/pytest/issues/1075 | ||
export PYTHONHASHSEED=$(python -c 'import random; print(random.randint(1, 4294967295))') | ||
|
||
if [ -n "$LOCALE_OVERRIDE" ]; then | ||
export LC_ALL="$LOCALE_OVERRIDE" | ||
export LANG="$LOCALE_OVERRIDE" | ||
PANDAS_LOCALE=`python -c 'import pandas; pandas.get_option("display.encoding")'` | ||
if [[ "$LOCALE_OVERIDE" != "$PANDAS_LOCALE" ]]; then | ||
echo "pandas could not detect the locale. System locale: $LOCALE_OVERRIDE, pandas detected: $PANDAS_LOCALE" | ||
# TODO Not really aborting the tests until https://github.com/pandas-dev/pandas/issues/23923 is fixed | ||
# 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 | ||
|
||
pytest -m "$TYPE_PATTERN$PATTERN" -n $NUM_JOBS -s --strict --durations=10 --junitxml=test-data-$TYPE.xml $TEST_ARGS $COVERAGE pandas | ||
|
||
if [[ "$COVERAGE" && $? == 0 ]]; then | ||
bash <(curl -s https://codecov.io/bash) -Z -c -F $TYPE -f $COVERAGE_FNAME | ||
fi | ||
done |
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,28 +28,13 @@ | |
|
||
|
||
def pytest_addoption(parser): | ||
parser.addoption("--skip-slow", action="store_true", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i wouldn't remove these, these are useful from the command line There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Any reason why to use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes this is a pretty common idiom. I don't see value in removing them. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @datapythonista can you restore these |
||
help="skip slow tests") | ||
parser.addoption("--skip-network", action="store_true", | ||
help="skip network tests") | ||
parser.addoption("--run-high-memory", action="store_true", | ||
help="run high memory tests") | ||
parser.addoption("--only-slow", action="store_true", | ||
help="run only slow tests") | ||
parser.addoption("--strict-data-files", action="store_true", | ||
help="Fail if a test is skipped for missing data file.") | ||
|
||
|
||
def pytest_runtest_setup(item): | ||
if 'slow' in item.keywords and item.config.getoption("--skip-slow"): | ||
pytest.skip("skipping due to --skip-slow") | ||
|
||
if 'slow' not in item.keywords and item.config.getoption("--only-slow"): | ||
pytest.skip("skipping due to --only-slow") | ||
|
||
if 'network' in item.keywords and item.config.getoption("--skip-network"): | ||
pytest.skip("skipping due to --skip-network") | ||
|
||
if 'high_memory' in item.keywords and not item.config.getoption( | ||
"--run-high-memory"): | ||
pytest.skip( | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you have TEST_ARGS here, though you removed it elsewhere
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to get rid of it, but it's needed in the numpydev build for the
-W error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any other way to do that. this makes it pretty clunky.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to take a look at pytest concurrency in a different PR.
I think it should be a simpler way to avoid running the
simple
tests in parallel, without having to call pytest twice. I think that would be cleaner, and we can simplify all this even more.Also, I want to see how many processes we have, and not call always for 2 (which I assume it's the number of cores in Travis), but instead use all the available (I think that should be as easy as
-n auto
, but I want to take a look at how many cores are detected in azure, and how many makes sense to use).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the single tests must remain though
we got failures because these are using single system resources