Skip to content

Commit

Permalink
Remove extra testing for dask-on-ray. (#432)
Browse files Browse the repository at this point in the history
  • Loading branch information
delucchi-cmu authored Nov 13, 2024
1 parent 96a3813 commit 9aa49c4
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 62 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/smoke-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ jobs:
- name: Run unit tests with pytest
run: |
python -m pytest tests
- name: Run dask-on-ray tests with pytest
run: |
python -m pytest tests --use_ray
- name: Send status to Slack app
if: ${{ failure() && github.event_name != 'workflow_dispatch' }}
id: slack
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/testing-and-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ jobs:
- name: Run unit tests with pytest
run: |
python -m pytest tests --cov=hats_import --cov-report=xml
- name: Run dask-on-ray tests with pytest
run: |
python -m pytest tests --use_ray
- name: Upload coverage report to codecov
uses: codecov/codecov-action@v4
with:
Expand Down
2 changes: 0 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ dependencies = [
# On a mac, install optional dependencies with `pip install '.[dev]'` (include the single quotes)
[project.optional-dependencies]
dev = [
"dask[complete]<2024.11.0",
"asv==0.6.4", # Used to compute performance benchmarks
"black", # Used for static linting of files
"jupyter", # Clears output from Jupyter notebooks
Expand All @@ -38,7 +37,6 @@ dev = [
"pytest",
"pytest-cov",
"pytest-timeout",
"ray", # Used for dask-on-ray testing.
]
full = [
"fsspec[full]", # complete file system specs.
Expand Down
48 changes: 0 additions & 48 deletions tests/conftest.py

This file was deleted.

17 changes: 11 additions & 6 deletions tests/hats_import/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,21 @@
import numpy.testing as npt
import pandas as pd
import pytest
from dask.distributed import Client
from hats import pixel_math

# pylint: disable=missing-function-docstring, redefined-outer-name


def pytest_collection_modifyitems(config, items):
@pytest.fixture(scope="session", name="dask_client")
def dask_client():
"""Create a single client for use by all unit test cases."""
client = Client(n_workers=1, threads_per_worker=1)
yield client
client.close()


def pytest_collection_modifyitems(items):
"""Modify dask unit tests to
- ignore event loop deprecation warnings
- have a longer timeout default timeout (5 seconds instead of 1 second)
Expand All @@ -26,20 +35,16 @@ def pytest_collection_modifyitems(config, items):
def test_long_running():
...
"""
use_ray = config.getoption("--use_ray")
skip_ray = pytest.mark.skip(reason="skipping this test under dask-on-ray")
first_dask = True
for item in items:
timeout = None
for mark in item.iter_markers(name="dask"):
timeout = 10
if "timeout" in mark.kwargs:
timeout = int(mark.kwargs.get("timeout"))
if "skip_ray" in mark.kwargs and use_ray:
item.add_marker(skip_ray)
if timeout:
if first_dask:
## The first test requires more time to set up the dask/ray client
## The first test requires more time to set up the dask client
timeout += 10
first_dask = False
item.add_marker(pytest.mark.timeout(timeout))
Expand Down

0 comments on commit 9aa49c4

Please sign in to comment.