【问题标题】:Jenkins pipeline script nunit cosole to publish junit reportJenkins 管道脚本 nunit cosole 发布 junit 报告
【发布时间】:2019-05-06 06:32:44
【问题描述】:

在 jenkins 中,我们使用的是包含大量代码的管道脚本。在那段代码中,我试图生成 junit 报告并将其发布在 jenkins 中。
我第一次尝试在詹金斯发布 junit 报告。不知道我需要在 jenkins 中显示我的报告是什么。
当我单击CONFIGURE->PIPELINE 选项卡时,我只有管道脚本,并且没有在此处添加任何构建步骤的选项。我的项目不是免费管道,但有管道语法,我可以添加 Junit 发布 Junit 测试结果报告。单击生成管道脚本后,我看到 / junit '.*Report'/
我想将此添加到我的单元控制台命令中以在 jenkins 中显示 junit 报告。

Q1)我在 jenkins 中显示 junit 报告时缺少什么?
Q2) 是否必须在管道选项卡中添加 Junit 插件才能在 jenkins 中显示报告-但我在 jenkins 中没有看到这些选项以及对当前项目的限制。

stage('RUN UTEST')
bat""" cd project//Types//NUnit.Runners2.6.4//Commands 
nunit-console..//Tests/bin//Unit.dll /include:Unit /xml=Report.xml;[transform=nunit3-junit.xslt]

【问题讨论】:

    标签: .net jenkins junit jenkins-pipeline nunit-console


    【解决方案1】:

    你需要在你的管道中调用 junit

    stage('RUN UTEST')
    bat""" cd project//Types//NUnit.Runners2.6.4//Commands 
    nunit-console..//Tests/bin//Unit.dll /include:Unit /xml=Report.xml;[transform=nunit3-junit.xslt]
    """
    junit '**/Report.xml'
    

    【讨论】:

    • 脚本执行的测试用例通过。我可以看到输出通过/失败测试用例和 jenkins 构建成功,但我没有看到任何已发布的报告。
    • 您的报告(路径)在哪里,文件名是什么?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-10-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-11-24
    相关资源
    最近更新 更多