3
votes

While publishing NUnit report in Jenkin getting an exception "ERROR: Step ‘Publish NUnit test result report’ failed: Could not read the XSL XML file. Please report this issue to the plugin author". I am using

  1. .Net Core MVC App in C#
  2. NUnit project
  3. Jenkin
  4. Using command "dotnet test ".\WebApp2nUnit\WebApp2nUnit.csproj" --logger:"trx;logFileName=Report.xml"" in freestyle jenkin project.

Although build success along with I could see test result report is forming but at the time of publishing this report getting below exception. I am using the NUnit plugin to publish this. Provided is the compete error message:

Test Run Successful. Total tests: 3 Passed: 3 Total time: 5.3879 Seconds

C:\Program Files (x86)\Jenkins\workspace\WebApp2>exit 0 Recording NUnit tests results Error in NUnit processing: Could not transform the NUnit report. Please report this issue to the plugin author ERROR: Step ‘Publish NUnit test result report’ failed: Could not read the XSL XML file. Please report this issue to the plugin author Finished: FAILURE

Please suggest.

Nishant

1

1 Answers

3
votes

I added this package to my solution: https://www.nuget.org/packages/NunitXml.TestLogger/

Then the command used is:

  dotnet test folder/project.csproj --filter "TestCategory=category" --results-directory ./folder/ --test-adapter-path:. --logger:"nunit;LogFilePath=TestResult.xml"

and to publish:

  nunit testResultsPattern: 'folder/TestResult.xml'