Skip to content

Fix Polly.Testing mutations#2503

Merged
martincostello merged 2 commits intomainfrom
fix-mutations
Feb 15, 2025
Merged

Fix Polly.Testing mutations#2503
martincostello merged 2 commits intomainfrom
fix-mutations

Conversation

@martincostello
Copy link
Member

While working on #2500 I noticed that no mutations were being tested for Polly.Testing.

This fixes that by removing the ignore-mutations setting for that project, otherwise Stryker finds no ways to mutate the code and does nothing.

Once that was fixed, some additional changes were needed to get back to 100% mutations score for that project.

- Fix Polly.Testing mutation tests not returning any results.
- Kill surviving mutants to get 100%.
Use a new file when patching the Stryker configuration file to avoid editing the file in the Git tree.
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 3 out of 3 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (3)

test/Polly.Testing.Tests/ResiliencePipelineExtensionsTests.cs:22

  • Ensure that the error message 'pipeline' is clear and helpful. Consider adding a custom message to indicate that the pipeline parameter cannot be null.
Should.Throw<ArgumentNullException>(() => pipeline.GetPipelineDescriptor()).ParamName.ShouldBe("pipeline");

test/Polly.Testing.Tests/ResiliencePipelineExtensionsTests.cs:23

  • Ensure that the error message 'pipeline' is clear and helpful. Consider adding a custom message to indicate that the pipeline parameter cannot be null.
Should.Throw<ArgumentNullException>(() => pipelineGeneric.GetPipelineDescriptor()).ParamName.ShouldBe("pipeline");

src/Polly.Testing/ResiliencePipelineExtensions.cs:79

  • The line components.Add(tracking); was removed. This changes the behavior of the method by not adding ExecutionTrackingComponent to the components list. If this component is expected to be part of the list, this could lead to issues.
ExpandComponents(tracking.Component, components);

@codecov
Copy link

codecov bot commented Feb 15, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.36%. Comparing base (f58fcfb) to head (a817c7b).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2503   +/-   ##
=======================================
  Coverage   85.35%   85.36%           
=======================================
  Files         312      312           
  Lines        7465     7468    +3     
  Branches     1121     1121           
=======================================
+ Hits         6372     6375    +3     
  Misses        908      908           
  Partials      185      185           
Flag Coverage Δ
linux 85.36% <100.00%> (+<0.01%) ⬆️
macos 85.36% <100.00%> (+<0.01%) ⬆️
windows 85.32% <100.00%> (+<0.01%) ⬆️

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.

@martincostello martincostello marked this pull request as ready for review February 15, 2025 14:59
@martincostello martincostello merged commit 6a617ed into main Feb 15, 2025
24 checks passed
@martincostello martincostello deleted the fix-mutations branch February 15, 2025 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant