Skip to content

Conversation

@ejcsid
Copy link
Contributor

@ejcsid ejcsid commented Dec 5, 2025

Pull Request

Changes

  • Added check of environment variable skipTestcontainersTests for possibility to disable Testcontainers tests (execute mvn with setting -DskipTestcontainersTests=true to disable Testcontainers tests, otherwise all tests are executed)

Reference

Issue: #1313

Checklist

Note: If some checklist items are not relevant for your PR, just remove them.

General

  • I have read the Contribution Guidelines (TBD)
  • Met all acceptance criteria of the issue
  • Added meaningful PR title and list of changes in the description
  • Opened documentation issue in refarch repository (if applicable)

Code

  • Wrote code and comments in English

Summary by CodeRabbit

  • Tests
    • Added conditional test execution configuration, enabling testcontainer-based tests to be selectively skipped via system property settings.

✏️ Tip: You can customize this high-level summary in your review settings.

@ejcsid ejcsid requested a review from a team as a code owner December 5, 2025 12:28
@ejcsid ejcsid linked an issue Dec 5, 2025 that may be closed by this pull request
2 tasks
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 5, 2025

Walkthrough

Added the @DisabledIfSystemProperty annotation to three test classes to conditionally skip test execution when the system property skipTestcontainerTests is set to "true". This enables bypassing testcontainer-dependent tests without modifying test logic.

Changes

Cohort / File(s) Summary
Test class conditional skip annotations
refarch-backend/src/test/java/de/muenchen/refarch/configuration/filter/CacheControlFilterTest.java, refarch-backend/src/test/java/de/muenchen/refarch/configuration/filter/UnicodeFilterConfigurationTest.java, refarch-backend/src/test/java/de/muenchen/refarch/theentity/TheEntityIntegrationTest.java
Added DisabledIfSystemProperty import and @DisabledIfSystemProperty(named = "skipTestcontainerTests", matches = "true") annotation to each test class for conditional test execution control

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

  • Simple, repetitive annotation additions across three files following an identical pattern
  • No logic changes or behavioral modifications to test implementations
  • Straightforward metadata configuration only

Poem

🐰 Three test classes gather 'round,
With annotations, freedom's found—
"Skip!" they cry when flags align,
Testcontainers? We shall decline!
Conditional wisdom, neatly signed ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: adding a mechanism to enable/disable test execution for Testcontainers tests through a system property.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The pull request description follows the required template structure with clear Changes section, Issue reference, and completed General and Code checklist items.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 1313-feature-switch-for-testcontainers-test-execution

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot added Template: Backend Issues regarding the backend template. Type: Feature The issue is an feature labels Dec 5, 2025
@eidottermihi
Copy link
Member

@ejcsid I suggest annotating the Testcontainers tests with @EnabledIfDockerAvailable

That way the tests are only executed if there is a Docker (or compatible daemon, eg. Podman) available on the machine executing the test.

@simonhir
Copy link
Member

simonhir commented Dec 15, 2025

@eidottermihi is there a reason you prefer that? I would rather prefer the current change, as then the deactivation of the tests is an aktive decision and can not happen by accident. E.g. I often run the tests locally and just realize that docker isn't running when the tests fail.

@devtobi
Copy link
Member

devtobi commented Dec 15, 2025

Alternatively instead of introducing a custom system property the @Tag-mechanism of JUnit can be used as well to disable certain tests.

@eidottermihi
Copy link
Member

@simonhir ofc, if you want an active deciscion by the developer, than EnabledIf... is not the right fit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Template: Backend Issues regarding the backend template. Type: Feature The issue is an feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Switch for Testcontainers test execution

5 participants