You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reorganize the 57 currently-flat tests/ files to mirror src/{alert,collectors,context,core,modules,platform,plugins,utils}/, OR document a deliberate flat-layout exception in tests/README.md with explicit rationale. Pick whichever is right for this codebase — the EPIC explicitly allows either outcome.
Why
A flat 57-file tests/ directory makes test-to-source navigation harder than it needs to be. With src/ standardised across nine feature directories (after sub-issues #1-#4), mirroring is the lowest-friction layout: everyone knows that tests/<feature>/test_<thing>.cpp covers src/<feature>/<thing>.cpp.
Sometimes a flat layout is the right answer (e.g., if the tests are predominantly cross-feature integration scenarios that don't belong to any single feature). If so, document the rationale so future contributors don't re-debate this. The EPIC AC explicitly accepts either outcome with documentation.
New tests/README.md if going the documented-flat route
How
Technical Approach
Option A: Mirror src/ (preferred when most tests are unit tests for a single feature)
Categorise each of the 57 files: which feature does it primarily test? (Inspect #includes and the test names.)
Create tests/{alert,collectors,context,core,modules,platform,plugins,utils}/ as needed.
git mv each test into the matching feature directory.
For tests that cover multiple features, place them under a clearly-named subdirectory (e.g., tests/integration/) and decide whether they should live under integration_tests/ instead.
If the categorisation pass shows that flatness is genuinely intentional (e.g., > 50% of tests are cross-feature), add tests/README.md explaining:
Why flat is the right choice for this directory
How tests are named (so navigation works without subdirectories)
When a test should be split out (the criteria for moving into integration_tests/)
Decision Rule
Run the categorisation first (it's cheap). If 70%+ of the 57 files have a clear feature-owner, go with Option A. Otherwise, go with Option B.
Dependencies
Blocked by: src/impl consolidation sub-issue (so the feature dirs are stable to mirror)
Soft dependency: CMake decomposition sub-issue (cleaner test registration in cmake/test.cmake is easier to update than scrolling through the monolith — but not a hard block; this could land before feat: Phase 4 - Reliability & Safety Implementation #4 if needed)
Acceptance Criteria
Either: every test file under tests/<feature>/ matching src/<feature>/, OR tests/README.md documents the flat layout with clear rationale
CMake test registration updated to reflect the chosen layout
All ctest cases still discovered and passing
Build green
PR merged with every CI check pass/neutral
Estimated Size
S–M. Pure file movement (Option A) or documentation (Option B). The categorisation pass is the bulk of the work in either case.
What
Reorganize the 57 currently-flat
tests/files to mirrorsrc/{alert,collectors,context,core,modules,platform,plugins,utils}/, OR document a deliberate flat-layout exception intests/README.mdwith explicit rationale. Pick whichever is right for this codebase — the EPIC explicitly allows either outcome.Why
A flat 57-file
tests/directory makes test-to-source navigation harder than it needs to be. With src/ standardised across nine feature directories (after sub-issues #1-#4), mirroring is the lowest-friction layout: everyone knows thattests/<feature>/test_<thing>.cppcoverssrc/<feature>/<thing>.cpp.Sometimes a flat layout is the right answer (e.g., if the tests are predominantly cross-feature integration scenarios that don't belong to any single feature). If so, document the rationale so future contributors don't re-debate this. The EPIC AC explicitly accepts either outcome with documentation.
Where
tests/(57 files)CMakeLists.txttest registration (after sub-issue feat: Phase 4 - Reliability & Safety Implementation #4 lands, this is incmake/test.cmake)tests/README.mdif going the documented-flat routeHow
Technical Approach
Option A: Mirror src/ (preferred when most tests are unit tests for a single feature)
#includes and the test names.)tests/{alert,collectors,context,core,modules,platform,plugins,utils}/as needed.git mveach test into the matching feature directory.tests/integration/) and decide whether they should live under integration_tests/ instead.cmake/test.cmake).Option B: Document the flat layout
If the categorisation pass shows that flatness is genuinely intentional (e.g., > 50% of tests are cross-feature), add
tests/README.mdexplaining:Decision Rule
Run the categorisation first (it's cheap). If 70%+ of the 57 files have a clear feature-owner, go with Option A. Otherwise, go with Option B.
Dependencies
cmake/test.cmakeis easier to update than scrolling through the monolith — but not a hard block; this could land before feat: Phase 4 - Reliability & Safety Implementation #4 if needed)Acceptance Criteria
tests/<feature>/matchingsrc/<feature>/, ORtests/README.mddocuments the flat layout with clear rationalepass/neutralEstimated Size
S–M. Pure file movement (Option A) or documentation (Option B). The categorisation pass is the bulk of the work in either case.
Part of #674