test(di): add service_container integration tests and fix public headers#384
Merged
kcenon merged 1 commit intoFeb 23, 2026
Conversation
Add 25 unit tests validating database_system's service_registration.h API works correctly with common_system's service_container. Tests cover registration (factory/instance/transient/singleton), resolution, unregister, freeze, scoped containers, thread safety, and the get_underlying_database_manager utility. Fix pre-existing bugs in public headers that were never compiled: - Fix broken relative include paths in service_registration.h and common_system_database_adapter.h (../../database/ -> database/) - Fix renamed enum: database_types::postgresql -> database_types::postgres Part of kcenon/common_system#369
Closed
4 tasks
kcenon
added a commit
that referenced
this pull request
Apr 13, 2026
…ers (#384) Add 25 unit tests validating database_system's service_registration.h API works correctly with common_system's service_container. Tests cover registration (factory/instance/transient/singleton), resolution, unregister, freeze, scoped containers, thread safety, and the get_underlying_database_manager utility. Fix pre-existing bugs in public headers that were never compiled: - Fix broken relative include paths in service_registration.h and common_system_database_adapter.h (../../database/ -> database/) - Fix renamed enum: database_types::postgresql -> database_types::postgres Part of kcenon/common_system#369
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes kcenon/common_system#369
Summary
service_registration.hvalidating integration withcommon_system::di::service_containerservice_registration.handcommon_system_database_adapter.h(../../database/→database/)database_types::postgresql→database_types::postgrestests/CMakeLists.txtgated onBUILD_WITH_COMMON_SYSTEMContext
Part of the DI container consolidation effort (kcenon/common_system#363, Phase 5).
database_system has no legacy internal DI container —
service_registration.halready correctly usesservice_container. However, the public headers underinclude/kcenon/database/had never been compiled and contained broken include paths and a renamed enum reference. This PR fixes those issues and adds comprehensive test coverage.The
database_coordinatorintentionally manages adapter lifecycle with phase-aware initialization ordering (Logger → Monitor → Thread) and is not a DI container. No refactoring of the coordinator is needed.Test Coverage (25 tests)
Test Plan
USE_CONTAINER_SYSTEM=OFF