Automated integration-test QA loop via Testcontainers + CI - #111
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Puts a full integration-test QA loop in place. Until now the integration tests required a manually configured Nextcloud server (
nextcloud.api.test.*viasettings.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
NextcloudTestContainerhelper starts a throw-awaynextcloud:31-apachecontainer once per JVM, waits until it is installed (/status.php), and exposes it through the existingnextcloud.api.test.*system properties so the current tests run unchanged. Ryuk removes the container at JVM exit.settings.xml), it is used and no container starts.skipTests=true); run withmvn test -DskipTests=false..github/workflows/ci.yml) runsmvn verify -DskipTests=falseon push tomainand on every PR. GitHub'subuntu-latestrunners have Docker preinstalled, so Testcontainers works out of the box.<configuration>in the surefire plugin config.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