fix(@wdio/runner): Continue emitting event on the runner even when a reporter throws an error#13958
Conversation
eslint-plugin-wdio
@wdio/appium-service
@wdio/allure-reporter
@wdio/browser-runner
@wdio/browserstack-service
@wdio/cli
@wdio/concise-reporter
@wdio/config
@wdio/cucumber-framework
@wdio/dot-reporter
@wdio/firefox-profile-service
@wdio/globals
@wdio/jasmine-framework
@wdio/json-reporter
@wdio/junit-reporter
@wdio/lighthouse-service
@wdio/logger
@wdio/local-runner
@wdio/mocha-framework
@wdio/protocols
@wdio/repl
@wdio/reporter
@wdio/runner
@wdio/sauce-service
@wdio/shared-store-service
@wdio/smoke-test-cjs-service
@wdio/smoke-test-reporter
@wdio/smoke-test-service
@wdio/spec-reporter
@wdio/static-server-service
@wdio/sumologic-reporter
@wdio/testingbot-service
@wdio/types
@wdio/utils
@wdio/webdriver-mock-service
webdriver
webdriverio
commit: |
|
Hey dprevost-LMI 👋 Thank you for your contribution to WebdriverIO! Your pull request has been marked as an "Expensable" contribution. We've sent you an email with further instructions on how to claim your expenses from our development fund. We are looking forward to more contributions from you in the future 🙌 Have a nice day, |
|
Hey dprevost-LMI 👋 Thank you for your contribution to WebdriverIO! Your pull request has been marked as an "Expensable" contribution. We've sent you an email with further instructions on how to claim your expenses from our development fund. We are looking forward to more contributions from you in the future 🙌 Have a nice day, |
Proposed changes
In this issue, we discovered we could hang the runner process when processing the reporters with specific conditions. Moreover, after a closer look, when the AllureReporter throws an error, it fails the run, stating that some tests failed when this is not the case. Finally, since we can configure multiple reporters, an error thrown by one should not affect the other reporters.
So, to have more robust test runs and make a better effort at finishing reporting, I propose to try-catch the error after emitting the event to a faulty reporter, output the error in the console, continue to the next reporter, and emit the next event.
Types of changes
Checklist
Backport Request
v9and doesn't need to be back-portedFurther comments
Here is an example where the Allure reporter was throwing an error, but the Spec reporter was not. With the fix, we can now see that the run was successful, but Allure has potential problems due to the error. Weirdly, the second picture shows that the Allure reporting was still working despite the error.
Reviewers: @webdriverio/project-committers