Skip to content

Fix Code Coverage Tests #2928

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
May 30, 2025
Merged

Fix Code Coverage Tests #2928

merged 2 commits into from
May 30, 2025

Conversation

JimBobSquarePants
Copy link
Member

Prerequisites

  • I have written a descriptive pull-request title
  • I have verified that there are no overlapping pull-requests open
  • I have verified that I am following the existing coding patterns and practice as demonstrated in the repository. These follow strict Stylecop rules 👮.
  • I have provided test coverage for my change (where applicable)

Description

Our code coverage CI build was failing due to an introduced reliance on DebugSaveXX working correctly in all build environments.

Since we no longer run the coverage tests against PRs directly it's best just to remove the condition.

Copy link

@Copilot 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.

Pull Request Overview

This PR fixes failing code coverage tests by removing a conditional block that bypassed image saving when running under code coverage.

  • Removed early return conditions checking TestEnvironment.RunsWithCodeCoverage in DebugSave and DebugSaveMultiFrame methods.
  • Updated using statement syntax to the newer declaration style for improved consistency.
Comments suppressed due to low confidence (2)

tests/ImageSharp.Tests/TestUtilities/TestImageExtensions.cs:292

  • Confirm that the new using declaration syntax is supported in your project's targeted C# version and applied consistently across the codebase.
using Image<TPixel> debugImage = GetDebugOutputImageMultiFrame<TPixel>(...

tests/ImageSharp.Tests/TestUtilities/TestImageExtensions.cs:300

  • Ensure that the updated using declaration style is consistently used for resource management throughout the repository to avoid style discrepancies.
using Image<TPixel> referenceImage = GetReferenceOutputImageMultiFrame<TPixel>(...

@JimBobSquarePants JimBobSquarePants merged commit 4b29744 into main May 30, 2025
8 checks passed
@JimBobSquarePants JimBobSquarePants deleted the js/fix-codecov-ci branch May 30, 2025 00:19
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