question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allure-results does not exists - cant change the result path

See original GitHub issue

I am using Allure 2.28.1 plugin for Jenkins via declarative pipeline as below. But I could not able to read allure reports. So reports seems generated below ~/workspace/selenium_tests@2/ApiTestAutomation/ApiHubTestAutomation/target but I could not able to change the path in script.

How can I change the allure path to read the reports from below path ? Or even if I use dir and specify the path, why allure ignore this path to generate reports ?

ubuntu@play-0:~/workspace/selenium_tests@2/ApiTestAutomation/ApiHubTestAutomation/target$ ls                                                                                            
allure-results  generated-test-sources  maven-status  surefire  surefire-reports  test-classes

[selenium_tests] $ /home/ubuntu/tools/ru.yandex.qatools.allure.jenkins.tools.AllureCommandlineInstallation/Allure_2.13.5/bin/allure generate -c -o /home/ubuntu/workspace/selenium_tests/allure-report
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
allure-results does not exists
Report successfully generated to /home/ubuntu/workspace/selenium_tests/allure-report
Allure report was successfully generated.
Creating artifact for the build.
Artifact was added to the build.

Here is what I tried

        steps {
            script {
                dir ('~/workspace/selenium_tests@2/ApiTestAutomation/ApiHubTestAutomation') {
                    allure([
                            includeProperties: false,
                            jdk: '',
                            properties: [],
                            reportBuildPolicy: 'ALWAYS',
                            results: [[path: 'target/allure-results']]
                    ])
                }
            }
        }
    }

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:25 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
fescobarcommented, Jan 21, 2022
1reaction
fescobarcommented, Sep 15, 2020

@semihural try doing this

ws allows you to create a custom workspace with the name that you want. Use ws when you generate the results and when you generate the report. In my case I’m creating a custom workspace named my-workspace. I’m using ws in every stage.

automation_repository = 'https://github.com/fescobar/allure-docker-service.git'
default_branch = 'master'
my_workspace = 'my-workspace'
pipeline {
    agent any
    options {
        disableConcurrentBuilds()
        buildDiscarder(logRotator(numToKeepStr: '10'))
    }

    stages {
        stage('Clone Project Testing Repository') {
            steps {
                ws(my_workspace){
                    cleanWs()
                    git(url: automation_repository, branch: default_branch)
                }
            }
        }

        stage('Run Tests') {
            steps {
                ws(my_workspace){
                    warnError('Unstable Tests') {
                        print('This stage should be use it to run tests generating allure-results directory')
                    }
                }
            }
        }

        stage('ALLURE') {
            steps {
                ws(my_workspace+"/allure-docker-api-usage/"){
                    script {
                            allure([
                                includeProperties: false,
                                jdk: '',
                                properties: [],
                                reportBuildPolicy: 'ALWAYS',
                                results: [[path: "allure-results-example"]]
                            ])
                    }
                }
            }
        }
    }
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

allure-results does not exists in Jenkins - Stack Overflow
Here is the solution: 1. Inside your work space (For me it is D:\m\Automation Project\Tests), Create a folder named "target" containing two ...
Read more >
allure-framework/allure-core - Gitter
My test passed but Allure-results does not have .xml file . I have this error: Failed parsing stats for Allure reporter: attribute value...
Read more >
Allure Results Directory Path Setup - YouTube
When you execute your tests, the allure results folder is generated in the project root directory. If you want to change the default...
Read more >
Allure Reporter - WebdriverIO
outputDir defaults to ./allure-results . After a test run is complete, you will find that this directory has been populated with an .xml...
Read more >
Allure-Results Does Not Exists In Jenkins - ADocLib
check the workspace from jenkins and see if allureresults directory is there too let me show you the allure result path set in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found