-
Notifications
You must be signed in to change notification settings - Fork 15
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
methodformat always includes namespace and class name regardless of setting #30
Comments
@moly I couldn't repo this so far and I probably need more detail. First, could you confirm you are on 2.1.78. Assuming that doesn't help, I think a csproj file and a test class would help a lot. I'm wondering if the reason I couldn't repo this is due to your exact framework / dependencies. Also, I haven't seen a test name rendered like Also, could you confirm you aren't getting any warnings from the logger in the console output for your tests about being unable to parse names? Thanks |
@Siphonophora The project was created with the latest dotnet using If I run I get: <?xml version="1.0" encoding="utf-8"?>
<testsuites>
<testsuite name="sampleproject.test.dll" tests="1" skipped="0" failures="0" errors="0" time="0.0021342" timestamp="2020-10-08T09:22:09" hostname="UKONG-NB0022" id="0" package="sampleproject.test.dll">
<properties />
<testcase classname="sampleproject.test.json.layers.UnitTest1" name="sampleproject.test.json.layers.UnitTest1.sampleproject.test.json.layers.UnitTest1.Test1" time="0.0021342" />
<system-out>[xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.4.0 (64-bit .NET Core 3.1.8)
[xUnit.net 00:00:00.64] Discovering: sampleproject.test
[xUnit.net 00:00:00.68] Discovered: sampleproject.test
[xUnit.net 00:00:00.68] Starting: sampleproject.test
[xUnit.net 00:00:00.76] Finished: sampleproject.test
</system-out>
<system-err></system-err>
</testsuite>
</testsuites> The full namespace and class name is duplicated in the |
@moly Great. I will take a look. |
Any updates on this? |
Hi, were working on the v3 release now, and I will take a look at this as part of that release |
Currently struggling with the same issue. I'm on version 3.0.98 |
@moly, @CoskunSunali, @IshakAtLEGO Are all of you using xUnit? The repro that moly provided, did give an example of MethodFormat not working correctly. On mstest we are getting the expected behavior: <!-- MethodFormat=Default-->
<testcase classname="JUnit.Xml.TestLogger.NetFull.Tests.FailingOneTimeSetUp"
name="TestA" time="0.0000001">
<!-- MethodFormat=Class-->
<testcase classname="JUnit.Xml.TestLogger.NetFull.Tests.FailingOneTimeSetUp"
name="FailingOneTimeSetUp.TestA" time="0.0000001">
<!-- MethodFormat=Full-->
<testcase classname="JUnit.Xml.TestLogger.NetFull.Tests.FailingOneTimeSetUp"
name="JUnit.Xml.TestLogger.NetFull.Tests.FailingOneTimeSetUp.TestA" time="0.0000001">
|
@Siphonophora I’m using xUnit. |
I am also using xUnit. |
We have a fix for this published on MyGet https://www.myget.org/feed/spekt/package/nuget/JunitXml.TestLogger/3.0.102 If you get a chance to test it, let me know if this resolves your issue. |
This has fixed the issue. I assume that this will be available on Nuget as well? |
Great. Yes it will. I have a fix for one other issue that's about to get merged, and we will release both together. I will comment here when its on NuGet |
@moly this is on nuget now in 3.0.110. |
Hello! I am wondering if it was possible to add the old, "buggy" option back now😁 We've been publishing test reports generated by junit.testlogger to our requirements management software (RMS). The integration was based on test case name and is now broken with the latest upgrade. How it's used to work:
Testlogger used to produce the following result that was parsed by our RMS I guess VS unit testing was publishing the name from TestMethod attribute. And now naturally it's this, and we can't link it to RMS anymore So, we'd really appreciate if we could publish TestResultInfo.Name again, as a testcase name or anyhow, can this be considered for the future versions @Siphonophora? Thank you! |
Update fixed the issue for me. I am using xunit as well. |
@tamaratomilova Cannot you just use the |
Nope. As per readme, MethodFormat Full will add the assembly/namespace/class to the test method name, while I need the test method name to be populated from TestMethod attribute instead of the actual method name. Different thing. |
I'm using junit.testlogger 2.1.78 and dotnet 3.1.402.
I have a test class called
LayerConverterTest
in a directorytest/MyProject.Test/Json
. It's namespace isMyProject.Test.Json
If I run
dotnet test --no-build --logger:"junit;LogFilePath=..\artifacts\{assembly}-test-result.xml;MethodFormat=Default;FailureBodyFormat=Verbose"
The resulting report wrongly includes the full namespace and class in the name attribute.
If I change the method format and run
dotnet test --no-build --logger:"junit;LogFilePath=..\artifacts\{assembly}-test-result.xml;MethodFormat=Full;FailureBodyFormat=Verbose"
The resulting report includes the namespace and class name twice.
The text was updated successfully, but these errors were encountered: