webdriverio: [πŸ› Bug]: Jenkins pipeline failing with latest WDIO version

Have you read the Contributing Guidelines on issues?

WebdriverIO Version

latest

Node.js Version

latest

Mode

Standalone Mode

Which capabilities are you using?

reporters: [
    'spec',
    'dot',
    ['junit', {
      outputDir: `${process.env.WORKSPACE ? process.env.WORKSPACE + "/" : ""
        }${process.env.SPEC ? process.env.SPEC + "/reports" : "./reports"}`,
      errorOptions: {
        error: 'message',
        failure: 'message',
        stacktrace: 'stack'
      },
      outputFileFormat: function (options) { // optional
        return `results-${options.cid}.xml`
      }
    }]

  ],

}

What happened?

Since I upgraded the WDIO from 9.7.1 to 9.12.3, the Jenkins pipeline started failing. The test has passed successfully, however, the jenkins JUNIT plugin is unable to find the xml files.

VESRION UPGRADE

Image

OBSERVATIONS

  • What more confusing is that, when I execute the test locally, I could see the XML files generated.
  • When the same job is executed with previous version ( 9.7.1 ) of wdio, the pipeline is green again.
  • The issue is only observed for cucumber test. The mocha test jenkins pipeline is green with version 9.12.3 and 9.7.1.

What is your expected behavior?

Jenkins job should finish with success, generating the proper JUNIT output.

How to reproduce the bug.

Since the test is successful, but the post test step in Jenkins pipeline is failing, I am not sure what steps to provide here.

Relevant log output

OUTPUT

Image

Code of Conduct

  • I agree to follow this project’s Code of Conduct

Is there an existing issue for this?

  • I have searched the existing issues

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Comments: 16 (7 by maintainers)

Most upvoted comments

Thanks for reporting!

We greatly appreciate any contributions that help resolve the bug. While we understand that active contributors have their own priorities, we kindly request your assistance if you rely on this bug being fixed. We encourage you to take a look at our contribution guidelines or join our friendly Discord development server, where you can ask any questions you may have. Thank you for your support, and cheers!

Empty JUnit xml before the change:

<testsuites tests="0" failures="0" errors="0" skipped="0"/>

Empty JUnit xml after the change: false positive

<testsuites tests="1" failures="1" errors="0" skipped="0">
  <testsuite tests="1" failures="1" errors="0" skipped="0">
    <testcase classname="" name="">
      <failure message="No tests found"/>
    </testcase>
  </testsuite>
</testsuites>