诱惑力-结果在詹金斯身上是不存在的 [英] allure-results does not exists in Jenkins

查看:26
本文介绍了诱惑力-结果在詹金斯身上是不存在的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Allure结果是生成的(Xmls),并且可以通过在allure-result目录之外运行allure service来查看,但在Jenkins中使用魅力结果目录和Jenkins工作区的相对路径进行配置时,将找不到诱惑力结果。路径可能有问题

[ALURE_TEST]$/Users/me/.jenkins/tools/ru.yandex.qatools.allure.jenkins.tools.AllureCommandlineInstallation/Allure_2.7.0/bin/allure生成-c-o/Users/me/.jenkins/workspace/allure_test/allure-report 诱惑力-结果不存在 已成功生成到/Users/me/.jenkins/workspace/allure_test/allure-report的报告 诱惑力报告已成功生成。

为诱惑力报告定义的相对路径为
../../repos/partner-portal/target/allure-results

报告已生成,但没有结果

推荐答案

我们在UI上不使用任何生成后步骤,而是使用jenkins管道groovy脚本,如下所示:

def allureReportsGenerationTask() {
try {
allure([includeProperties: false, jdk: '', properties: [], reportBuildPolicy: 'ALWAYS', results: [[path: 'target/allure-results']]])
} catch(Exception error) {
println("Caught Exception: ${error}")
}
}

项目结构只是这样

 ProjectRepo
       - src
       - target
         -alure-results 
       - pom.xml 
       - testng.xml

在本例中,我们得到了生成的诱惑力结果,但是在Jenkins管道诱惑力插件中没有选择它。在UI上,以下命令始终在运行

/opt/jenkins/tools/ru.yandex.qatools.allure.jenkins.tools.AllureCommandlineInstallation/allure/bin/allure generate -c -o /opt/jenkins/workspace/ProjectRepoPipeline/allure-report

您可以看到,Jenkins在上面的Jenkins管道命令中找不到用于生成参数的诱饵结果

我们在pom.xml maven-surefire-plugin中添加了以下参数

   <systemPropertyVariables>
    <allure.results.directory>../target/allure-results</allure.results.directory>
     </systemPropertyVariables>

现在项目结构变为

-项目报告 -服务器 -pom.xml -testng.xml

  • 目标 -诱惑力-结果

现在,在运行相同的Via管道脚本时,我们可以运行以下命令

/opt/jenkins/tools/ru.yandex.qatools.allure.jenkins.tools.AllureCommandlineInstallation/allure/bin/allure generate /opt/jenkins/workspace/ProjectRepoPipeline/target/allure-results -c -o /opt/jenkins/workspace/ProjectRepoPipeline/allure-report

ProjectRepoPipeline-这是运行CI/CD的Jenkins管道名称

这篇关于诱惑力-结果在詹金斯身上是不存在的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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