Skip to content

[Backport 2025.2] improvement(nemesis_tests): Make tests independant from production Nemesis #10957

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

scylladbbot
Copy link

  • Add NemesisRegistry tests
    • Replaces and extends existing tests for selectors and such
  • Split Nemesis tests into 3 modules
    • test_registry - Tests NemesisRegistry directly
    • test_sisyphus - Tests Sisyphus and its respective functionality
    • test_specific_nemesis - Tests implementations of specific nemesis
      • Only tests that are still dependant on the implementation
  • Introduce new class hierarchy for tests only
  • Fixes Make test_nemesis independent from Nemesis disruption methods #10592

Testing

  • locally

PR pre-checks (self review)

  • I added the relevant backport labels

  • I didn't leave commented-out/debugging code

  • (cherry picked from commit 40d435b)

  • (cherry picked from commit de7c7c5)

Parent PR: #10912

pehala added 2 commits May 27, 2025 07:22
- Move them to separate directory
- Use custom subclass hierarchies to make them less dependent on the implementation
- Add NemesisRegistry tests
- Fixes scylladb#10592

(cherry picked from commit de7c7c5)
@scylladbbot scylladbbot force-pushed the backport/10912/to-2025.2 branch from 42fbefe to 2bdec6d Compare May 27, 2025 07:22
from unit_tests.test_tester import ClusterTesterForTests


class TestNemesisClass(Nemesis):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This naming makes pytest think it is test class and produce following messages:

10:28:07  collecting ... /tmp/jenkins/workspace/an_scylla-cluster-tests_PR-10957/unit_tests/nemesis/test_sisyphus.py:14: PytestCollectionWarning: cannot collect test class 'TestNemesisClass' because it has a __init__ constructor (from: nemesis/test_sisyphus.py)
10:28:07    class TestNemesisClass(Nemesis):
10:28:07  /tmp/jenkins/workspace/an_scylla-cluster-tests_PR-10957/unit_tests/nemesis/test_sisyphus.py:14: PytestCollectionWarning: cannot collect test class 'TestNemesisClass' because it has a __init__ constructor (from: nemesis/test_specific_nemesis.py)
10:28:07    class TestNemesisClass(Nemesis):

@vponomaryov vponomaryov merged commit b40e866 into scylladb:branch-2025.2 May 27, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants