Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

NUnit3 console runner not working when run as Command type Task

Bill McGowan July 16, 2017

Hi All,

I am using Bamboo 6.0.3. I have been trying to get my NUnit 3 tests to run using a Command type task (NOT an NUnit 3 runner task) which calls the nunit3-console.exe located in my packages folder but hard as I may try I haven't been able to get the tests to run and the build to succeed.

This is the snippet of the log before the NUnit Runner bombs out:

simple 17-Jul-2017 15:57:29 Starting task 'NUnit 3 Runner' of type 'com.atlassian.bamboo.plugins.scripttask:task.builder.command'
command 17-Jul-2017 15:57:29 Beginning to execute external process for build 'Feature Releases - 5.4.0 - Build Wesbite #39 (CONN-FEATURE0-JOB1-39)'\n ... running command line: \npackages\NUnit.ConsoleRunner.3.7.0\tools\nunit3-console.exe Services.Tests\bin\Release\Services.Tests.dll\n ... in: D:\Bamboo\xml-data\build-dir\CONN-FEATURE0-JOB1\n ... using extra environment variables: \nbamboo_planRepository_1_branch=5.4.0\nbamboo_planRepository_1_branch and so on...

And this Bamboo log snippet below is the next line but it just simply says failed with -1 return code...doesn't even mention what the problem is?

Failing task since return code of [packages\NUnit.ConsoleRunner.3.7.0\tools\nunit3-console.exe Services.Tests\bin\Release\Services.Tests.dll] was -1 while expected 0

I should point out that if I go and manually run the .exe above pointing to the same DLL, it runs successfully and I get the NUnit output in the TestResult.xml file.

The console runner executable is located in the packages folder of my .NET project and if I dive into the checkout directory on the build server the .exe is in packages\NUnit.ConsoleRunner.3.7.0\tools\nunit3-console.exe which is where I have Bamboo looking for the executable:

runner.PNG

 

And in the build plan I have the following in the Command task:

 

command.PNG

And the Services.Tests DLL i reference above also exists in the bin\Release folder so it's not that the DLL is missing.

Can anyone please provide any insight into what I am missing here?

Any help is much appreciated.

 

1 answer

0 votes
Cristiano Mariano
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 17, 2017

Hi Bill! How are you doing?

Usually, for Command type tasks, I use absolute paths. I have the Nunit executable in a specific folder in my build agent and point to it. Would you try this approach?

If your file must reside in the source code repository, I would try a Script type task. In Script tasks you can for sure use relative paths.

Hope this helps!

Thanks,

Cristiano

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events