首页 > 解决方案 > VS2017 解决方案有 17 个项目,其中 11 个是 NUnit 测试项目在 AppVeyor 中失败,无法获取远程进程代理错误

问题描述

我们正在 GitHub 上开发针对以下框架的 C# SDK:

<TargetFrameworks>net45;net451;net452;net46;net461;net462;net47;net471;net472;netstandard1.6;netstandard2.0</TargetFrameworks>

VS2017 解决方案包含 17 个项目,其中 11 个是测试项目。我们有重复的测试项目,以确保我们可以测试 .NET Framework 项目和 NetStandard。

由于我们添加了net471;472AppVeyor 无法再成功运行测试,我不断收到以下信息:

Unable to acquire remote process agent at NUnit.Engine.Runners.ProcessRunner.CreateAgentAndRunner() at NUnit.Engine.Runners.ProcessRunner.RunTests(ITestEventListener listener, TestFilter filter)

这是 AppVeyor 配置文件https://github.com/RHEAGROUP/CDP4-SDK-Community-Edition/blob/master/appveyor.yml的链接,这是 AppVeyor 项目本身https://ci.appveyor.com /project/samarhea/cdp4-sdk-community-edition

我怀疑问题是由于net471;net472,但更多是由于此解决方案中的项目数量。

一些有关如何配置 appveyor 以使构建再次成功的帮助将不胜感激。本地所有测试都通过了,我们没有同样的问题

提前感谢任何提示!

标签: appveyornunit-console

解决方案


经过一番谷歌搜索,我发现这个错误发生nunit在不同的场景中,而且通常是在测试数量变多的时候。我看到您尝试安装可以提供帮助的最新 NUnit 3.8.0,但是您这样做的方式并没有影响运行程序要求进行测试。请尝试将此install部分添加到您的 YAML 中,看看是否有帮助。

install:
- ps: |
    Write-Host "Installing NUnit 3.8.0..." -ForegroundColor Cyan -NoNewline
    $toolsPath = "$env:SYSTEMDRIVE\Tools"
    $nunitPath = "$env:SYSTEMDRIVE\Tools\NUnit3"
    Remove-Item $nunitPath -Recurse -Force
    $zipPath = "$($env:TEMP)\NUnit.Console-3.8.0.zip"
    (New-Object Net.WebClient).DownloadFile('https://github.com/nunit/nunit-console/releases/download/3.8/NUnit.Console-3.8.0.zip', $zipPath)
    7z x $zipPath -y -o"$nunitPath" | Out-Null
    del $zipPath
    $zipPath = "$($env:TEMP)\Appveyor.NUnit3Logger.zip"
    (New-Object Net.WebClient).DownloadFile('https://www.appveyor.com/downloads/Appveyor.NUnit3Logger.zip', $zipPath)
    7z x $zipPath -y -o"$nunitPath\addins" | Out-Null
    Move-Item "$nunitPath\addins\appveyor.addins" "$nunitPath\appveyor.addins"
    del $zipPath
    Remove-Path "$nunitPath\bin"
    Add-Path "$nunitPath"
    Write-Host "NUnit 3.8.0 installed" -ForegroundColor Green

推荐阅读