jenkinsdevopsallurejenkins-job-dsl

One Result Displayed by Allure Despite Running Pytest in a Loop in jenkins


I'm running a Jenkins job that executes pytest in a loop. Here's the code snippet I'm using:

  stage("tests") {
    steps {
      withAllureUpload(serverId: 'allure-testops', projectId: '1', results: [[path: 'allure-results']]) {
        sh """
        export PYTEST_ADDOPTS="--alluredir=$WORKSPACE/allure-results"
        pytest --loop=10 test_file.py 
        """
      }
    }
  }
}

However, when I check the test results in Allure TestOps, I only see the results from one run, not all the runs in the loop. Do you have any suggestions on how to fix this issue?

expected: To see the results of all runs from the loop under the tree in Allure TestOps.


Solution

  • The answer is here:
    https://github.com/orgs/allure-framework/discussions/1985

    these test results are considered as retries for the initial attempt and you'll find them in the Retries section of a launch which is 100% expected correct behavior – you run the same tests in the same environment which is a retry for such test.