【问题标题】:How to show mbunit/gallio TestLog or Console output in Jenkins?如何在 Jenkins 中显示 mbunit/gallio TestLog 或控制台输出?
【发布时间】:2013-07-19 21:13:43
【问题描述】:

我正在使用 Gallio/MbUnit 框架进行 Web 测试,并且测试是从 Jenkins 启动的。我已经安装了 Gallio/MbUnit 插件,它正在发布 xml 报告。我试图找到一种在“测试结果”部分显示测试日志或控制台消息的方法,以便团队可以轻松读取失败,而不是深入研究任何失败的测试运行的“控制台输出”。

当我在本地机器上使用 Icarus 运行这些 Gallio/MbUnit 测试时,所有内容的格式都非常好,但使用 Jenkins 时就不那么好了。我想继续使用它并改进我们显示错误的方式。有什么建议吗?

对于失败的测试:

Failed

...MainMenuTests.AcctClaimsItems

Failing for the past 4 builds (Since Failed#128 )
Took 47 sec.
add description
Error Message

Expected value to be false.Actual Value : d:\Jenkins\jobs\...\workspace\WebTesting\Base\Helpers.cs:line 90d:\Jenkins\jobs\...\workspace\WebTesting\TigerEye\Tests\MainMenuTests.cs:line 329true
Stacktrace

   at WebTesting.Base.Helpers.Click(IWebDriver driver, IWebElement element) in 

来自原始控制台输出:

Start time: 4:21 PM
Initializing the runtime and loading plugins.
Verifying test files.
Initializing the test runner.
Running the tests.
[failed] Test WebTesting/MainMenuTests/AcctClaimsItems
Expected value to be false.
Found System.Web Exception after click to url 
.../Accounting/FETReport.aspx

Actual Value : true

   at WebTesting.Base.Click(IWebDriver driver, IWebElement element) in d:\Jenkins\jobs\...\workspace\WebTesting\Base\StaticHelpers.cs:line 90 at WebTesting...\Tests.MainMenuTests.AcctClaimsItems() in d:\Jenkins\jobs\...\workspace\WebTesting\TigerEye\Tests\MainMenuTests.cs:line 329

代码:

if (driver.PageSource.Contains("System.Web - Exception"))
{
    TestLog.Write("Found exception on page {0}", driver.Url);
    TestLog.Write(driver.PageSource.ToString());
    Console.Write("Found exception on page {0}", driver.Url);
    Console.Write(driver.PageSource.ToString());
    Assert.IsFalse(driver.PageSource.Contains("System.Web - Exception"), "Found      System.Web Exception after click to url {0}",driver.Url);
}

【问题讨论】:

    标签: jenkins mbunit gallio remotewebdriver


    【解决方案1】:

    有一个通用控制台解析插件,您可以使用它来添加构建后步骤https://wiki.jenkins-ci.org/display/JENKINS/Log+Parser+Plugin

    【讨论】:

    • 我的测试日志没有显示/写入 Jenkins 正在显示/记录的控制台。
    猜你喜欢
    • 1970-01-01
    • 2015-01-04
    • 2014-03-30
    • 2016-02-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多