mongo/buildscripts/resmokelib/testing/testcases/README.md
Steve McClure 32e8f260de SERVER-124136 Format markdown via prettier: wrap lines and use width of 100 (#52231)
GitOrigin-RevId: 3305c1e2ee3a6a2c3a5b2b7883b0f491a59ed646
2026-04-21 19:20:11 +00:00

4.8 KiB
Raw Permalink Blame History

TestCases

TestCases extend Python-based unittest.TestCase objects that resmoke can run as different "kinds" of tests.

Supported TestCases

Specify any of the following as the test_kind in your Suite config:

Interfaces

Top level interfaces:

  • TestCase - A test case to execute. The run_test method must be implemented.
  • ProcessTestCase - Base class for TestCases that executes an external process. The _make_process method must be implemented.

Subclasses:

Fixture TestCases

These are testcases that are used to coordinate fixture lifecycles via resmoke's internal FixtureTestCaseManager.

NOTE This design does lead to seeing "extra" tests in a run, where a fixture sets up, your N tests are run, and the fixture tears down, so you see N+2 "tests" passing via resmoke.

  • FixtureTestCase - Base class for the fixture test cases.
  • FixtureSetupTestCase - TestCase for setting up a fixture.
  • FixtureTeardownTestCase - TestCase for tearing down a fixture.
  • FixtureAbortTestCase - TestCase for killing/aborting a fixture. Intended for use before archiving a failed test.
    • When resmoke detects that a test has failed (and archiving is configured), it dynamically generates a new FixtureAbortTestCase for immediate execution. This test case sends a SIGABRT to each running mongod process.

Testing TestCases

Self-tests for the testcases themselves can be found in buildscripts/tests/resmokelib/testing/testcases/