Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

ENG-1059: Throw errors #2

Open
wants to merge 4 commits into
base: 3.x
Choose a base branch
from
Open

ENG-1059: Throw errors #2

wants to merge 4 commits into from

Conversation

lin-brian-l
Copy link
Collaborator

@lin-brian-l lin-brian-l commented Sep 13, 2024

Motivation/Description of the PR

This PR causes failures from run-rerun to be thrown. After some testing, the existing code in run-rerun will exit with an error code of 1 if the last-executed test fails but I wasn't able to pinpoint why exit code 1 wasn't being thrown if the first test (or any other test than the last one) failed.

Note: I've also made a PR on the CodeceptJS repo. However, I made a separate branch because I didn't want to commit the typing files in the branch I have for that PR.

Applicable helpers:

  • Playwright
  • Puppeteer
  • WebDriver
  • REST
  • FileHelper
  • Appium
  • TestCafe

Applicable plugins:

  • allure
  • autoDelay
  • autoLogin
  • customLocator
  • pauseOnFail
  • coverage
  • retryFailedStep
  • screenshotOnFail
  • selenoid
  • stepByStepReport
  • stepTimeout
  • wdio
  • subtitles

Type of change

  • 🔥 Breaking changes
  • 🚀 New functionality
  • 🐛 Bug fix
  • 🧹 Chore
  • 📋 Documentation changes/updates
  • ♨️ Hot fix
  • 🔨 Markdown files fix - not related to source code
  • 💅 Polish code

Checklist:

  • Tests have been added
  • Documentation has been added (Run npm run docs)
  • Lint checking (Run npm run lint)
  • Local tests are passed (Run npm test)

Comment on lines -24 to -25
typings/types.d.ts
typings/promiseBasedTypes.d.ts
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Annoyingly, TSLint was failing because these files weren't committed to the repo 🙃.

@@ -70,6 +70,7 @@ class CodeceptRerunner extends BaseCodecept {
await this.runTests(test);
} catch (e) {
output.error(e.stack);
throw e;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the actual fix, which causes the run-rerun command to properly set the exit code to 1.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant