Skip to content

Automated integration-test QA loop via Testcontainers + CI - #111

Merged
a-schild merged 5 commits into
mainfrom
ci/testcontainers-integration
Jul 24, 2026
Merged

Automated integration-test QA loop via Testcontainers + CI#111
a-schild merged 5 commits into
mainfrom
ci/testcontainers-integration

Conversation

@a-schild

Copy link
Copy Markdown
Owner

Summary

Puts a full integration-test QA loop in place. Until now the integration tests required a manually configured Nextcloud server (nextcloud.api.test.* via settings.xml) and were skipped otherwise, so they effectively never ran — including in CI, where the only workflow (maven-publish.yaml) runs on release with -DskipTests.

What this does

  • Auto-provisioned test server (Testcontainers). A new NextcloudTestContainer helper starts a throw-away nextcloud:31-apache container once per JVM, waits until it is installed (/status.php), and exposes it through the existing nextcloud.api.test.* system properties so the current tests run unchanged. Ryuk removes the container at JVM exit.
  • Backwards compatible / non-fatal:
    • If an external server is configured (settings.xml), it is used and no container starts.
    • If Docker is unavailable, the properties stay unset and the tests skip silently, exactly as before.
    • Tests are still skipped by default (skipTests=true); run with mvn test -DskipTests=false.
  • CI workflow (.github/workflows/ci.yml) runs mvn verify -DskipTests=false on push to main and on every PR. GitHub's ubuntu-latest runners have Docker preinstalled, so Testcontainers works out of the box.
  • Unwraps a malformed nested <configuration> in the surefire plugin config.
  • Documents both test options in README.developers.md.

Version pin

Testcontainers is pinned to 1.21.4 (test scope). The 2.x line requires Java 17, whereas this project targets Java 11.

Validation

Test sources compile (mvn clean test-compile). The full container-backed run could not be executed in the authoring environment (no Docker), so this PR's own CI run is the first real end-to-end validation — please check the CI job on this PR before merging.

🤖 Generated with Claude Code

a-schild and others added 4 commits July 24, 2026 10:01
…iners

Integration tests previously required a manually configured Nextcloud
server and were skipped otherwise, so they effectively never ran in CI.

This adds a Testcontainers-based helper (NextcloudTestContainer) that
starts a throw-away Nextcloud container once per JVM and exposes it via
the existing nextcloud.api.test.* system properties, so the existing
tests run unchanged. The behaviour is backwards compatible:

- if an external server is configured (settings.xml), it is used and no
  container is started;
- if Docker is unavailable, the properties stay unset and the tests skip
  silently, exactly as before.

Testcontainers is pinned to 1.21.4 (test scope); the 2.x line requires
Java 17, while this project targets Java 11.

Also unwraps a malformed nested <configuration> in the surefire plugin
config, and documents both test options in README.developers.md.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@a-schild
a-schild merged commit 8bb6518 into main Jul 24, 2026
1 check passed
@a-schild
a-schild deleted the ci/testcontainers-integration branch July 24, 2026 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant