-
-
Notifications
You must be signed in to change notification settings - Fork 84
Fix SkipTestException handling to properly mark tests as skipped #2907
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
Conversation
Co-authored-by: thomhurst <30480171+thomhurst@users.noreply.github.com>
Co-authored-by: thomhurst <30480171+thomhurst@users.noreply.github.com>
Claude finished @Copilot's task —— View job PR Code ReviewReviewing the SkipTestException handling fix and providing comprehensive feedback. Todo List:
Code Review Feedback✅ Positive AspectsCore Fix Quality: The fix in
Test Coverage: Good test coverage approach:
🔍 Code Quality AssessmentImplementation: The fix is minimal and surgical - exactly what's needed. The logic flow is:
This ordering is correct and prevents the skip exception from being caught by the generic failure case. Error Handling: Proper use of the existing result factory pattern maintains consistency with the codebase architecture. 🚫 No Significant Issues FoundBugs: No logical errors or edge cases identified. Performance: Zero performance impact - adds one type check in exception handling path. Security: No security concerns - this is defensive exception handling code. Thread Safety: Uses the same patterns as existing code, inheriting the same thread safety characteristics. 🔧 Minor Suggestions
📋 VerificationThe fix addresses all three call sites mentioned in the PR description:
🎯 Final AssessmentThis is a high-quality, focused fix that:
Recommendation: Approve - This PR successfully fixes the regression and restores proper |
Claude finished @Copilot's task —— View job PR Code ReviewReviewing the SkipTestException handling fix and providing comprehensive feedback. Todo List:
Code Review Feedback✅ Positive AspectsCore Fix Quality: The fix in
Test Coverage: Good test coverage approach:
🔍 Code Quality AssessmentImplementation: The fix is minimal and surgical - exactly what's needed. The logic flow is:
This ordering is correct and prevents the skip exception from being caught by the generic failure case. Error Handling: Proper use of the existing result factory pattern maintains consistency with the codebase architecture. 🚫 No Significant Issues FoundBugs: No logical errors or edge cases identified. Performance: Zero performance impact - adds one type check in exception handling path. Security: No security concerns - this is defensive exception handling code. Thread Safety: Uses the same patterns as existing code, inheriting the same thread safety characteristics. 🔧 Minor Suggestions
📋 VerificationThe fix addresses all three call sites mentioned in the PR description:
🎯 Final AssessmentThis is a high-quality, focused fix that:
Recommendation: Approve - This PR successfully fixes the regression and restores proper |
@claude [Claude Auto-Fix] Detected failed modularpipeline build (check run 48126053617). Please analyze the build failure at https://github.com/thomhurst/TUnit/actions/runs/16976317222/job/48126053617 and commit a fix for it. Instructions:
Focus on fixing only the build errors - do not make unrelated changes. |
Claude finished @Copilot's task —— View job PR Code ReviewReviewing the SkipTestException handling fix and providing comprehensive feedback. Todo List:
Code Review Feedback✅ Positive AspectsCore Fix Quality: The fix in
Test Coverage: Good test coverage approach:
🔍 Code Quality AssessmentImplementation: The fix is minimal and surgical - exactly what's needed. The logic flow is:
This ordering is correct and prevents the skip exception from being caught by the generic failure case. Error Handling: Proper use of the existing result factory pattern maintains consistency with the codebase architecture. 🚫 No Significant Issues FoundBugs: No logical errors or edge cases identified. Performance: Zero performance impact - adds one type check in exception handling path. Security: No security concerns - this is defensive exception handling code. Thread Safety: Uses the same patterns as existing code, inheriting the same thread safety characteristics. 🔧 Minor Suggestions
📋 VerificationThe fix addresses all three call sites mentioned in the PR description:
🎯 Final AssessmentThis is a high-quality, focused fix that:
Recommendation: Approve - This PR successfully fixes the regression and restores proper |
@claude [Claude Auto-Fix] Detected failed modularpipeline build (check run 48205300630). Please analyze the build failure at https://github.com/thomhurst/TUnit/actions/runs/17001967683/job/48205300630 and commit a fix for it. Instructions:
Focus on fixing only the build errors - do not make unrelated changes. |
When a test throws a
SkipTestException
, it should mark the test as skipped, but currently it's being marked as failed. This regression was introduced after version 0.25.21.The issue occurs in the
SingleTestExecutor.HandleTestFailure()
method, which treated all exceptions as failures without checking for special framework exception types.Example of the issue:
Before fix: Test is marked as ❌ Failed⚠️ Skipped
After fix: Test is marked as
Changes Made
Modified the
HandleTestFailure
method inSingleTestExecutor.cs
to properly handleSkipTestException
:SkipTestException
before the generic failure handlingtest.State = TestState.Skipped
_resultFactory.CreateSkippedResult()
with the exception's reasonHandleSkippedTestInternalAsync
This minimal change ensures that all three call sites of
HandleTestFailure
now properly handle skip exceptions:The fix maintains behavioral parity with the documentation which states that
SkipTestException
should result in skipped tests, not failed ones.Fixes #2904.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.