Azure DevOps:缺少用于绿色测试的控制台输出 [英] Azure DevOps: Console output for green tests is missing

查看:91
本文介绍了Azure DevOps:缺少用于绿色测试的控制台输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们将NUnit测试执行从TeamCity迁移到了Azure DevOps.迄今为止最大的问题之一-无法查看绿色(通过)测试的控制台输出. DevOps确实缺少此基本功能,还是我根本不知道在哪里看?

We migrated our NUnit tests execution from TeamCity to Azure DevOps. One of the biggest issues so far - there is no way to see Console output for green (passed) tests. Is this basic feature really missing in DevOps, or I simply do not know where to look?

以下是查看控制台输出以进行失败测试的方法:

Here is how to view Console output for failed tests:

更新: 在文档中有一个提示"(

UPDATE: In the documentation there is a "Tip" (https://docs.microsoft.com/en-us/azure/devops/pipelines/test/review-continuous-test-results-after-build?view=azure-devops):

如果使用Visual Studio Test任务运行测试,则诊断输出 从测试记录(使用Console.WriteLine,Trace.WriteLine或 TestContext.WriteLine方法),将作为附件 测试失败.

If you use the Visual Studio Test task to run tests, diagnostic output logged from tests (using any of Console.WriteLine, Trace.WriteLine or TestContext.WriteLine methods), will appear as an attachment for a failed test.

文本明确指出测试失败".看起来确实没有办法(没有简便方法)查看非失败测试的控制台输出,这非常令人沮丧.

Text explicitly states "for a failed test". Looks like there is indeed no way (no easy way) to see Console output for non-failed tests, which is very discoureging.

推荐答案

是的,看起来这确实是DevOps中缺少的功能.

So yes, it does look like this is a missing feature in DevOps.

我们可以想到的(唯一的?)解决方法是将所有控制台输出写入日志文件...然后将该日志文件作为附件添加到测试的TearDown方法中:

The (only?) workaround we could come up with was to write all our Console outputs to a log file... And then adding this log file as an attachment in test's TearDown method:

TestContext.AddTestAttachment(testLogs);

这篇关于Azure DevOps:缺少用于绿色测试的控制台输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆