Github操作:将dotnet测试结果报告为注释

时间:2020-02-08 12:33:00

标签: .net .net-core continuous-integration github-actions dotnet-test

如果使用Azure Pipelines运行测试,则会在“检查”选项卡上获得一些不错的结果。

enter image description here

Github Actions是否有任何方法可以做到这一点,所以我们不必遍历控制台输出?

enter image description here

1 个答案:

答案 0 :(得分:4)

这是一种解决方案: https://github.com/microsoft/vstest/issues/2370#issuecomment-602233131

GitHub用户Tyrrrz使用GitHub Actions命令做了一个小的概念证明。这会将测试失败报告给GH Actions平台,让您在“批注”视图中查看它们,并导航到触发它的确切/文件。这不是“支持彩色输出”的确切解决方案,但可能解决了GitHub Actions无法很好地显示失败测试列表的潜在问题。

https://github.com/Tyrrrz/GitHubActionsTestLogger https://github.com/Tyrrrz/GitHubActionsTestLogger/runs/525594126?check_suite_focus=true