Skip to content

Improve code coverage by skipping unreachable code #1705

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 25, 2025
Merged

Conversation

bkoelman
Copy link
Member

@bkoelman bkoelman commented Mar 24, 2025

Replace occurrences of:

throw new UnreachableException();

which gets flagged as non-covered by tests, with an extension method that is marked with [ExcludeFromCodeCoverage].
It works similarly to Debug.Assert, taking a boolean condition.

QUALITY CHECKLIST

  • Changes implemented in code
  • Complies with our contributing guidelines
  • N/A: Adapted tests
  • N/A: Documentation updated

Copy link

codecov bot commented Mar 24, 2025

Codecov Report

Attention: Patch coverage is 98.65772% with 2 lines in your changes missing coverage. Please review.

Project coverage is 90.75%. Comparing base (fb78af3) to head (45696f6).
Report is 3 commits behind head on openapi.

Files with missing lines Patch % Lines
...e.OpenApi.Swashbuckle/OpenApiEndpointConvention.cs 96.55% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           openapi    #1705      +/-   ##
===========================================
+ Coverage    90.41%   90.75%   +0.34%     
===========================================
  Files          466      466              
  Lines        14434    14451      +17     
  Branches      2283     2293      +10     
===========================================
+ Hits         13050    13115      +65     
+ Misses         933      909      -24     
+ Partials       451      427      -24     

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

@bkoelman bkoelman marked this pull request as ready for review March 25, 2025 23:54
@bkoelman bkoelman merged commit a771afa into openapi Mar 25, 2025
16 checks passed
@bkoelman bkoelman deleted the improve-coverage branch March 25, 2025 23:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant