Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jenkins NUnit report file not found

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.

like image 210
MrPug Avatar asked Oct 19 '22 17:10

MrPug


2 Answers

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.

like image 100
devowiec Avatar answered Nov 02 '22 07:11

devowiec


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.

like image 37
Andrey Zakharov Avatar answered Nov 02 '22 07:11

Andrey Zakharov