This issue has been created
There are 2 updates.
 
 
XWiki Platform / cid:jira-generated-image-avatar-34eae5ac-1644-468f-9adc-0b93b4bdfa07 XWIKI-25751 Open

Allow sharing the @UITest configuration between functional test classes through a common base class

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-ce46d03b-4345-425a-9ad2-68eb74363c8f Marius Dumitru Florea created this issue on 13/Nov/26 11:29
 
Summary: Allow sharing the @UITest configuration between functional test classes through a common base class
Issue Type: cid:jira-generated-image-avatar-34eae5ac-1644-468f-9adc-0b93b4bdfa07 Improvement
Affects Versions: 17.10.15
Assignee: Unassigned
Components: Test Framework
Created: 13/Nov/26 11:29
Priority: cid:jira-generated-image-static-major-903a6314-96a9-4b8b-995f-96f45ceedee2 Major
Reporter: Marius Dumitru Florea
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.

 
 

2 updates

 
cid:jira-generated-image-avatar-ce46d03b-4345-425a-9ad2-68eb74363c8f Changes by Marius Dumitru Florea on 13/Nov/26 11:29
 
Fix Version: 18.10.0-rc-1
Assignee: Marius Dumitru Florea