-
-
Notifications
You must be signed in to change notification settings - Fork 366
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
Parallelize the test suite and fix a test polluted bug #1338
Changes from 4 commits
731d5f8
39ef510
f9357e2
38abbb2
f2cd9a0
b6877cf
3c48b59
79b5883
9b801d9
a706938
65f146b
d4bd33f
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 |
---|---|---|
@@ -1,9 +1,14 @@ | ||
from __future__ import annotations | ||
from contextlib import suppress | ||
from datashader.data_libraries.pandas import default | ||
from datashader.core import bypixel | ||
import cudf | ||
|
||
|
||
@bypixel.pipeline.register(cudf.DataFrame) | ||
def cudf_pipeline(df, schema, canvas, glyph, summary, *, antialias=False): | ||
return default(glyph, df, schema, canvas, summary, antialias=antialias, cuda=True) | ||
|
||
|
||
with suppress(ImportError): | ||
import cudf | ||
|
||
cudf_pipeline = bypixel.pipeline.register(cudf.DataFrame)(cudf_pipeline) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,14 @@ | ||
from __future__ import annotations | ||
from contextlib import suppress | ||
from datashader.data_libraries.dask import dask_pipeline | ||
from datashader.core import bypixel | ||
import dask_cudf | ||
|
||
|
||
@bypixel.pipeline.register(dask_cudf.DataFrame) | ||
def dask_cudf_pipeline(df, schema, canvas, glyph, summary, *, antialias=False): | ||
return dask_pipeline(df, schema, canvas, glyph, summary, antialias=antialias, cuda=True) | ||
|
||
|
||
with suppress(ImportError): | ||
import dask_cudf | ||
|
||
dask_cudf_pipeline = bypixel.pipeline.register(dask_cudf.DataFrame)(dask_cudf_pipeline) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import pytest | ||
|
||
pytestmark = pytest.mark.benchmark |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
CUSTOM_MARKS = ("benchmark",) | ||
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. Copied from HoloViews. Basically, it makes it so At some point, I would also like to add a GPU marker, so it is possible to run only the GPU tests and not all the tests with GPU tests enabled. |
||
|
||
|
||
def pytest_addoption(parser): | ||
for marker in CUSTOM_MARKS: | ||
parser.addoption( | ||
f"--{marker}", | ||
action="store_true", | ||
default=False, | ||
help=f"Run {marker} related tests", | ||
) | ||
|
||
|
||
def pytest_configure(config): | ||
for marker in CUSTOM_MARKS: | ||
config.addinivalue_line("markers", f"{marker}: {marker} test marker") | ||
|
||
|
||
def pytest_collection_modifyitems(config, items): | ||
skipped, selected = [], [] | ||
markers = [m for m in CUSTOM_MARKS if config.getoption(f"--{m}")] | ||
empty = not markers | ||
for item in items: | ||
if empty and any(m in item.keywords for m in CUSTOM_MARKS): | ||
skipped.append(item) | ||
elif empty: | ||
selected.append(item) | ||
elif not empty and any(m in item.keywords for m in markers): | ||
selected.append(item) | ||
else: | ||
skipped.append(item) | ||
|
||
config.hook.pytest_deselected(items=skipped) | ||
items[:] = selected |
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.
pytest-xdist
can't handle sets as the order are not consistent, see here.