jenkinsci / allure-plugin

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

Allure report not displayed in BDD format (with given/when/then steps) when generated on Jenkins #334

Open vlad230 opened 1 year ago

vlad230 commented 1 year ago

Jenkins and plugins versions report

Environment ```text Jenkins allure plugin version: allure-jenkins-plugin:2.30.3 Jenkins Allure cmd line version: 2.23.1 (same version on my local machine) ```

What Operating System are you using (both controller, and any agents involved in the problem)?

This Jenkins pipeline is running inside AKS, I use Mac OS on my local machine.

Reproduction steps

  1. I execute the tests with python + poetry + pytest-bdd inside Jenkins with cmd: python -m poetry run pytest -ra -q --cucumber-json=test.json --alluredir allure-dir (same cmd as on my local machine)
  2. The output is stored inside allure-dir
  3. The plugin executes: allure generate -c -o allure-dir allure-report

Local execution: local-exec

Jenkins execution: jenkins-exec

Expected Results

The generated report is the same as the one generated on my local machine, with BDD type steps like Given, When Then inside the Suites -> Test Item -> Overview Tab -> Test Body.

Actual Results

The report is generated but it's not in a BDD style, it just displays Scenario name from the .feature file inside Suites -> Test Item -> Overview Tab -> Description

Anything else?

How can I see this report in a BDD style on Jenkins using the plugin? This is the pipeline code I use: allure([ includeProperties: false, jdk: '', properties: [], reportBuildPolicy: 'ALWAYS', results: [[path: 'allure-dir']]

vlad230 commented 11 months ago

Found a solution to this problem, in case anyone still has it: You need to use allure-pytest-bdd python library in order for the report to show up in BDD format. The problem for us was that someone installed allure-pytest manually inside the docker image and it was using that one instead of the correct one listed inside our dependencies.