Skip to content

Comments

Improved code coverage#208

Draft
marcoSanti wants to merge 16 commits intomasterfrom
improved-code-coverage
Draft

Improved code coverage#208
marcoSanti wants to merge 16 commits intomasterfrom
improved-code-coverage

Conversation

@marcoSanti
Copy link
Member

@marcoSanti marcoSanti commented Feb 17, 2026

This pull request introduces unit tests for the StorageManager and ClientManager classes and refactors parts of their implementation to improve testability and coverage reporting.

Changes

  • Refactor ClientManager for improved gcovr compatibility

    • Modify ClientManager::ClientDataBuffers to store objects instead of pointers. This allows gcovr to correctly detect destructor calls for member attributes.
    • Introduce a dedicated constructor for ClientDataBuffers to simplify object creation and ensure proper coverage reporting. Previously, move operations were interpreted by gcovr as partially covered code.
  • Add unit tests

    • Add comprehensive unit tests for the StorageManager class.
    • Add comprehensive unit tests for the ClientManager class.
  • Improve StorageManager testability

    • Remove the dependency on the global client_manager variable by passing a reference through the StorageManager constructor.
    • This enables unit tests to compile and run without requiring a globally defined client_manager.
  • Bug fix

    • Fix a minor issue in StorageManager::getPaths() where empty paths were previously added to the returned vector.
  • Build system update

    • Move the CAPIO-CL dependency from capio/server/CMakeLists.txt to the top-level project CMakeLists.txt, allowing both the server components and the unit tests to compile successfully.

@marcoSanti marcoSanti marked this pull request as draft February 17, 2026 10:09
@marcoSanti marcoSanti changed the title Began refactor for better code coverage Improved code coverage Feb 17, 2026
@marcoSanti marcoSanti force-pushed the improved-code-coverage branch from a78da31 to b6278a6 Compare February 17, 2026 10:11
@codecov
Copy link

codecov bot commented Feb 17, 2026

Codecov Report

❌ Patch coverage is 68.80000% with 39 lines in your changes missing coverage. Please review.
✅ Project coverage is 58.50%. Comparing base (79e5b06) to head (7df1a47).

Files with missing lines Patch % Lines
capio/tests/unit/server/src/storage_manager.hpp 66.12% 0 Missing and 21 partials ⚠️
capio/tests/unit/server/src/client_manager.hpp 67.85% 0 Missing and 9 partials ⚠️
capio/tests/unit/server/src/main.cpp 60.86% 0 Missing and 9 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #208      +/-   ##
==========================================
+ Coverage   56.14%   58.50%   +2.35%     
==========================================
  Files          71       75       +4     
  Lines        3482     3639     +157     
  Branches     2165     2271     +106     
==========================================
+ Hits         1955     2129     +174     
+ Misses        575      548      -27     
- Partials      952      962      +10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@marcoSanti marcoSanti force-pushed the improved-code-coverage branch 12 times, most recently from 8807a4a to 6e64718 Compare February 17, 2026 19:23
@marcoSanti marcoSanti marked this pull request as ready for review February 17, 2026 19:52
@marcoSanti marcoSanti marked this pull request as draft February 17, 2026 20:00
@marcoSanti marcoSanti force-pushed the improved-code-coverage branch 2 times, most recently from 05572d0 to 4430b14 Compare February 18, 2026 14:59
@marcoSanti marcoSanti force-pushed the improved-code-coverage branch from 094f4da to b6c0b24 Compare February 19, 2026 13:15
@marcoSanti marcoSanti force-pushed the improved-code-coverage branch 4 times, most recently from f1f2f43 to f1204d1 Compare February 19, 2026 14:17
@marcoSanti marcoSanti force-pushed the improved-code-coverage branch from f1204d1 to 7df1a47 Compare February 21, 2026 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant