Skip to main content
Version: 2.5.0

Testing Guidelines

Every new feature and bug fix should include tests. ChronoLog uses Google Test (GTest) for unit tests and custom executables for integration and system-level tests, all registered through CTest.

Test Categories

CategoryDirectoryPurpose
Unittest/unit/Verify individual components in isolation
Integrationtest/integration/Test interactions between two or more components
Communicationtest/communication/Validate RPC (Thallium) and MPI communication layers
Overheadtest/overhead/Benchmark clock synchronization and lock contention
Systemtest/system/End-to-end Python scripts for fidelity and workload simulation

Writing Unit Tests

Unit tests use the GTest framework and live under test/unit/<component>/.

File Placement

Place test files alongside the component they test:

test/unit/
├── chrono_store/
│ ├── StoryChunkTest.cpp
│ └── StoryPipelineTest.cpp
├── chrono_player/
│ └── PlayerClientTest.cpp
└── ...

CTest Naming

Register tests in CMake with the prefix Unit_<Component>_<Subject>:

add_test(NAME Unit_ChronoStore_StoryChunk COMMAND StoryChunkTest)

Best Practices

  • Use test fixtures (TEST_F) to share setup/teardown logic across related tests.
  • Keep each test focused on a single behavior.
  • Name tests descriptively: TEST_F(StoryChunkTest, RejectsEventsBeforeStartTime).

Writing Integration Tests

Integration tests are custom executables (not necessarily GTest-based) under test/integration/<scope>/.

CTest Registration

Use a descriptive prefix and mark tests that require a live deployment as MANUAL:

add_test(NAME Integration_KeeperGrapher_StoryAcquisition COMMAND keeper_grapher_test)

# Tests that need running ChronoLog services:
add_test(NAME Integration_Client_RecordEvents COMMAND client_record_test)
set_tests_properties(Integration_Client_RecordEvents PROPERTIES LABELS "MANUAL")

Manual tests are excluded from the default ctest run and must be invoked explicitly:

ctest -L MANUAL

Test Expectations for PRs

Change typeExpected tests
New public API or componentUnit tests covering the new interface
Bug fixAt least one test that reproduces the bug
Inter-component changesIntegration tests exercising the affected interaction
All PRsExisting tests must continue to pass

Disabled and Manual Tests

  • DISABLED_ prefix (GTest) — use when a test is temporarily broken and you need to land other work. File an issue to track re-enabling it.
  • MANUAL label (CTest) — use for tests that require a running ChronoLog deployment. These run in CI during the deployment jobs but are skipped in local ctest runs.

Further Reading

See Running Tests for the full test catalog and instructions on executing tests locally.