diff --git a/Makefile b/Makefile index f061859dcd4..e67f3c4d067 100644 --- a/Makefile +++ b/Makefile @@ -32,12 +32,12 @@ unittest-dev-231: unittest-all-222: @echo "Running all unittests" @pip install -r requirements/requirements_tests.txt - @pytest -v -m "not fluent_231" --cov=ansys.fluent --cov-report html:cov_html --cov-config=.coveragerc + @pytest -v -m "not fluent_231" --cov=ansys.fluent --cov-report html:cov_html --cov-config=.coveragerc --durations=0 unittest-all-231: @echo "Running all unittests" @pip install -r requirements/requirements_tests.txt - @pytest -v -m "not fluent_222" --cov=ansys.fluent --cov-report html:cov_html --cov-config=.coveragerc + @pytest -v -m "not fluent_222" --cov=ansys.fluent --cov-report html:cov_html --cov-config=.coveragerc --durations=0 api-codegen: @echo "Running API codegen" diff --git a/src/ansys/fluent/core/launcher/fluent_container.py b/src/ansys/fluent/core/launcher/fluent_container.py index 14e168d72f5..9cc0bf34abd 100644 --- a/src/ansys/fluent/core/launcher/fluent_container.py +++ b/src/ansys/fluent/core/launcher/fluent_container.py @@ -39,6 +39,7 @@ def start_fluent_container(mounted_from: str, mounted_to: str, args: List[str]) port = _get_free_port() container_sifile = mounted_to + "/" + Path(sifile).name image_tag = os.getenv("FLUENT_IMAGE_TAG", "v22.2.0") + test_name = os.getenv("PYFLUENT_TEST_NAME", "none") try: subprocess.run( @@ -57,6 +58,8 @@ def start_fluent_container(mounted_from: str, mounted_to: str, args: List[str]) f"REMOTING_PORTS={port}/portspan=2", "-e", "FLUENT_LAUNCHED_FROM_PYFLUENT=1", + "-l", + f"test_name={test_name}", f"ghcr.io/pyansys/pyfluent:{image_tag}", "-gu", f"-sifile={container_sifile}", diff --git a/tests/conftest.py b/tests/conftest.py index 333574c28b4..c6e1e200b70 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -13,5 +13,8 @@ def pytest_collection_modifyitems(items, config): @pytest.fixture -def with_launching_container(monkeypatch: pytest.MonkeyPatch) -> None: +def with_launching_container( + monkeypatch: pytest.MonkeyPatch, request: pytest.FixtureRequest +) -> None: monkeypatch.setenv("PYFLUENT_LAUNCH_CONTAINER", "1") + monkeypatch.setenv("PYFLUENT_TEST_NAME", request.node.name)