-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
TestWatcher.testSkipped()
should be invoked for tests not executed due to failures in @BeforeAll
#4235
Comments
You are referring to If so, this works as documented: junit5/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/TestWatcher.java Lines 29 to 36 in ee52c64
Have you considered registering a |
@marcphilipp i am not refering to Implementing a |
TestWatcher.testSkipped
to collect infos about not executed tests due to failures in @BeforeAll
TestWatcher.testSkipped()
should be invoked for tests not executed due to failures in @BeforeAll
Team decision: Waiting for additional interest from the community |
It will be clearer and more helpful to have tests in the report that are not run due to issues in @BeforeAll but are expected to be. I would also like to see them marked as skipped in the report |
I am using the
TestWatcher
to collect information for reporting the status of tests by implementingtestDisabled
,testSuccessful
,testAborted
, andtestFailed
. This is working fine as long as there is no failure inside a@BeforeAll
orpostProcessTestInstance
method, in which case none of theTestWatcher
methods is called, and the test is kind of lost.To detect this state, a lot of other interfaces must be implemented, and information has to be combined. It would be better to have a complete view of the test results using only the
TestWatcher
.Deliverables
TestWatcher.testSkipped(ExtensionContext context, ExtensionContext origin, Throwable reason)
should be invoked for tests not executed at allExtensionContext origin
argument with details about the failedExtensionContext
causing the test to get skippedThrowable reason
argument with details about the failureThe text was updated successfully, but these errors were encountered: