Skip to content

ci(test): fail when container tests are skipped - #162

Open
kcrmin wants to merge 1 commit into
developfrom
ci/fail-on-skipped-container-tests
Open

kcrmin wants to merge 1 commit into
developfrom
ci/fail-on-skipped-container-tests

Conversation

@kcrmin

@kcrmin kcrmin commented Oct 27, 2026

Copy link
Copy Markdown
Member

What and why

  • Container test classes use @Testcontainers(disabledWithoutDocker = true), and VirtualFillPersistenceTest assumes Docker. Without Docker, ./gradlew check passed with 218 of 745 tests skipped, so CI could pass without running a single PostgreSQL or Redis test.
  • With -PrequireContainerTests=true, each Test task reads its JUnit XML after the run and fails if any test was skipped, naming each skipped class. The CI check step now passes it. Local runs without the property behave as before.
  • Docker availability is probed the way Testcontainers looks for an engine (DOCKER_HOST, ~/.testcontainers.properties, then the default sockets). It is a test input, and a test task that ran without Docker is never stored in the build cache, so a later run with Docker executes the tests instead of reusing a skip-only result.
  • DEVELOPMENT.md documents both.

Verified

  • DOCKER_HOST=unix:///nonexistent/docker.sock ./gradlew check -PrequireContainerTests=true --no-daemon --no-build-cache: BUILD FAILED. The trading-persistence, market-gateway, market-data-adapter and trading-worker test tasks failed and listed their skipped classes, including VirtualFillPersistenceTest.
  • Same DOCKER_HOST without the property: BUILD SUCCESSFUL, 745 tests with 218 skipped. With --build-cache --info, every test task logs 'Docker is available, so container tests ran' not satisfied as the reason caching is disabled.
  • With Docker (colima), ./gradlew check -PrequireContainerTests=true --no-daemon --no-build-cache: BUILD SUCCESSFUL, with 745 tests and 0 skipped, failed or errored. The configuration cache entry was stored.
  • After a run without Docker, a run with Docker re-executed :modules:market-data-adapter:test because input dockerAvailable changed.
  • pwsh ./scripts/test-github-action-pins.ps1: passed.

Checklist

  • CI fails when container tests are skipped
  • Skip-only test results are never stored in the build cache
  • Local runs without Docker still pass
  • Build plugin and Spring Boot versions are untouched

Related: #159 (Testcontainers 2.0.5 alignment)

CI runs check with -PrequireContainerTests=true, so a test task that
skips any test fails. Runs without Docker are not stored in the cache.
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