1

I'm trying to run some unit tests using Final Builder Continua but nothing I try seems to work. I've configured a Unit test stage:

enter image description here

But everytime I run the build I get the error:

The expression ['$Agent.NUnit.3.0.Path$' exists] evaluated False

enter image description here

then the whole thing hangs. There are several issues reported on the final builder forums but the soliutions all relate to older versions or various other fixes none of which seem to apply to my situation.

I'm guessing it doesn't know where the NUnit console is. I have tried specifying the missing parameter in the build config for the agent: enter image description here

I've tried installing NUnit from nuget

nuget install nunit

Has anyone any experince of this or solutions to this issue?

I'm using continua 1.8.1.277

4

2 回答 2

2

It's not practical for Continua CI to know all possible installation locations for NUnit. If installed using NuGet then it will be installed under the current directory by default - this installation folder can be changed using the OutputDirectory parameter for NuGet.

Editing the property collector search path is not considered to be a hack - it is actually a recommended solution if you know the path of the executable.

Another equally valid solution would be to add the path to the executable to the PATH environment variable on your agent. As of v1.8.1.556, Continua CI will automatically pick up changes to the PATH variable without restarting agent service.

Note that the NUnit action also provides a option to install the executable using NuGet as part of the build:

Install NUnit on agent using NuGet option in NUnit action

Ticking the "Install NUnit on agent using NuGet" will show a NuGet tab allowing you to enter the NuGet install parameters.

enter image description here

You can also choose "Custom" in the Using drop-down. This allows you to specify the path to the executable to use for this action.

enter image description here

于 2017-10-12T00:57:06.527 回答
0

Simply by clicking in random places I noticed this under Property Collectors (No I don't know what this actually means):

enter image description here enter image description here

This seems to suggest that it will look in certain folders for Nunit (not where nuget installs them interestingly):

Finds the executable 'nunit3-console.exe' in any of the following locations '%PROGRAMFILES%\NUnit.org\nunit-console\, %PROGRAMFILES(x86)%\NUnit.org\nunit-console\, %PATH%'.

So I created a new folder in my program files and copies the required nunit3-console.exe etc. into it. I now no longer get the error.

Seems that edit allows your to (ahem) edit these paths. So a better solution is to add the path to NUnit into this variable:

enter image description here

于 2017-10-11T15:48:53.177 回答