Skip to content

Improved code coverage#208

Merged
GlassOfWhiskey merged 23 commits intomasterfrom
improved-code-coverage
Feb 25, 2026
Merged

Improved code coverage#208
GlassOfWhiskey merged 23 commits intomasterfrom
improved-code-coverage

Conversation

@marcoSanti
Copy link
Copy Markdown
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.

  • Fixed Docker CI/CD tests: previusly the test suite executind within the Docker image was executing twice the server unit tests, instead of executing the POSIX syscall unit tests. This commit now uniforms it to the standard unit tests.

  • 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
Copy Markdown

codecov bot commented Feb 17, 2026

Codecov Report

❌ Patch coverage is 71.90083% with 34 lines in your changes missing coverage. Please review.
✅ Project coverage is 58.59%. Comparing base (79e5b06) to head (ba3c3c1).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
capio/tests/unit/server/src/storage_manager.cpp 66.12% 0 Missing and 21 partials ⚠️
capio/tests/unit/server/src/client_manager.cpp 65.51% 1 Missing and 9 partials ⚠️
capio/tests/unit/server/src/main.cpp 82.35% 0 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #208      +/-   ##
==========================================
+ Coverage   56.14%   58.59%   +2.45%     
==========================================
  Files          71       75       +4     
  Lines        3482     3635     +153     
  Branches     2165     2285     +120     
==========================================
+ Hits         1955     2130     +175     
+ Misses        575      536      -39     
- Partials      952      969      +17     

☔ 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
@marcoSanti marcoSanti marked this pull request as ready for review February 21, 2026 18:45
Comment thread capio/tests/unit/server/src/main.cpp Outdated
Comment thread capio/tests/unit/server/src/main.cpp Outdated
Comment thread capio/server/src/storage_manager.cpp
Comment thread capio/tests/unit/syscall/CMakeLists.txt Outdated
Co-authored-by: Iacopo Colonnelli <iacopo.c92@gmail.com>
Copy link
Copy Markdown
Collaborator

@GlassOfWhiskey GlassOfWhiskey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@GlassOfWhiskey GlassOfWhiskey merged commit 2ce8a77 into master Feb 25, 2026
30 checks passed
@GlassOfWhiskey GlassOfWhiskey deleted the improved-code-coverage branch February 25, 2026 18:55
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.

2 participants