【发布时间】:2019-09-26 04:23:40
【问题描述】:
我在 .NET Core + NUnit.TestLogger 上有 NUnit 测试项目 (https://github.com/spekt/nunit.testlogger)
我通过 cmd 对本地机器或 teamcity 运行测试:
dotnet test --logger:nunit
我得到了预期的结果:
Results File: D:\<PATH TO MY SOLUTION>\Source\Tests\TestResults\TestResults.xml
但如果我通过 .NET CLI 在 Teamcity 上运行测试,则不会创建 TestResults.xml 文件。
为什么?
也就是说,如果我通过命令行运行 dotnet test,则会创建结果文件,如果通过 .NET CLI (dotnet test),则不会创建文件
UPD:构建日志
[13:48:22][Step 3/5] dotnet.exe test MySolution.sln --logger:"nunit" @C:\teamcity-agents\BuildAgent-1\temp\agentTmp\730f901563fb4fd9b8d130e76c50cb20.rsp
[13:48:22][Step 3/5] test (5s)
[13:48:22][test] Starting: "C:\Program Files\dotnet\dotnet.exe" test MySolution.sln --logger:"nunit" @C:\teamcity-agents\BuildAgent-1\temp\agentTmp\730f901563fb4fd9b8d130e76c50cb20.rsp
[13:48:22][test] in directory: C:\teamcity-agents\BuildAgent-1\work\21fca25db91ea807
[13:48:24][test] Build started, please wait...
[13:48:24][test] Build completed.
[13:48:24][test] Test run for C:\teamcity-agents\BuildAgent-1\work\21fca25db91ea807\Source\Tests\bin\Debug\netcoreapp2.1\MySolution.dll(.NETCoreApp,Version=v2.1)
[13:48:24][test] Microsoft (R) Test Execution Command Line Tool Version 15.9.0
[13:48:24][test] Copyright (c) Microsoft Corporation. All rights reserved.
[13:48:24][test]
[13:48:24][test] Starting test execution, please wait...
[13:48:25][test] NUnit Adapter 3.13.0.0: Test execution started
[13:48:25][test] Running all tests in C:\teamcity-agents\BuildAgent-1\work\21fca25db91ea807\Source\Tests\bin\Debug\netcoreapp2.1\MySolution.dll
[13:48:25][test] NUnit3TestExecutor converted 54 of 54 NUnit test cases
...
[13:48:27][test] Total tests: 52. Passed: 52. Failed: 0. Skipped: 0.
[13:48:27][test] Test Run Successful.
[13:48:27][test] Test execution time: 2,8774 Seconds
[13:48:27][test]
[13:48:27][test] Build succeeded.
[13:48:27][test] 0 Warning(s)
[13:48:27][test] 0 Error(s)
[13:48:27][test]
[13:48:27][test] Time Elapsed 00:00:03.96
[13:48:27][test]
[13:48:27][test] Process exited with code 0
【问题讨论】:
-
用引号试试:
--logger:"nunit" -
@Peska,我试过了,没有解决问题
-
没有更多的想法??
标签: teamcity nunit-3.0 dotnet-cli