3
votes

I run my NUnit tests on Jenkins but every time build step fails and i get this text:

Recording NUnit tests results FATAL: No NUnit test report files were found. Configuration error? Build step 'Publish NUnit test result report' marked build as failure Archiving artifacts Finished: FAILURE

It is actually caused by tests report files that cannot be found.

I added "Publish Nunit test result report" post-build action: "%WORKSPACE%\TestResults*.xml"

however jenkins cannot find it.

I checked if report file is created in my workspace and actually it is created in proper place so there should not be problem to read it.

Anyone knows how to solve this problem? I would be grateful for any help.

3
I think the NUnit plugin doesn't support environment variables in the file path. However, if the file is relative to the workspace, you should be able to omit %WORKSPACE%. - MaQy
I even tried with absolute path but it is still not working - MrPug

3 Answers

2
votes

I solve this problem by change file destination from absolute path C:\Build\TestResults\MyTest.xml to relative TestResults\MyTest.xml.

I think Nunit plugin use relative path. You can go into the tab Workspace in your job and find this xml, then just copy path with your xml.

1
votes

Can you try?

nunit testResultsPattern: 'TestResults.xml'

(without asterisk character) By default nunit xml is saved in the same directory as your Jenkins build project.

-1
votes

As an alternative,

I am successfully using NUnit3 with the Jenkins NUnit plugin, by running the tests using a command line that includes: format=nunit2

Read more here