-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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 support for test lifecycle events in TestExecutionListener #618
Comments
Changed title to reflect terminology used in JUnit Jupiter. |
Is the proposal here intended to replace #542? |
I think that is much better to have engine-independent listener for base test events such as TestGroupStarted/Finished TestFixtureStarted/Finished and TestCaseStarted/Finished |
Please keep in mind that the JUnit Platform and JUnit Jupiter do not have groups, fixtures, or cases. Thus, we will need to use terminology in line with containers, tests, and lifecycle events. |
What @baev wrote about TestGroupStarted/Finished TestCaseStarted/Finished is basically a question of splitting general executionStarted/executionFinished events in TestExecutionListener into separate events for containers and for tests, at least as I got it, which is a slightly different discussion. Though it would simplify things a bit, I agree. What is needed at the least is engine independent lifecycle events support (specifically, something to determine both start and finish of BeforeAll, BeforeEach, AfterAll, AfterEach for tests run with Jupiter engine as well as for Before, BeforeClass, After, AfterClass for tests run with Vintage engine). |
Any updates? @sbrannen |
@ehborisov @baev Since M4 you can register extensions via |
Nope. We need to have around callbacks for all user code that executed during test execution, including configuration methods ( |
Have you looked at http://junit.org/junit5/docs/current/user-guide/#extensions-execution-order? There's a lifecycle callback around all test class methods except test data generation methods. In case that's really not sufficient, we could add a generic method to void executionEvent(Event event) However, I'm not sure what events we need and which information needs to be contained in such events. Can you propose a list of events/event types, possible as a sequence diagram that includes the existing |
This issue has been automatically marked as stale because it has not had recent activity. Given the limited bandwidth of the team, it will be automatically closed if no further activity occurs. Thank you for your contribution. |
This issue has been automatically closed due to inactivity. If you have a good use case for this feature, please feel free to reopen the issue. |
Now there's no ability to track invocations of Before/After methods with TestExecutionListener, we need it there to be able to link test invocations with all corresponding fixtures and their timings in the reporting tool (Allure). Extensions are not entirely a solution for that, since we want to track events around fixture, one callback on the finish is not enough. And also registering such an extension via annotations everywhere would be quite clumsy.
Related Issues
The text was updated successfully, but these errors were encountered: