-
-
Notifications
You must be signed in to change notification settings - Fork 52
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
Include inner exceptions when tests fail. #1327
Comments
This is actually a Testing Platform issue. I send an object to the testing platform with the raw exception on it. Since output is handled by either them, or the IDE, then they need to output it correctly. |
I did actually raise this on the testing platform a while back, but it should've been sorted and in the current release: microsoft/testfx#3783 Where are you looking at this output? CLI / VS / Rider? |
Interesting! I'm seeing this in Rider via the test explorer window. |
It might be a Rider issue then. I'm actually not sure if it's testing platform or rider to be honest! |
The CLI seems to show them properly. But Rider and VS don't. Not sure if both have issues or not. |
@Evangelink @nohwnd Do you happen to know? |
I'll double check VS behavior and what the platform sends and get back to you. |
I believe this is working fine on platform level. My MSTest code: [TestClass]
public class TestClass
{
[TestMethod]
public void Test3()
{
try
{
try
{
Throw();
}
catch (Exception ex)
{
throw new Exception("inner", ex);
}
}
catch (Exception ex)
{
throw new Exception("root", ex);
}
}
private void Throw() => throw new Exception("bottom");
} |
It shows in TUnit console too:
It doesn't in Rider, but since the CLI is fine, I'd go with it being a Rider issue |
I don't have contact on Rider side, do you have some @thomhurst? |
Not a specific contact, but I can raise on YouTrack and they can triage it |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
@thomhurst do you have a link to the Youtrack issue? Otherwise I can open one and this can probably be closed here. |
It would be helpful to include inner exceptions in the test failure if possible. I'm thinking like when using EF Core and you have a foreign key conflict, currently the library only spits out the following:
Of course, this can be waved away with hooking via after test and pulling it out but having it be baked in would be great.
The text was updated successfully, but these errors were encountered: