A home for distribution/flavor-level Docker functional tests (xwiki-platform-distribution-flavor-test-docker)

Hi devs,

I think this was touched on in the past but never formally decided, so I’d like to re-verify we all agree.

Context / problem

While working on XWIKI-20411 (automated coverage for the Name Strategies feature), I needed a functional (@UITest, Docker-based) test that verifies a shipped default: that the standard flavor selects the “Character replacement” entity name strategy and forbids / and \ out of the box.

That default ships in xwiki-platform-distribution-ui-base (XWiki.EntityNameValidation.Configuration), not in the feature module (xwiki-platform-model-validation). So it can’t be tested from a per-feature *-test-docker module (e.g. xwiki-platform-model-validation-test-docker): those modules install only the feature’s own UI, not the flavor’s default configuration documents.

More generally, today we have:

  • Per-feature Docker tests in core modules: xwiki-platform-<feature>-test/xwiki-platform-<feature>-test-docker (JUnit5 @UITest).
  • Distribution/flavor functional tests under xwiki-platform-distribution-flavor-test/, but only the legacy ones (JUnit4 / xwiki-platform-test-ui: …-test-ui, …-test-misc, etc.). There is no JUnit5 Docker (@UITest) module at the distribution/flavor level.

=> There’s currently no natural home for a Docker test that needs the full standard flavor (shipped defaults, the set of extensions actually delivered to users, cross-feature/distribution behaviour).

Proposal

Add a new module:

xwiki-platform-distribution/xwiki-platform-distribution-flavor/
  xwiki-platform-distribution-flavor-test/
    xwiki-platform-distribution-flavor-test-docker
  • jar packaging, src/test/it, JUnit5 @UITest, following the exact same conventions as the existing core *-test-docker modules.
  • Purpose: functional Docker tests that need distribution/flavor-level context (shipped default configuration provided by xwiki-platform-distribution-ui-base / the flavor, cross-feature integration of the assembled distribution) — as opposed to a single feature’s UI.
  • It becomes the home for new distribution-level Docker tests, and a target to progressively migrate the remaining legacy xwiki-platform-distribution-flavor-test-ui (JUnit4) tests that genuinely need the flavor.

Guideline: “where does a Docker test go?”

  • Tests a single feature → that feature’s xwiki-platform-<feature>-test-docker module (install just that feature’s UI). This stays the default and the large majority of cases.
  • Tests a shipped default / the assembled flavor / cross-feature distribution behaviourxwiki-platform-distribution-flavor-test-docker.

WDYT?

Thanks!

+1 to introduce a docker based test module relying on the standard WAR and flavor (instead of the usual custom WAR/extension setup).

Even without counting specific tests inside it, it’s already interesting to have a validation that the flavor install go well in various environments, since we don’t really have that right now (the closest is the jetty+hsqldb only upgrade tests).

+1

Thanks,
Marius

+1, thanks

It’s now been implemented, see xwiki-platform/xwiki-platform-distribution/xwiki-platform-distribution-flavor/xwiki-platform-distribution-flavor-test/xwiki-platform-distribution-flavor-test-docker at master · xwiki/xwiki-platform · GitHub

While it does install the standard flavor, it does not seem to be based on the standard WAR, so not exactly the same condition as a real XWiki instance.

Yes I know but FTM there’s no mechanism to do that in our docker-based tests, and I left this to later.

Also note that the provisioning is re-installing extensions that are already installed from what I see. I had planned to look at this later too.

So in short, it’s working for the existing test but it’s still a work in progress before being perfect.

Thx

I understand, but could make sense to add comments in the pom to explain what’s missing for this module to be complete.