Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Add on_failure callback #756

Open
martin-schulze-vireso opened this issue Jul 24, 2023 · 1 comment
Open

Add on_failure callback #756

martin-schulze-vireso opened this issue Jul 24, 2023 · 1 comment
Labels
Priority: High Broken behavior in specific environments like in parallel mode or only on some operating systems Size: Medium Changes in the same file Type: Enhancement
Milestone

Comments

@martin-schulze-vireso
Copy link
Member

Is your feature request related to a problem? Please describe.
Sometimes we want to react to test failures in a specific way, doing special cleanup, inspecting in an interactive shell, ... currently, we can only use teardown and check whether the test completed.

Describe the solution you'd like
An on_failure callback function that gets called immediately, when the test is known to have failed. As a bonus this might allow for overriding the failure.

Describe alternatives you've considered
Special "failure only" cleanup can be done in teardown but is a bit more cumbersome. Dropping into an interactive shell could be solved with a specialized flag.

@martin-schulze-vireso martin-schulze-vireso added Type: Enhancement Priority: High Broken behavior in specific environments like in parallel mode or only on some operating systems Size: Medium Changes in the same file labels Jul 24, 2023
@martin-schulze-vireso martin-schulze-vireso added this to the 1.11.0 milestone Jul 24, 2023
@martin-schulze-vireso martin-schulze-vireso modified the milestones: 1.11.0, v1.12.0 Feb 20, 2024
@wainersm
Copy link

Hi @martin-schulze-vireso ! As we talked in Gitter today, on kata-containers project we ran into a situation where this feature will be very useful.

As for """As a bonus this might allow for overriding the failure""", this is another feature very welcomed. Sometimes we know tests are failing and we want to keep them running instead of skipping, but we don't want the CI pipelines failing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: High Broken behavior in specific environments like in parallel mode or only on some operating systems Size: Medium Changes in the same file Type: Enhancement
Projects
None yet
Development

No branches or pull requests

2 participants