Details
-
Improvement
-
Resolution: Fixed
-
Major
-
17.10.15
-
None
-
Unknown
-
Description
Problem
The @UITest annotation is not @Inherited, and XWikiDockerExtension reads it with Class#getAnnotation() on the test class being executed. As a consequence, a top-level functional test class whose @UITest configuration is declared only on its (abstract) base class can't be run on its own: the configuration (properties, extra JARs, network aliases, etc.) declared on the base class is not found.
So a module that has several functional test classes sharing the same setup (e.g. extending a common abstract class and aggregated by an AllIT with @Nested classes) has to duplicate the same @UITest(...) configuration on each test class, in order for each of them to be runnable individually with -Dit.test=SomeIT. Besides the duplication, this makes it easy for the configurations to drift apart, which prevents reusing the XWiki instance started for one test class to run another test class from the same module (-Dit.test=OtherIT -Dxwiki.test.ui.servletEngine=external).
Note that the @Nested test classes from AllIT already look for @UITest on their superclasses when the configurations are merged; only the lookup on the top-level test class doesn't.
Proposal
Mark @UITest as @Inherited, so that the configuration can be declared once, on the shared base class, and is used both when the test classes are run individually and when they are run from AllIT.
Attachments
Issue Links
- relates to
-
XWIKI-16271 Merge @UITest properties when executing from the top level AllIT test
-
- Closed
-