Skip to content

Test has passed however Reason with an empty message is printed in the xml #1896

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

Closed
psandhu79 opened this issue Nov 9, 2016 · 12 comments
Closed

Comments

@psandhu79
Copy link

psandhu79 commented Nov 9, 2016

       <test-case id="0-2262" name="TestPickedPoint" fullname="A.B.C.TestPickedPoint" methodname="TestPickedPoint" classname="A.B.C" runstate="Runnable" seed="978314103" result="Passed" start-time="2016-11-08 15:28:16Z" end-time="2016-11-08 15:28:16Z" duration="0.010144" asserts="1">
                    <properties>
                      <property name="Category" value="SmokeTest" />
                    </properties>
                    <reason>
                      <message><![CDATA[]]></message>
                    </reason>
                  </test-case>

This when imported into TeamCity reports a failure

@rprouse
Copy link
Member

rprouse commented Nov 9, 2016

The fact that TeamCity reports a passed test as a failure is a problem that should be fixed there. @NikolayPianikov any comments on that? What about Assert.Pass("Message")?

@psandhu79 can you give us a code example of a test that displays an empty message?

@rprouse rprouse added the confirm label Nov 9, 2016
@psandhu79
Copy link
Author

@rprouse Thank you looks like a bug in TeamCity found this
https://youtrack.jetbrains.com/issue/TW-15717

However the tests pass in Nunit 2 for teamcity and fail in Nunit 3 i am guessing its a regression in the Nunit importer for the xml

@CharliePoole
Copy link
Member

Even if it is not the cause of the TC errror, NUnit should not be creating an empty reason element under any circumstance. We need to confirm whether this happens, and when, and fix it.

Based on the TC issue, it appears to happen when AssertPass is used. We should check out Assert.Pass both with and without a message.

@psandhu79
Copy link
Author

TC reports a failed test either with Assert.Pass() or Asset.Pass("No exception should occur until this point with current setup")

With a message the reason element contains the message

@CharliePoole
Copy link
Member

There should only be a reason element if there is a reason. Of course, TC should deal with it anyway, but we should fix our output as well.

@NikolayPianikov
Copy link
Member

@psandhu79 it looks like a bug in the TeamCity xml parser for NUnit. I will check it

@psandhu79
Copy link
Author

psandhu79 commented Nov 11, 2016

@NikolayPianikov could you please update this bug
https://youtrack.jetbrains.com/issue/TW-15717

If possible attached a new xml plugin and i can test we are using TC 10.0.2

@NikolayPianikov
Copy link
Member

@psandhu79 I can't reproduce this issue. Could you attach nunit xml report file?

@NikolayPianikov
Copy link
Member

@psandhu79 Looks like this issue was fixed in TeamCity 10.0.3
So try upgrading to this version

@cristobalito
Copy link
Contributor

I'll pick this one up - hopefully have a fix in the next few days.

@CharliePoole
Copy link
Member

Great! Looking forward to seeing it.

@rprouse
Copy link
Member

rprouse commented Jan 23, 2017

Fixed by #1955

@rprouse rprouse closed this as completed Jan 23, 2017
@rprouse rprouse added this to the 3.7 milestone Jan 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants