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 per-invocation lifecycle method and extension support for container templates #4320

Open
2 tasks
marcphilipp opened this issue Feb 14, 2025 · 0 comments
Open
2 tasks

Comments

@marcphilipp
Copy link
Member

Follow-up on #871.

In addition to the existing @BeforeAll, @BeforeEach, @AfterEach, and @AfterAll lifecycle methods, we should add introduce @BeforeContainerTemplateInvocation/@AfterContainerTemplateInvocation (names to be discussed) annotations that can be declared on static (unless TestInstance.Lifecycle.PER_CLASS is used) methods of the test class that will be executed once before/after all test methods and nested classes in a @ContainerTemplate class. If one of those methods is declared in a non-@ContainerTemplate test class, execution of that class or its children should fail to avoid misuse.

For parameterized test classes (see #878), it may make sense to declare composed @BeforeParams/@AfterParams (names to be discussed) annotations that may additionally also support parameter resolution for the argument set of the current container template invocation.

Analoguous to BeforeAllCallback etc., new BeforeContainerTemplateInvocationCallback/AfterContainerTemplateInvocationCallback (names to be discussed) extension interfaces should be introduced as well to externalizing behavior to extensions.

Deliverables

  • Introduce @BeforeContainerTemplateInvocation/@AfterContainerTemplateInvocation lifecycle method support
  • Introduce BeforeContainerTemplateInvocationCallback/AfterContainerTemplateInvocationCallback extension points
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

No branches or pull requests

1 participant