From 95ad689e17583252a5164a2d24201050f95c2501 Mon Sep 17 00:00:00 2001 From: germa89 <28149841+germa89@users.noreply.github.com> Date: Mon, 24 Nov 2025 20:46:01 +0100 Subject: [PATCH 1/5] fix(tests): update pytest arguments for consistency and clarity in local and remote workflows --- .github/workflows/test-local.yml | 6 ++---- .github/workflows/test-remote.yml | 7 ++----- pyproject.toml | 22 +++++++++++++++++++++- 3 files changed, 25 insertions(+), 10 deletions(-) diff --git a/.github/workflows/test-local.yml b/.github/workflows/test-local.yml index bce0a912d94..45558d1cc3c 100644 --- a/.github/workflows/test-local.yml +++ b/.github/workflows/test-local.yml @@ -126,7 +126,7 @@ jobs: TESTING_MINIMAL: ${{ inputs.testing-minimal }} P_SCHEMA: "/ansys_inc/v241/ansys/ac4/schema" PYTEST_TIMEOUT: 120 # seconds. Limit the duration for each unit test - PYTEST_ARGUMENTS: '-vvv -ra --color=yes --durations=30 --random-order --random-order-bucket=class --maxfail=10 --reruns 3 --reruns-delay 4 --cov=ansys.mapdl.core --cov-report=html --timeout=180 --profile-svg --profile --report-log-exclude-logs-on-passed-tests --strict-markers' + PYTEST_ARGUMENTS: '' OMPI_ALLOW_RUN_AS_ROOT: 1 OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1 DATAPROCESSING_DEBUG: /home/mapdl/dpf_logs @@ -276,9 +276,7 @@ jobs: $cmd ${PYTEST_INPUT_ARGUMENTS} \ ${PYTEST_ARGUMENTS} \ --report-log=$file_name.jsonl \ - --cov-report=xml:$file_name.xml \ - --log-file=pytest.log \ - --log-file-level="DEBUG" + --cov-report=xml:$file_name.xml - name: "Upload pytest reports to GitHub" if: always() diff --git a/.github/workflows/test-remote.yml b/.github/workflows/test-remote.yml index fc67e101eca..54efda68632 100644 --- a/.github/workflows/test-remote.yml +++ b/.github/workflows/test-remote.yml @@ -73,7 +73,7 @@ jobs: DPF_START_SERVER: False HAS_DPF: True TEST_DPF_BACKEND: false - PYTEST_ARGUMENTS: '-vvv -ra --color=yes --durations=30 --random-order --random-order-bucket=class --maxfail=10 --reruns 3 --reruns-delay 4 --cov=ansys.mapdl.core --cov-report=html --timeout=180 --profile-svg --profile --report-log-exclude-logs-on-passed-tests --strict-markers' + PYTEST_ARGUMENTS: '--ignore_image_cache' MAPDL_PACKAGE: ghcr.io/ansys/mapdl steps: @@ -264,11 +264,8 @@ jobs: echo "ON_STUDENT: $ON_STUDENT" xvfb-run pytest \ ${PYTEST_ARGUMENTS} \ - --ignore_image_cache \ --report-log=$file_name.jsonl \ - --cov-report=xml:$file_name.xml \ - --log-file=pytest.log \ - --log-file-level="DEBUG" + --cov-report=xml:$file_name.xml - name: "Print amount of restarts" if: always() diff --git a/pyproject.toml b/pyproject.toml index 95f31d1f92b..719784bedcd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -131,7 +131,27 @@ pymapdl = "ansys.mapdl.core.cli:main" pymapdl_convert_script = "ansys.mapdl.core.cli:old_pymapdl_convert_script_entry_point" [tool.pytest.ini_options] -addopts = "-ra -vvv --maxfail=10 --strict-markers --random-order-bucket=class --random-order --durations=10 --timeout=180" +addopts = [ + "-ra", + "-vvv", + "--durations=30", + "--timeout=180", + "--reruns=3", + "--reruns-delay=4", + "--maxfail=10", + "--strict-markers", + "--random-order", + "--random-order-bucket=class", + "--cov=ansys.mapdl.core", + "--cov-report=html", + "--profile-svg", + "--profile", + "--report-log-exclude-logs-on-passed-tests", + "--strict-markers", + "--log-file=pytest.log", + "--log-file-level=DEBUG" +] + filterwarnings = [ "ignore::DeprecationWarning", "ignore::FutureWarning", From b8ff2272cd2493f8bbb1fc391b22bda5cf09f9f5 Mon Sep 17 00:00:00 2001 From: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com> Date: Mon, 24 Nov 2025 20:00:53 +0000 Subject: [PATCH 2/5] chore: adding changelog file 4322.fixed.md [dependabot-skip] --- doc/changelog.d/4322.fixed.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 doc/changelog.d/4322.fixed.md diff --git a/doc/changelog.d/4322.fixed.md b/doc/changelog.d/4322.fixed.md new file mode 100644 index 00000000000..ea871920a27 --- /dev/null +++ b/doc/changelog.d/4322.fixed.md @@ -0,0 +1 @@ +Update pytest arguments for consistency and clarity in local and remote workflows From 5988482e897f949e7b1799089e444a418e0ab4c8 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 24 Nov 2025 20:03:03 +0000 Subject: [PATCH 3/5] ci: auto fixes from pre-commit.com hooks. for more information, see https://pre-commit.ci --- pyproject.toml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 719784bedcd..3b67c7ee4ea 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -132,24 +132,24 @@ pymapdl_convert_script = "ansys.mapdl.core.cli:old_pymapdl_convert_script_entry_ [tool.pytest.ini_options] addopts = [ - "-ra", - "-vvv", + "--cov-report=html", + "--cov=ansys.mapdl.core", "--durations=30", - "--timeout=180", - "--reruns=3", - "--reruns-delay=4", + "--log-file-level=DEBUG", + "--log-file=pytest.log", "--maxfail=10", - "--strict-markers", + "--profile", + "--profile-svg", "--random-order", "--random-order-bucket=class", - "--cov=ansys.mapdl.core", - "--cov-report=html", - "--profile-svg", - "--profile", "--report-log-exclude-logs-on-passed-tests", + "--reruns-delay=4", + "--reruns=3", "--strict-markers", - "--log-file=pytest.log", - "--log-file-level=DEBUG" + "--strict-markers", + "--timeout=180", + "-ra", + "-vvv", ] filterwarnings = [ From 392ff88d29facb5504b3efae5685684d3e61a7bf Mon Sep 17 00:00:00 2001 From: germa89 <28149841+germa89@users.noreply.github.com> Date: Wed, 26 Nov 2025 16:25:23 +0100 Subject: [PATCH 4/5] fix(tests): update xfail condition for remote DPF upload test --- tests/test_result.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_result.py b/tests/test_result.py index 995f8881f84..9319c59aedd 100644 --- a/tests/test_result.py +++ b/tests/test_result.py @@ -499,7 +499,7 @@ def test_DPF_result_class(self, mapdl, _use_reader_backend, expected_cls): mapdl._use_reader_backend = _use_reader_backend assert isinstance(mapdl.result, expected_cls) - @pytest.mark.xfail(not ON_LOCAL, reason="Upload to remote using DPF is broken") + @pytest.mark.xfail(True, reason="Upload to remote using DPF is broken") def test_solve_rst_only(self, mapdl, result): """Test that the result object can be created with a solved RST file.""" # Check if the result object is created successfully From 8a8a5fb1d7a726df3e7b6de9e85650c18df90f15 Mon Sep 17 00:00:00 2001 From: German <28149841+germa89@users.noreply.github.com> Date: Wed, 26 Nov 2025 16:28:35 +0100 Subject: [PATCH 5/5] Update pyproject.toml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- pyproject.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 3b67c7ee4ea..02487896493 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -146,7 +146,6 @@ addopts = [ "--reruns-delay=4", "--reruns=3", "--strict-markers", - "--strict-markers", "--timeout=180", "-ra", "-vvv",