Skip to content

QUESTION: How to trigger FailHandler when Expect fails in BeforeAll section #1587

@konopka90

Description

@konopka90

Hi, I have an problem with setting up my test suite and maybe you got some ideas how to improve my approach. Inside BeforeSuite I set up RegisterFailHandler and it is working correctly when Expect fails in BeforeEach section.

However, when Expect fails in BeforeAll section then fail handler is not launched. How can I make sure that my fail handler will launch in this case? I figured out one solution by calling defer GinkgoRecover() on first line in every BeforeAll section but it does not looks good for me and I don't have any proof that it should be done in this way.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions