首页 > 解决方案 > 如何在多模块项目中创建魅力报告

问题描述

我能够在单个模块级别为我的自动化测试创建魅力报告,并且在本地工作正常,但这似乎不适用于所有模块作为管道的一部分运行的 Jenkins,我猜詹金斯无法找到汇总的魅力报告在项目目录级别。有没有办法处理/解决这个问题?任何建议表示赞赏。

在此处输入图像描述

在 Jenkins 上附加了一个空报告并读取日志 - $ /opt/fsroot/tools/ru.yandex.qatools.allure.jenkins.tools.AllureCommandlineInstallation/2.13.1/bin/allure generate -c -o /opt/fsroot/ workspace/Flow/~ / - -tests/allure-report allure-results 不存在报告成功生成到 /opt/fsroot/workspace/Flow/~ / - -tests/allure-report 成功生成报告。

标签: jenkinsjenkins-pipelineallure

解决方案


You can always manually copy results from your modules to the project's root if the core plugin functionality doesn't work for you for some reason. Here's a Gradle example. But you can do the same for the Maven project as well.

tasks.register<Copy>("copyApiResults") {
    from("${projectDir}/api/build/allure-results")
    into("${buildDir}/allure-results")
}

tasks.register<Copy>("copyUiResults") {
    from("${projectDir}/ui/build/allure-results")
    into("${buildDir}/allure-results")
}

推荐阅读