首页 文章

在VSTS构建仪表板中看不到任何测试结果

提问于
浏览
1

What I want :在VSTS的构建仪表板上,我通常可以看到我执行的测试结果的概述,如下所示:

enter image description here

What I got :我已经 Build 了一个新的Core 2.0版本,并且几乎采用了默认的构建配置:

enter image description here

All tests ran :我的构建日志报告所有测试都已执行(我的示例设置中有四个):

Build build,请稍候......构建完成 . 测试运行d:\ a \ 3 \ s *** . 测试\ bin \ release \ netcoreapp2.0 *** . Platform.Tests.dll(.NETCoreApp,Version = v2.0)Microsoft(R)测试执行命令Line Tool Version 15.3.0-preview-20170628-02 Copyright(c)Microsoft Corporation . 版权所有 . 开始测试执行,请等待...总测试:4 . 通过:4 . 失败:0 . 跳过:0 . 测试运行成功 . 测试执行时间:2.7625秒

My problem :构建仪表板没有显示任何测试结果:

enter image description here

Question :我做错了什么?

Failed to do this

  • 我按照建议"Enable automated tests in your build definition by adding the Visual Studio Test task."然而,这并没有改变一件事 .

  • 此处已在SO(TFS Build Test Results)讨论了类似的问题,但它没有解决我的具体问题 .

1 回答

  • 1

    在.NET Core Test任务的参数中指定-logger“trx”,以使用“发布测试结果”任务生成测试结果并发布测试结果 .

    • 添加删除文件任务(源文件夹: $(System.DefaultWorkingDirectory) ;内容: **/TestResults/**

    • 添加.NET核心测试任务(参数: --configuration $(BuildConfiguration) --logger "trx"

    • 添加发布测试结果任务(测试结果格式: VSTest ;测试结果文件: **\*.trx ;搜索文件夹: $(System.DefaultWorkingDirectory)

相关问题