Repository navigation
Tests: Skip tests unstable on other architectures. - #8138
jakub-vavra-cz wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Code Review
This pull request skips several tests that are unstable on architectures other than x86_64. The approach is sound, but the implementation introduces significant code duplication across multiple test files. My review focuses on refactoring this duplicated logic into a reusable helper or fixture to improve code maintainability, which is a high-priority concern. By centralizing the architecture check, future modifications will be much simpler and less error-prone.
| arch = multihost.client[0].run_command( | ||
| 'uname -m', raiseonerr=False).stdout_text | ||
| if 'x86_64' not in arch: | ||
| pytest.skip("Test is not stable on other architectures.") |
There was a problem hiding this comment.
This architecture check logic is duplicated in test_adtrust.py and test_misc.py. To improve maintainability and adhere to the DRY (Don't Repeat Yourself) principle, this logic should be extracted into a shared helper function or a pytest fixture.
A pytest fixture placed in a common conftest.py (e.g., src/tests/multihost/conftest.py) would be an idiomatic solution. For example:
# in a common conftest.py
import pytest
@pytest.fixture
def skip_unstable_on_non_x86_64(multihost):
"""Skips tests on non-x86_64 architectures."""
arch = multihost.client[0].run_command(
'uname -m', raiseonerr=False).stdout_text
if 'x86_64' not in arch:
pytest.skip("Test is not stable on other architectures.")You could then apply this fixture to the test methods that require this check using @pytest.mark.usefixtures("skip_unstable_on_non_x86_64"). This would make the tests cleaner and the logic centralized.
| arch = multihost.client[0].run_command( | ||
| 'uname -m', raiseonerr=False).stdout_text | ||
| if 'x86_64' not in arch: | ||
| pytest.skip("Test is not stable on other architectures.") |
| arch = multihost.client[0].run_command( | ||
| 'uname -m', raiseonerr=False).stdout_text | ||
| if 'x86_64' not in arch: | ||
| pytest.skip("Test is not stable on other architectures.") |
| arch = multihost.client[0].run_command( | ||
| 'uname -m', raiseonerr=False).stdout_text | ||
| if 'x86_64' not in arch: | ||
| pytest.skip("Test is not stable on other architectures.") |
|
@jakub-vavra-cz could you check why are tests failing? |
test_kcm - timeout issue beaker <-> openstack |
Cherry pick of the #8135 on sssd-2-9