Scarabaeus Testing Suite#

Last revised on 2026 MAY 28 by G. Fereoli.

Scarabaeus (SCB) uses pytest for automated testing. The test suite lives in tests/ at the repository root and is split into unit and system tests. The system tests are further divided into functional, integration, V&V, and performance tests, which themselves include code profiling and code coverage.

tests/
├── unit_testing/          # isolated tests per class/module
│   ├── body_tests/
│   ├── dynamics_tests/
│   ├── environment_tests/
│   ├── guidance_tests/
│   ├── measurements_tests/
│   ├── orbitDetermination_tests/
│   ├── spacecraft_tests/
│   ├── timeAndFrame_tests/
│   ├── units_tests/
│   └── utils_tests/
└── system_testing/
    ├── functional_testing/    # functional verification tests
    ├── integration_testing/   # end-to-end scenario tests
    ├── performance_testing/   # profiling and code coverage
    └── V&V                    # validation & verification tests

Running All Tests#

From the repository root (with your virtual environment active):

pytest tests/

To run only a specific tier:

pytest tests/unit_testing/
pytest tests/system_testing/integration_testing/

To run a single test file:

pytest tests/unit_testing/body_tests/test_CelestialBody.py

Adding to the Testing Suite#

Whenever you add any new functionality to Scarabaeus, you must also include this functionality in the testing suite.

Depending on the complexity and depth of your addition, you may need to create multiple tests across different levels of the suite. For example, a simple new class that only holds information within itself would only require a unit test. However, a more complex new class that interacts with other SCB classes would require integration tests in addition to unit testing.

The following sections provide more information on each of the different levels of testing and their expected use cases.

Unit Tests#

Unit tests verify the behaviour of individual Scarabaeus classes and methods in isolation. Each test file maps to one class (e.g. test_CelestialBody.py tests CelestialBody) and lives under the matching module subdirectory of tests/unit_testing/.

Running unit tests:

pytest tests/unit_testing/

Running a single module’s tests:

pytest tests/unit_testing/body_tests/

Writing a New Unit Test#

Whenever you create a new class or add a new method to an existing class, you must also include a test or tests for it in the testing suite:

  1. Create tests/unit_testing/<module>_tests/test_ClassName.py.

  2. For new classes, ensure that initialization functions properly.

Integration Tests#

Integration tests run end-to-end OD scenarios to verify that the full pipeline—propagation, measurement simulation, filtering, and output—produces correct results. They live in tests/integration_testing/ and typically require SPICE kernels and data files.

Running integration tests:

pytest tests/integration_testing/

Note

Integration tests load SPICE kernels via metakernel files stored in the test data directory. Per the SPICE metakernel specification, file paths within a metakernel cannot exceed 255 characters. If the full path to the test data directory is long, use SPICE’s + line-continuation marker for kernel filenames that would otherwise exceed the limit.

Each integration test is self-contained and uses pytest-dependency markers to express ordering constraints where one scenario must complete before another.