Skip to content

Commit 0f28b4e

Browse files
germa89pyansys-ci-botpre-commit-ci[bot]Copilot
authored
fix(tests): update pytest arguments for consistency and clarity in local and remote workflows (#4322)
* fix(tests): update pytest arguments for consistency and clarity in local and remote workflows * chore: adding changelog file 4322.fixed.md [dependabot-skip] * ci: auto fixes from pre-commit.com hooks. for more information, see https://pre-commit.ci * fix(tests): update xfail condition for remote DPF upload test * Update pyproject.toml Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: pyansys-ci-bot <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Copilot <[email protected]>
1 parent 206df2a commit 0f28b4e

File tree

5 files changed

+25
-10
lines changed

5 files changed

+25
-10
lines changed

.github/workflows/test-local.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -289,9 +289,7 @@ jobs:
289289
$cmd ${PYTEST_INPUT_ARGUMENTS} \
290290
${PYTEST_ARGUMENTS} \
291291
--report-log=$file_name.jsonl \
292-
--cov-report=xml:$file_name.xml \
293-
--log-file=pytest.log \
294-
--log-file-level="DEBUG"
292+
--cov-report=xml:$file_name.xml
295293
296294
- name: "Upload pytest reports to GitHub"
297295
if: always()

.github/workflows/test-remote.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ jobs:
8585
DPF_START_SERVER: False
8686
HAS_DPF: True
8787
TEST_DPF_BACKEND: false
88-
PYTEST_ARGUMENTS: '-vvv -ra --color=yes --durations=30 --random-order --random-order-bucket=class --maxfail=2 --reruns 2 --reruns-delay 2 --cov=ansys.mapdl.core --cov-report=html --timeout=180 --profile-svg --profile --report-log-exclude-logs-on-passed-tests --strict-markers'
88+
PYTEST_ARGUMENTS: '--ignore_image_cache'
8989
MAPDL_PACKAGE: ghcr.io/ansys/mapdl
9090

9191
steps:
@@ -276,11 +276,8 @@ jobs:
276276
echo "ON_STUDENT: $ON_STUDENT"
277277
xvfb-run pytest \
278278
${PYTEST_ARGUMENTS} \
279-
--ignore_image_cache \
280279
--report-log=$file_name.jsonl \
281-
--cov-report=xml:$file_name.xml \
282-
--log-file=pytest.log \
283-
--log-file-level="DEBUG"
280+
--cov-report=xml:$file_name.xml
284281
285282
- name: "Print amount of restarts"
286283
if: always()

doc/changelog.d/4322.fixed.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Update pytest arguments for consistency and clarity in local and remote workflows

pyproject.toml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,26 @@ pymapdl = "ansys.mapdl.core.cli:main"
131131
pymapdl_convert_script = "ansys.mapdl.core.cli:old_pymapdl_convert_script_entry_point"
132132

133133
[tool.pytest.ini_options]
134-
addopts = "-ra -vvv --maxfail=10 --strict-markers --random-order-bucket=class --random-order --durations=10 --timeout=180"
134+
addopts = [
135+
"--cov-report=html",
136+
"--cov=ansys.mapdl.core",
137+
"--durations=30",
138+
"--log-file-level=DEBUG",
139+
"--log-file=pytest.log",
140+
"--maxfail=10",
141+
"--profile",
142+
"--profile-svg",
143+
"--random-order",
144+
"--random-order-bucket=class",
145+
"--report-log-exclude-logs-on-passed-tests",
146+
"--reruns-delay=4",
147+
"--reruns=3",
148+
"--strict-markers",
149+
"--timeout=180",
150+
"-ra",
151+
"-vvv",
152+
]
153+
135154
filterwarnings = [
136155
"ignore::DeprecationWarning",
137156
"ignore::FutureWarning",

tests/test_result.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ def test_DPF_result_class(self, mapdl, _use_reader_backend, expected_cls):
499499
mapdl._use_reader_backend = _use_reader_backend
500500
assert isinstance(mapdl.result, expected_cls)
501501

502-
@pytest.mark.xfail(not ON_LOCAL, reason="Upload to remote using DPF is broken")
502+
@pytest.mark.xfail(True, reason="Upload to remote using DPF is broken")
503503
def test_solve_rst_only(self, mapdl, result):
504504
"""Test that the result object can be created with a solved RST file."""
505505
# Check if the result object is created successfully

0 commit comments

Comments
 (0)