-
-
Notifications
You must be signed in to change notification settings - Fork 108
Fix OverrideResult skip reason not being displayed #4264
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
When OverrideResult is called with TestState.Skipped and a reason, the reason was not being reflected in test output. The code was only checking test.Context.SkipReason but not the OverrideReason from the overridden result. Updated TestCoordinator to check OverrideReason when the result is overridden to Skipped. Co-authored-by: thomhurst <30480171+thomhurst@users.noreply.github.com>
There was a problem hiding this 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 a bug where calling OverrideResult(TestState.Skipped, "reason") would ignore the provided reason and display "Skipped" instead of the custom message. The fix adds logic to check the OverrideReason property when reporting skipped tests, falling back to the default "Skipped" message only if no override reason is available.
Key Changes:
- Modified skip reason resolution logic to prioritize
SkipReason→OverrideReason(if overridden) → default "Skipped" message
Comments suppressed due to low confidence (1)
TUnit.Engine/Services/TestExecution/TestCoordinator.cs:307
- This foreach loop implicitly filters its target sequence - consider filtering the sequence explicitly using '.Where(...)'.
foreach (var dependency in test.Dependencies)
{
if (collected.Add(dependency.Test.Context.Metadata.TestDetails))
{
CollectAllDependencies(dependency.Test, collected, visited);
}
}
OverrideResult(TestState.Skipped, "reason")ignores the provided reason and displays "Skipped" instead.Changes
TestCoordinator.cs: When reporting skipped tests, checkOverrideReasonfrom overridden results before falling back to "Skipped"The skip reason resolution order is now:
SkipReason→OverrideReason(if overridden) →"Skipped"Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.