Skip to content

Commit

Permalink
Group tests by cluster during distributed tests
Browse files Browse the repository at this point in the history
Signed-off-by: Fabrice Normandin <[email protected]>
  • Loading branch information
lebrice committed Apr 15, 2024
1 parent c1c45c4 commit f9f0a43
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,10 @@ pytest-xdist = "^3.5.0"


[tool.pytest.ini_options]
addopts = "--doctest-modules"
addopts = "--doctest-modules --dist loadgroup"
markers = "--enable-internet: Allow some tests to run using real connections to the cluster."


[tool.poetry-dynamic-versioning]
enable = true
vcs = "git"
Expand Down
6 changes: 3 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,19 +257,19 @@ def job_name(request: pytest.FixtureRequest) -> str | None:
return getattr(request, "param", JOB_NAME)


@pytest_asyncio.fixture
@pytest_asyncio.fixture(scope="session")
async def launches_job_fixture(login_node_v2: RemoteV2, job_name: str):
jobs_before = await get_queued_milatools_job_ids(login_node_v2, job_name=job_name)
if jobs_before:
logger.info(f"Jobs in squeue before test: {jobs_before}")
logger.debug(f"Jobs in squeue before tests: {jobs_before}")
try:
yield
finally:
jobs_after = await get_queued_milatools_job_ids(
login_node_v2, job_name=job_name
)
if jobs_before:
logger.info(f"Jobs after test: {jobs_before}")
logger.debug(f"Jobs after tests: {jobs_before}")

new_jobs = jobs_after - jobs_before
if new_jobs:
Expand Down

0 comments on commit f9f0a43

Please sign in to comment.