我正在使用 NUnit.Framework 来测试我的 .NET Framework 项目。我想通过 GitHub Actions 运行我的测试。
yml 文件:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: '3.0.x'
- name: Setup MSBuild Path
uses: microsoft/setup-msbuild@v1
- name: Build
run: msbuild.exe .\CalcStatistics\CalcStats\CalcStats.sln
- name: Setup VSTest and add to PATH
uses: darenm/Setup-VSTest@v1
- name: Run VSTest
id: run_vstest
run: vstest.console.exe .\CalcStatistics\CalcStats\CalcStatsTests\bin\Debug\CalcStatsTests.dll /Platform:x64
作为回应,我得到:没有可用的测试。
我尝试使用以下命令通过 MsBuild 运行测试:
run:& "$(vswhere -property installationPath)\Common7\IDE\MSTest.exe" /testcontainer:.\CalcStatistics\CalcStats\CalcStatsTests\bin\Debug\CalcStatsTests.dll
I'm receive the same notification that no tests is available.
- 安装 NuGet 包NUnit.ConsoleRunner
- 删除步骤“设置 VSTest 并添加到 PATH”(不必要)
- 像这样改变你的步骤“运行 VSTest”
run: packages\NUnit.ConsoleRunner.3.12.0\tools\nunit3-console.exe TestProject\bin\Debug\TestProject.dll
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)