nunit.testlogger icon indicating copy to clipboard operation
nunit.testlogger copied to clipboard

Log message to console: "Unable to parse the test name"

Open binarycow opened this issue 3 years ago • 7 comments

The following log messages are produced:

2021-11-22T23:55:39.7872697Z Xml Logger: Unable to parse the test name 'NetworkPrimitives.Tests.Common.CharExtensionTests.TestIsHex('"',False)' into a namespace type and method. Using Namespace='UnknownNamespace', Type='UnknownType' and Method='NetworkPrimitives.Tests.Common.CharExtensionTests.TestIsHex('"',False)'
2021-11-22T23:55:39.7882339Z Xml Logger: Unable to parse the test name 'NetworkPrimitives.Tests.Common.CharExtensionTests.TestIsHex('(',False)' into a namespace type and method. Using Namespace='UnknownNamespace', Type='UnknownType' and Method='NetworkPrimitives.Tests.Common.CharExtensionTests.TestIsHex('(',False)'
2021-11-22T23:55:39.7889575Z Xml Logger: Unable to parse the test name 'NetworkPrimitives.Tests.Common.CharExtensionTests.TestIsHex(')',False)' into a namespace type and method. Using Namespace='UnknownNamespace', Type='UnknownType' and Method='NetworkPrimitives.Tests.Common.CharExtensionTests.TestIsHex(')',False)'

I suspect it has to do with the usage of (, ), and "

binarycow avatar Nov 23 '21 00:11 binarycow

@binarycow Thanks for letting us know. I agree its probably the chars. I will take a look at it soon.

Siphonophora avatar Nov 23 '21 13:11 Siphonophora

@Siphonophora - Want me to leave my branch/PR (on my repo) open, so you can replicate/whatever? Or, am I free to close?

binarycow avatar Nov 26 '21 01:11 binarycow

@binarycow Fine to close it. I have a fix on the core testlogger library for this, waiting on a code review.

Siphonophora avatar Nov 26 '21 14:11 Siphonophora

@binarycow If you have time to test it, we have an updated version of this logger here: https://ci.appveyor.com/project/spekt/nunit-testlogger/builds/41685956/artifacts

Siphonophora avatar Nov 27 '21 14:11 Siphonophora

Hello, I came across this as I was looking to upgrade this package (related to: https://github.com/spekt/testlogger/issues/28).

I checked out the updated version there. Tests that have apostrophes in the test name are still unable to be parsed:

[TestCase("example1", TestName = "Customer's name")]
public void MyTest(
    string a
    ) { ... }

becha2 avatar Jan 19 '22 08:01 becha2

We've run into this too. For a huge number of test cases like this one:

 Xml Logger: Unable to parse the test name 'Namespace.Fixture.ValidSpecialCharacters("%",(file://c:\foo\ba{0}r\asdf, file:///c:/foo/ba{0}r/asdf))' into a namespace type and method. Using Namespace='UnknownNamespace' , Type='UnknownType' and Method='Namespace.Fixture.ValidSpecialCharacters("%",(file://c:\foo\ba{0}r\asdf, file:///c:/foo/ba{0}r/asdf))'

appel1 avatar Feb 09 '22 22:02 appel1

Potential fix in https://github.com/spekt/nunit.testlogger/pull/93

codito avatar Apr 03 '22 16:04 codito

Fix is released in 3.0.127.

codito avatar Jul 05 '23 06:07 codito