How to install nUnit 3 nunit3-console.exe in TeamCity 9.x

后端 未结 8 1063
没有蜡笔的小新
没有蜡笔的小新 2021-02-07 06:19

NUnit 3.0 is supported by TeamCity 9.1.x now however you have to install the runner and specify the path to the nunit3.console.exe in the step. My question is where do I copy t

8条回答
  •  感情败类
    2021-02-07 07:11

    Also building on @NikolayP's answer:

    NuGet currently supports the command line argument -ExcludeVersion for the install operation. From the docs:

    Installs the package to a folder named with only the package name and not the version number.

    This results in a path that is rather easy to use in a subsequent NUnit runner build step and allows to drop the clever workaround of @NathanAldenSr.

    As of TeamCity 2017.1.3 (and probably earlier versions), this feature is even exposed as a parameter for the NuGet Installer runner (see the Restore Options) but requires a solution path. The example below is suitable for a generic on-the-fly and transient installation of NUnit.

    For easy copy and paste (adjust the NUnit version to your requirements):

    • Executable: %teamcity.tool.NuGet.CommandLine.DEFAULT%\tools\nuget.exe
    • Parameters: install NUnit.Console -Version 3.7.0 -ExcludeVersion -OutputDirectory %system.teamcity.build.tempDir%\NUnit

提交回复
热议问题