Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-25768

Combine the profiles and servletEngineNetworkAliases system properties with the @UITest values instead of ignoring them

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Minor
    • 18.10.0-rc-1
    • 10.11-rc-1
    • Test Framework
    • None
    • Unit
    • Unknown
    • N/A
    • N/A

    Description

      The Docker test framework documents that "System properties have priority over Java annotation attributes", and every @UITest option behaves that way except two list options, which read their system property only when the annotation leaves them empty:

      • profiles (xwiki.test.ui.profiles)
      • servletEngineNetworkAliases (xwiki.test.ui.servletEngineNetworkAliases)

      So as soon as a test sets one of them in its annotation, the matching system property is silently ignored.

      Example

      Modules activate the clover Maven profile for their functional tests by setting <xwiki.test.ui.profiles>clover</xwiki.test.ui.profiles> in their pom (e.g. xwiki-platform-distribution-flavor-test-docker). ExtensionSecurityScanIT in that module has @UITest(standardFlavor = true, profiles = "legacy"). Run standalone (-Dit.test=ExtensionSecurityScanIT), its profiles are only legacy: clover is dropped without any warning. Inside AllIT it happens to work, only because the profiles of the nested test classes are merged and the other nested classes fall back to the system property.

      Expected

      For these two options, combine the values: the annotation's values first, then the system property's, without duplicates. Replacing the annotation's values with the property's would drop legacy, which the test needs; combining is also what already happens when the configurations of nested test classes are merged.

      Attachments

        Issue Links

          Activity

            People

              vmassol Vincent Massol
              vmassol Vincent Massol
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: