jenkinsci / allure-plugin

Allure Jenkins Plugin
https://plugins.jenkins.io/allure-jenkins-plugin/
Other
84 stars 63 forks source link

Generate live allure reports #282

Closed cr-omermazig closed 1 year ago

cr-omermazig commented 3 years ago

I want to have the ability to view some test results in an allure report BEFORE ALL the tests are done. So I parallelized the running of the test, and generating the allure results, like so:

parallel([
                            tests: {
                                stage('Tests') {
                                    try {
                                        ...
                                    }
                                    finally (err) {
                                        areTestsDone = true
                                        throw err
                                    }
                                }
                            },
                            AllureReport : {
                                stage("Allure report") {
                                    container('python') {
                                        sh """chmod -R o+xw ${params.testPath}/my_allure_results"""
                                    }
                                    while(!areTestsDone) {
                                        sleep 60
                                        script {
                                                   allure([
                                                           includeProperties: false,
                                                           jdk              : 'Java SE 8u141',
                                                           properties       : [],
                                                           reportBuildPolicy: 'ALWAYS',
                                                           results          : [[path: "${params.testPath}/my_allure_results"]]
                                                   ])
                                               }
                                   }
                                }
                            }
                        ])

This works, but my problem now is that it generates multiple allure reports:

enter image description here

enter image description here

Where what I aim to do is replace the allure report every time (to only have one for each build).

Is there a way to do that? Or is there a better way to have the allure report generated per-run?

rafaelmereb commented 1 year ago

Hi! Are there any updates on this topic? Is there a way to do publish and update the Allure report while the tests are still running?

vbragin commented 1 year ago

Hello @cr-omermazig Allure-report generates static report from files you provide. And plugin do the same.

If you want some realtime report maybe you can have a look on TestOps https://qameta.io/?

cheshi-mantu commented 1 year ago

@rafaelmereb Hi Rafael, this is working in the way you are setting it up, i.e. correctly. If you want to see the test results during the pipeline execution, then the Report tool is not a tool you need ti use. Your choice is Allure TestOps: https://www.youtube.com/playlist?list=PLINOSjry419nVTsmiQ4ACukWDioU4QK2R you'll achieve exactly you the stuff you need + history and capability to rerun tests from the report.