Skip to content

Improve libazureinit unit test coverage to 100%#295

Open
peytonr18 wants to merge 19 commits intoAzure:mainfrom
peytonr18:probertson-code-coverage
Open

Improve libazureinit unit test coverage to 100%#295
peytonr18 wants to merge 19 commits intoAzure:mainfrom
peytonr18:probertson-code-coverage

Conversation

@peytonr18
Copy link
Copy Markdown
Contributor

@peytonr18 peytonr18 commented Apr 20, 2026

Summary

This PR brings unit test code coverage (as measured by cargo-llvm-cov) to 100% across 11 source files in the libazureinit crate. The modules kvp.rs and logging.rs are excluded as they are scheduled for refactoring.

image
test result: ok. 139 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 30.06s

Filename                      Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
config.rs                         732                25    96.58%          34                 0   100.00%         512                 0   100.00%           0                 0         -
error.rs                          333                 0   100.00%          27                 0   100.00%         195                 0   100.00%           0                 0         -
health.rs                         343                 7    97.96%          20                 0   100.00%         192                 0   100.00%           0                 0         -
http.rs                           310                 2    99.35%          19                 0   100.00%         178                 0   100.00%           0                 0         -
imds.rs                           309                 2    99.35%          19                 0   100.00%         194                 0   100.00%           0                 0         -
kvp.rs                            663                96    85.52%          38                 7    81.58%         481                68    85.86%           0                 0         -
lib.rs                             56                 2    96.43%           3                 0   100.00%          33                 0   100.00%           0                 0         -
logging.rs                        600                78    87.00%          36                 5    86.11%         387                61    84.24%           0                 0         -
media.rs                          206                 1    99.51%          18                 0   100.00%         254                 0   100.00%           0                 0         -
provision/hostname.rs              31                 0   100.00%           3                 0   100.00%          18                 0   100.00%           0                 0         -
provision/mod.rs                  197                 5    97.46%          13                 0   100.00%         213                 0   100.00%           0                 0         -
provision/password.rs             130                 0   100.00%          11                 0   100.00%          64                 0   100.00%           0                 0         -
provision/ssh.rs                  480                13    97.29%          36                 0   100.00%         283                 0   100.00%           0                 0         -
provision/user.rs                 170                 5    97.06%          13                 0   100.00%         108                 0   100.00%           0                 0         -
status.rs                         286                 9    96.85%          17                 0   100.00%         148                 0   100.00%           0                 0         -
unittest.rs                        42                 0   100.00%           4                 0   100.00%          28                 0   100.00%           0                 0         -
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                            4888               245    94.99%         311                12    96.14%        3288               129    96.08%  

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.52%. Comparing base (fd14207) to head (bf43574).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #295      +/-   ##
==========================================
+ Coverage   84.77%   91.52%   +6.74%     
==========================================
  Files          17       17              
  Lines        3435     3905     +470     
==========================================
+ Hits         2912     3574     +662     
+ Misses        523      331     -192     

☔ 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.

@peytonr18 peytonr18 force-pushed the probertson-code-coverage branch from d871e97 to d38d62a Compare April 22, 2026 19:13
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.

3 participants