winforms icon indicating copy to clipboard operation
winforms copied to clipboard

Code Coverage for ComputerInfoDebugView from #11863

Open paul1956 opened this issue 1 year ago • 8 comments

Part of Fixes in https://github.com/dotnet/winforms/pull/11863

Proposed changes

  • Add Code Coverage for ComputerInfoDebugView

Customer Impact

  • Improve Code Coverage for VB

Regression?

  • No

Risk

  • None, tests only
Microsoft Reviewers: Open in CodeFlow

paul1956 avatar Oct 12 '24 02:10 paul1956

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 75.58947%. Comparing base (b7c5bee) to head (0337cf4). Report is 3 commits behind head on main.

Additional details and impacted files
@@                 Coverage Diff                 @@
##                main      #12315         +/-   ##
===================================================
+ Coverage   75.58551%   75.58947%   +0.00396%     
===================================================
  Files           3135        3136          +1     
  Lines         635987      635992          +5     
  Branches       47024       47023          -1     
===================================================
+ Hits          480714      480743         +29     
+ Misses        151811      151801         -10     
+ Partials        3462        3448         -14     
Flag Coverage Δ
Debug 75.58947% <100.00000%> (+0.00396%) :arrow_up:
integration 18.25377% <0.00000%> (+0.00881%) :arrow_up:
production 49.12128% <100.00000%> (+0.00596%) :arrow_up:
test 97.02909% <100.00000%> (+0.00202%) :arrow_up:
unit 46.07650% <100.00000%> (-0.02283%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

codecov[bot] avatar Oct 12 '24 02:10 codecov[bot]

@lonitra I copied the platform exception from the ComputerInfoView and updated the exception testing for non Windows to be Fluent but that code is never hit.

Does this code (and the full version I copied from) ever run on a non Windows platform?

If it never does why is the "else" branch even there in both test files?

paul1956 avatar Oct 18 '24 04:10 paul1956

Hm, I'm not aware of any test runs we have that run on a non Windows platform so I'm inclined to remove it. 🤔 Perhaps there is some historical context that @KlausLoeffelmann may know as to why that is there?

lonitra avatar Oct 18 '24 22:10 lonitra

Hm, I'm not aware of any test runs we have that run on a non Windows platform so I'm inclined to remove it. 🤔 Perhaps there is some historical context that @KlausLoeffelmann may know as to why that is there?

@KlausLoeffelmann @lonitra the Non Debug View has the same code, plus not Fluent. I can remove both, it would make coverage 100% vs very low now.

paul1956 avatar Oct 18 '24 23:10 paul1956

Let's go ahead and remove it in tests since we do not test on non Windows

lonitra avatar Oct 21 '24 19:10 lonitra

Let's go ahead and remove it in tests since we do not test on non Windows

@lonitra it’s removed in my tests of ComputerInfoDebugView. It still exists in the tests for Computer Info, even if it does run on non windows platforms, the “if” is unnecessary because the excluded code should work everywhere.

paul1956 avatar Oct 21 '24 23:10 paul1956

@lonitra what does untriaged mean?

I cleaned up ComputerInfoTests and made them Fluent

paul1956 avatar Oct 22 '24 08:10 paul1956

what does untriaged mean?

This is only meant for issues, sometimes bot applies this after removing author feedback label for PRs that I have not been able to investigate yet..

lonitra avatar Oct 22 '24 16:10 lonitra