teamcity - 使用 NUnit 3 时,为什么我在 TeamCity 9 上收到 "File type is not supported"?

标签 teamcity nunit-3.0 nunit-console

我正在使用 TeamCity Enterprise 9.1.5(内部版本 37377)。

我已经创建了一个构建配置。

我创建了一个 NUnit 构建步骤。

对于 NUnit Runner,我选择了 NUnit 3 .

对于 NUnit Console Runner 的路径,我输入了:packages\NUnit.ConsoleRunner.3.7.0\tools\nunit3-console.exe
在我的 Visual Studio 解决方案中,我安装了 NUnit.Runner 包。

当我运行构建配置时,我在日志中收到以下错误:File type is not supported
如何让我的 NUnit 测试在 TeamCity 中运行?

最佳答案

什么对我有用:

我卸载了 NUnit.Runner 并安装了以下软件包:

  • NUnit.ConsoleRunner
  • NUnit.Extension.NUnitProjectLoader
  • NUnit.Extension.TeamCityEventListener(不确定是否需要)

  • 为什么会产生错误?

    The ConsoleRunner can't handle .nunit files. That ability is part of NUnit.Extension.NUnitProjectLoader.扩展所在的目录需要作为 .addins 文件的一部分列出。 (我找不到找到该信息的 GitHub 链接。)

    我如何排除故障:

    TeamCity 生成了一个 .nunit 文件。我将该文件从代理复制到我的开发机器以进行故障排除并自己运行 nunit3-console.exe。一旦它在我的开发机器上运行,TeamCity 也能运行。

    关于teamcity - 使用 NUnit 3 时,为什么我在 TeamCity 9 上收到 "File type is not supported"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47635611/

    相关文章:

    active-directory - 查询 Active Directory/LDAP,查找嵌套组织单元中的用户

    maven - 无法解析 org.apache.maven.plugins :maven-clean-plugin:2. 4.1 的插件描述符

    teamcity - 在 TeamCity 中实现 "all except"权限

    nunit-3.0 - NUnit 3.0 控制台不适用于 "include"参数

    c# - 如何对依赖于 HttpContext.GetGlobalResourceObject 的类进行单元测试?

    msbuild - 升级后 NUnit 在 MSBuild 中运行失败 - System.IO.FileLoadException : Could not load file or assembly nunit. 框架

    c# - 使用 nunit 控制台传递测试用例参数

    c# - TeamCity 构建失败,因为子进程以非零退出代码退出

    macos - 在命令行上更新 nunit-console

    c# - 处理 NUnit 测试之间共享的单例实例