Introduce SUITE, CLASS, and MANUAL lifecycle modes for @Testcontainer annotation, replacing the previous boolean value.#127
Conversation
|
This is a feature we would need in WildFly clustering test suite when running a group of tests against an Infinispan server and there are also Elytron TS use cases. Opening as draft before I head over for PTO later today so I don't forget all about it while I am off. Nevertheless, seems fully functional but haven't tested it outside of the integration testsuite done here. Note the complications of the TestcontainerRegistryView class, which is working around the injection of the same class but in different scoped; all explained in the Javadoc. This will need adaptation as the #123 and #124 get merged. Have a look @jamezp @jasondlee and might be of interest to @haster too |
…annotation, replacing the previous boolean value. SUITE-scoped containers are started once and shared across test classes, CLASS-scoped containers follow the existing per-class behavior, MANUAL-scoped containers are injected but never started/stopped by the framework. Add TestcontainerLifecycle enum for container lifecycle scoping Suite-scoped containers use @SuiteScoped registry created in BeforeSuite, while class-scoped containers use a fresh @ClassScoped registry per test class. TestcontainerRegistryView routes lookups to the correct registry based on lifecycle value. Resolves: arquillian#126 Signed-off-by: Radoslav Husar <rhusar@redhat.com> Signed-off-by: Radoslav Husar <radosoft@gmail.com>
35d0681 to
d34a1d1
Compare
|
This is gonna be really useful to us. We re-use our containers between different testclasses, mostly for performance reasons. This PR is shaping up to be exactly what we planned to send in. Claude is also very happy:
|
Add TestcontainerLifecycle enum for container lifecycle scoping
Suite-scoped containers use @SuiteScoped registry created in BeforeSuite, while class-scoped containers use a fresh @ClassScoped registry per test class. TestcontainerRegistryView routes lookups to the correct registry based on lifecycle value.
Resolves: #126