Skip to content

Add missing coverage#2514

Merged
martincostello merged 2 commits intomainfrom
moar-coverage
Feb 19, 2025
Merged

Add missing coverage#2514
martincostello merged 2 commits intomainfrom
moar-coverage

Conversation

@martincostello
Copy link
Member

Add missing coverage highlighted by #2512.

  • Add missing coverage.
  • Remove redundant code paths.
  • Avoid allocating delegates.
  • Fix file name casing.

Add missing coverage highlighted by #2512.

- Add missing coverage.
- Remove redundant code paths.
- Avoid allocating delegates.
- Fix file name casing.
@martincostello martincostello added enhancement CI/build .NET Pull requests that update .NET code labels Feb 19, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 5 out of 11 changed files in this pull request and generated no comments.

Files not reviewed (6)
  • src/Polly/Registry/PolicyRegistry.cs: Evaluated as low risk
  • test/Polly.Extensions.Tests/DependencyInjection/PollyServiceCollectionExtensionTests.cs: Evaluated as low risk
  • test/Polly.Extensions.Tests/Registry/ConfigureBuilderContextExtensionsTests.cs: Evaluated as low risk
  • test/Polly.Extensions.Tests/Telemetry/TelemetryOptionsTests.cs: Evaluated as low risk
  • test/Polly.Extensions.Tests/Telemetry/TelemetryResiliencePipelineBuilderExtensionsTests.cs: Evaluated as low risk
  • src/Polly/Caching/CacheSyntax.cs: Evaluated as low risk

@codecov
Copy link

codecov bot commented Feb 19, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.22%. Comparing base (4469d83) to head (3de68b9).
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2514      +/-   ##
==========================================
+ Coverage   94.09%   94.22%   +0.13%     
==========================================
  Files         311      311              
  Lines        7431     7413      -18     
  Branches     1043     1038       -5     
==========================================
- Hits         6992     6985       -7     
+ Misses        342      335       -7     
+ Partials       97       93       -4     
Flag Coverage Δ
linux 94.22% <100.00%> (+0.13%) ⬆️
macos 94.22% <100.00%> (+0.13%) ⬆️
windows 94.21% <100.00%> (+0.13%) ⬆️

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

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

return services;
}

services.AddOptions();
Copy link
Member Author

Choose a reason for hiding this comment

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

The call to AddOptions<T>() on Line 258 does this under-the-hood.

Copy link
Member Author

Choose a reason for hiding this comment

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

The explicit interface implementations were just exact duplicates of the other implementations.

_registry = registry;
}

private ConcurrentDictionary<string, IsPolicy> ThrowIfNotConcurrentImplementation()
Copy link
Member Author

Choose a reason for hiding this comment

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

This is redundant if we just enforce that the test constructor creates a concurrent dictionary.

Add coverage highlighted as missing from the patch.
@martincostello martincostello marked this pull request as ready for review February 19, 2025 16:07
@martincostello martincostello enabled auto-merge (rebase) February 19, 2025 16:07
@martincostello martincostello merged commit 3cbe7a7 into main Feb 19, 2025
26 checks passed
@martincostello martincostello deleted the moar-coverage branch February 19, 2025 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI/build enhancement .NET Pull requests that update .NET code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant