Skip to content

Rerun formatter: the message based version miss failures in around hooks #1869

@brasmusson

Description

@brasmusson

👓 What did you see?

For Around hook there are no TestStepStarted or TestStepFinished events fired. If an Around hook fails it is only detected from the result in the TestCaseFinished event. The result of the TestCaseFinished event are frequently used by formatters in Cucumber-Ruby, so the event based formatters do detect and report failures in Around hook.
In case of messages there is only result data in the TestStepFinished message and not in the TestCaseFinished message. Therefore, when the rerun formatter was changes to use messages instead of event, it no longer detect failures in Around hooks.

Using the message based version of the rerun formatter, a failure in an Around hook could look like:
Summary output:

1 scenario (1 failed)
4 steps (4 passed)

Content for rerun file is empty

✅ What did you expect to see?

Using the event based version of the rerun formatter, a failure in an Around hook could look like:
Summary output:

1 scenario (1 failed)
4 steps (4 passed)

Content for rerun file:
division.feature:6

📦 Which tool/library version are you using?

No response

🔬 How could we reproduce it?

No response

📚 Any additional context?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions