无法从两个单独的Jenkins Maven版本生成统一的Allure报告 [英] Cannot generate unified Allure report from two separate Jenkins maven builds

查看:87
本文介绍了无法从两个单独的Jenkins Maven版本生成统一的Allure报告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想通过合并两个单独的Jenkins maven项目的结果来生成统一的报告(并且我读过Allure确实支持该功能-将结果合并到不同的allure-results文件夹中),但是它不能正常工作我会在下面解释.

I want to generate a unified report by merging the results from two separate Jenkins maven projects (and I've read that Allure does support that feature - to merge results different allure-results folders), but it does not work properly as I'll explain below.

我的目标是从我所有项目的所有测试结果中获得可见性.目前,我只能看到特定于项目的测试结果.

My objective is to have visibility from all tests results I've from all projects. Currently I can only see the test results specific to a project.

这是上下文:

我有两个Maven项目(用于 testNG )正在运行,并通过JENKINS的吸引力报告了结果.正如您在下面看到的,这两个版本的诱人结果均按预期工作-由Allure Jenkins插件版本2.26.0自动生成

I've two Maven projects (for testNG) running and reporting results via allure on JENKINS. As you can see below, the allure results from those two builds are working as expected - automatically generated by Allure Jenkins plugin version 2.26.0

Allure Jenkins插件可以很好地完成单独的Maven工作

现在,我还安装了Allure 2.6.0,并将其添加到系统PATH中,并正确配置ALLURE_HOME环境var.因此,当我在这里运行此命令时:引诱服务"C:\ Users \ tester \ workspace \ scripts-qa \ STF \ allure-results" –主机"127.0.0.1" –端口"8081"

Now I've also installed the Allure 2.6.0 and added it on system PATH and properly configure ALLURE_HOME environment var. So when I ran this command here: allure serve "C:\Users\tester\workspace\scripts-qa\STF\allure-results" --host "127.0.0.1" --port "8081"

如下面所示,它非常适合从IntelliJ报告我的诱惑力结果中的结果.

It works perfectly to report the results in my Allure-results from my IntelliJ, as you can see below.

从我的本地工作空间吸引的结果

现在,当我运行与上一个命令类似的命令以合并两个我在詹金斯获得的报告时,生成统一报告-只是填充了执行趋势-但是测试总数及其详细信息并没有显示在下面.这是我正在执行以生成统一报告的命令:魅力服务<代码>"C:\ Users \ tester \ .jenkins \ workspace \ Regression2 \ allure-report""C:\ Users \ tester \ .jenkins \ workspace \ Regression1 \ allure-report"-主机"127.0.0.1"--port" 8081"

Now when I ran similar command as above one to generate a unified report by merging both reports I got in Jenkins - just the execution trend is been populated - but the total number of tests and its details are not as you can see below. This is the command I'm executing to generate a unified report: allure serve "C:\Users\tester\.jenkins\workspace\Regression2\allure-report" "C:\Users\tester\.jenkins\workspace\Regression1\allure-report" --host "127.0.0.1" --port "8081"

尝试合并来自两个单独的jenkins项目的报告时的吸引力问题

能否请您帮我弄清楚这里出了什么问题?诱人的二进制文件可能无法提供诱人的Jenkins插件生成的结果吗?如果是,该如何解决?

Could you please help me to figure out what is wrong here? Is that possible that allure binary cannot serve results generated by allure Jenkins plugin? If yes, what is the work around to fix that?

谢谢!!吉恩.

推荐答案

我可以看到您正在尝试从已经生成的报告中生成累积报告,这是不正确的-魅力需要原始的魅力结果生成报告

I can see that you are trying to generate cumulative report from already generated reports, which is not correct - Allure needs raw allure-results to generate report

作为解决方法,您需要

  1. 为每个测试执行作业归档 allure-results ,并将其附加为工件以构建
  2. 复制魅力结果工件
  3. 解压缩
  4. 基于工件的魅力结果构建报告
  1. Archive allure-results for each test execution job and attach it to build as artifact
  2. Copy allure-results artifacts
  3. Unzip it
  4. Build a report based on allure-results from artifacts

下面是管道作业的代码段

Below are code snippets for Pipeline job

魅力结果附加为伪像:

zip archive: true, dir: "target/allure-results", glob: '', zipFile: "allure-results.zip"

将人工制品复制到另一份工作:

Copy artefacts to another job:

copyArtifacts filter: 'allure-results.zip', optional: true, projectName: "Regression1", selector: lastCompleted(), target: "Regression1"
unzip dir: "Regression1", glob: '', zipFile: "Regression1/allure-results.zip"
...

构建报告

allure serve Regression1 Regression2

这篇关于无法从两个单独的Jenkins Maven版本生成统一的Allure报告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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