Back to Mongo

TestCases

buildscripts/resmokelib/testing/testcases/README.md

3.6.17-windows-splunk-v34.7 KB
Original Source

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/