jenkinsci / cucumber-reports-plugin

Jenkins plugin to generate cucumber-jvm reports
https://plugins.jenkins.io/cucumber-reports/
GNU Lesser General Public License v2.1
210 stars 232 forks source link

Unable to see reports when I run tests against a jenkins remote agent #393

Closed fabioformosa closed 3 years ago

fabioformosa commented 3 years ago

Version report

Jenkins and plugins versions report:

Jenkins 2.277.3
plugin 5.5.0
Ubuntu 20.04.1 LTS

Reproduction steps

Results

Expected result:

I would like to see cucumber reports event if I run tests in the jenkins agent, instead of master node.

Actual result:

No reports available. image

It seems the plugin looks for reports in the jenkins-master's workspace, not in the jenkins-agent's workspace. When there's a remote jenkins agent, there are multiple workspaces.

image

Is it possibile to browse reports stored into the jenkins agent?

damianszczepanik commented 3 years ago

I believe the path to the report is incorrect. I need more details to reproduce and fix the problem. Check the real location of the JSON file and logs

fabioformosa commented 3 years ago

The path is specified in my jenkinsfile:

post {
    always {
      cucumber fileIncludePattern: 'build/reports/*.json', sortingMethod: 'ALPHABETICAL'
      archiveArtifacts artifacts: 'build/reports/e2eTests.html', allowEmptyArchive: true
    }

I point out that I have 2 jenkinsfiles (one for DEV env and another one for QA env). The path is the same in both, but only QA env uses the remote jenkins agent. So, summarizing, the same path works in DEV, not in QA.

Take a look at the following screenshot. When tests are run against the remote agent, we have 3 workspaces. The workspace where is located the path is the last one of the three (I've checked and the path is correct there): image

Have you ever tried to collect report with the plugin when the tests are run against a remote jenkins agent as described here https://www.jenkins.io/doc/book/using/using-agents/ ?

brunomendola commented 3 years ago

Hi! I solved the problem by moving the global post block with the cucumber step to a post block on the stage running on the remote agent.

fabioformosa commented 3 years ago

Awesome @brunomendola. I close this issue.