From f9f0a4387e83bf6979c97c2f1fe065ad4473f713 Mon Sep 17 00:00:00 2001 From: Fabrice Normandin Date: Mon, 15 Apr 2024 14:26:34 -0400 Subject: [PATCH] Group tests by cluster during distributed tests Signed-off-by: Fabrice Normandin --- pyproject.toml | 3 ++- tests/conftest.py | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index eff3b66f..b10d62d4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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" diff --git a/tests/conftest.py b/tests/conftest.py index 56cc52db..7f4b302f 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -257,11 +257,11 @@ 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: @@ -269,7 +269,7 @@ async def launches_job_fixture(login_node_v2: RemoteV2, job_name: str): 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: