Fix DependsOn tests to be skipped instead of failed when dependencies fail#2706
Fix DependsOn tests to be skipped instead of failed when dependencies fail#2706
Conversation
|
@copilot Would it not be simpler to just do something like: |
... You're right, that would be much simpler! I can see how using exception handling would be cleaner than the current pre-checking approach. Just to clarify the approach you're suggesting:
I can implement this approach if you can point me to where the dependency failure detection should happen, or if I should create a new mechanism for it. The current implementation is definitely more complex than needed with all the dependency matching logic.
... I've implemented your suggested exception-based approach! Changes made:
The implementation maintains the same behavior (failed dependencies cause tests to be skipped when Commit: c4d95ca |
c4d95ca to
dcfb54a
Compare
|
@claude Review this |
|
Claude finished @thomhurst's task —— View job PR Review: Fix DependsOn tests to be skipped instead of failed when dependencies failReview Tasks:
Overall Assessment: ✅ Excellent ImplementationThis PR successfully implements @thomhurst's suggested exception-based approach for dependency handling. The solution is clean, efficient, and follows established patterns in the codebase. 🎯 Key Strengths1. Clean Exception-Based Design
2. Comprehensive TestDependency Enhancement
3. Robust Source Generator Updates
4. Precise Dependency Logic
5. Correct Test Updates
🔍 Technical DetailsException Flow: The solution correctly implements the suggested pattern:
Dependency Matching: Uses existing Display Names: ✅ No Issues Found
🎉 ConclusionThis implementation perfectly addresses the original issue with a clean, maintainable solution. The exception-based approach suggested by @thomhurst significantly simplified the logic while maintaining full functionality. Recommendation: ✅ APPROVE - Ready to merge! |
|
@copilot Re-do this changes on the latest main |
Co-authored-by: thomhurst <30480171+thomhurst@users.noreply.github.com>
Co-authored-by: thomhurst <30480171+thomhurst@users.noreply.github.com>
…y handling Co-authored-by: thomhurst <30480171+thomhurst@users.noreply.github.com>
205b327 to
3400bf2
Compare
Previously, when a test had dependencies that failed and
ProceedOnFailurewasfalse(the default), the dependent test would be marked as Failed with anInconclusiveTestException. This was incorrect behavior - the test should have been Skipped instead.Problem
The issue occurred because the framework had no mechanism to check dependency failure status and properly skip dependent tests when
ProceedOnFailure = false.Solution
Enhanced TestDependency with ProceedOnFailure support:
ProceedOnFailureproperty toTestDependencyclassDependsOnAttribute.ToTestDependency()to transfer the propertyUpdated Source Generator:
GenerateTestDependencyto extractProceedOnFailurefrom attribute metadataException-based Dependency Checking:
TestDependencyExceptionfor cleaner dependency failure handlingSingleTestExecutorbefore test executionBehavior
The fix correctly handles these scenarios:
false(default)trueSkip message format:
"Dependency failed: {dependencyName1, dependencyName2, ...}"Testing
Updated engine test expectations for
DependsOnTestsWithoutProceedOnFailure:Fixes #2687.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.