Skip to content

Treat errors in setup hooks as Global Errors in Allure Report - #139

Open
vdvukhzhilov wants to merge 1 commit into
mainfrom
hooks-global-errors
Open

Treat errors in setup hooks as Global Errors in Allure Report#139
vdvukhzhilov wants to merge 1 commit into
mainfrom
hooks-global-errors

Conversation

@vdvukhzhilov

Copy link
Copy Markdown

When a Codeception module hook fails (_before, _after, _beforeSuite, _afterSuite), Allure often missed a clear run-level signal — especially for suite setup failures.

This change aligns Codeception with the rest of the Allure ecosystem:

  1. Record those hooks as fixtures in the report (so setup/teardown stays visible).
  2. On failure, also write an Allure global error, so the failure shows under Global Errors.

Existing test results keep working the same way; we only add fixture + global-error reporting for the hooks we wrap.

  • Hook failures are easy to overlook in Allure if they only leave a broken/incomplete test story.
  • Global Errors give a single, obvious place to see “setup/teardown blew up.”
  • Fixture reporting keeps the before/after context next to the suite or test container.

Behavior

  • Supported hooks: Module _beforeSuite, _afterSuite, _before, _after.
  • On failure: fixture is marked failed/broken and one global error is written (no duplicates).
  • Global error message: {hook} failed: …, or {hook} failed when there is no useful message.
  • Test reporting starts after _before succeeds (same idea as allure-phpunit), so a failing before-hook does not look like a half-started test.

@vdvukhzhilov
vdvukhzhilov requested a review from delatrie August 7, 2026 10:51
@vdvukhzhilov vdvukhzhilov changed the title Treat hooks errors as Allure Report Global Errors Treat errors in setup hooks as Global Errors in Allure Report Aug 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant