-
Notifications
You must be signed in to change notification settings - Fork 213
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
Clarification on if there is support for NUnit? #98
Comments
Hi! Yes it's supported. You just need to get results in For example like this: |
Hi Michal! Oh, I see now, thank you! Our tests use Unity Test Framework to generate NUnit3 XML files. Unfortunately, it only allows exporting in that format. Rereading the docs again it is pretty clear that the support is for a combination of .NET/NUnit and not NUnit alone. 👍 This looks really great though, nice work! |
Adding support for another XML format is not so hard. |
@dorny I have moved build of several old .NET Framework project to GitHub, and runs NUnit Console Runner directly. I have not found a way for NUnit alone to generate results in TRX, neither any way to transform the default XML to TRX. If you were to implement support for NUnit XML directly this would be great 😃👍 |
I got a workaround solved as follows: - name: Install NUnit
run: |
nuget install NUnit.Console -Version 3.12.0
- name: Fetch transform code
run: |
wget https://raw.githubusercontent.com/nunit/nunit-transforms/master/nunit3-junit/nunit3-junit.xslt
shell: bash
- name: Transform NUnit3 to JUnit
run: |
Get-ChildItem . -Filter test-results_*.xml | Foreach-Object {
$xml = Resolve-Path $_.FullName
$output = Join-Path ($pwd) ($_.BaseName + '_junit.xml')
$xslt = New-Object System.Xml.Xsl.XslCompiledTransform;
$xslt.Load("nunit3-junit.xslt");
$xslt.Transform($xml, $output);
}
shell: pwsh
- uses: dorny/test-reporter@v1.4.2
with:
name: "NUnit tests for $1"
path: "*_junit.xml"
reporter: jest-junit You can see the current working workflow at https://github.com/HalcyonGrid/halcyon/blob/master/.github/workflows/test-report.yaml |
Thanx @kf6kjg 😀👍 I was not aware of the nunit-transforms library, and it worked great. For future notice for anyone else reading this: I am running nunit3-console.exe yourTestLib.dll --result="nunit3-junit-testresults.xml;transform=nunit3-junit.xslt" I also got an error It worked after switching parser to java-junit (even though it looks like the stack traces from failed tests are missing): reporter: java-junit |
Excellent. In my case the generation of the xml was split into a different workflow than the analysis of it. Since I prefer that the untransformed file be placed in the artifact storage, I chose to not use the built in transform utility. |
@Gakk Could you please upload somewhere the TRX or NUnit XML where you got the Anyway, I see there is some demand for NUnit support. |
@dorny, thanks for the attention and work you are putting into this 👍 The NUnit have an option to output to I have added a more detailed comment regarding My result file that ends with the If you have time to implement support for the native NUnit3 test result format that would be great 😃👍 |
Is NUnit XML native support still in the works? |
I'm curious about this, any updates? I can't get NUnit3 XML to work |
Hi!
In the README summary, it lists NUnit support, but under the supported formats section I do not see an NUnit option.
Can you clarify if there is NUnit support? Thank you!
The text was updated successfully, but these errors were encountered: