Skip to content

fix(tests): fail CI when Gradle produces no test results#21066

Draft
davdhacs wants to merge 1 commit into
masterfrom
worktree-gradle-test-guard
Draft

fix(tests): fail CI when Gradle produces no test results#21066
davdhacs wants to merge 1 commit into
masterfrom
worktree-gradle-test-guard

Conversation

@davdhacs

Copy link
Copy Markdown
Contributor

Description

Gradle 9 silently skips test tasks (NO-SOURCE) and exits 0 when testClassesDirs isn't wired to registered Test tasks. This went undetected for 16 consecutive master commits after the Gradle 9 upgrade (#20295) because the job reported SUCCESS despite running zero Groovy tests.

The root cause was fixed in #20429 (testClassesDirs/classpath wiring), but there was no defense-in-depth to catch a recurrence. This PR adds a post-make guard in all four CI test runner scripts that checks for JUnit XML output after the Gradle invocation. If no XML files exist, the job fails with a clear error instead of silently passing.

User-facing documentation

Testing and quality

  • the change is production ready: the change is GA, or otherwise the functionality is gated by a feature flag
  • CI results are inspected

Automated testing

  • modified existing tests

How I validated my change

Verified locally with Gradle 9.5.1:

  1. With testClassesDirs fix in place: ./gradlew testDeploymentCheck runs tests, produces build/test-results/testDeploymentCheck/TEST-DeploymentCheck.xml. Guard passes.
  2. With testClassesDirs fix removed: ./gradlew testDeploymentCheck reports NO-SOURCE, exits 0, produces no XML. Guard correctly fails with: ERROR: No test results (JUnit XML) produced. Gradle may have skipped tests (NO-SOURCE).

Also verified against 30 Prow CI runs on master that the duration/result pattern matches exactly: all 16 pre-fix runs showed NO-SOURCE (43-84 min, SUCCESS), all 9 post-fix runs executed tests (135-152 min).

Gradle 9 silently skips test tasks (NO-SOURCE) and exits 0 when
testClassesDirs isn't wired to registered Test tasks. This went
undetected for 16 consecutive master commits after the Gradle 9
upgrade because the job reported SUCCESS despite running zero tests.

Add a post-make guard in all four CI test runner scripts that checks
for JUnit XML output. If no XML files exist after the Gradle
invocation, the job fails with a clear error message instead of
silently passing.

Verified locally:
- With testClassesDirs fix: Gradle produces XML, guard passes
- Without testClassesDirs fix: Gradle skips (NO-SOURCE), guard fails

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@openshift-ci

openshift-ci Bot commented Jun 10, 2026

Copy link
Copy Markdown

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Enterprise

Run ID: d904f447-e832-4aff-acc3-3fbb867c268e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch worktree-gradle-test-guard

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.

@davdhacs davdhacs requested a review from janisz June 10, 2026 21:07
@davdhacs

davdhacs commented Jun 10, 2026

Copy link
Copy Markdown
Contributor Author

@janisz 🙏 Please feel free to throw this away and solve it in a better way :)

@github-actions

github-actions Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

🚀 Build Images Ready

Images are ready for commit 3255d69. To use with deploy scripts:

export MAIN_IMAGE_TAG=4.12.x-144-g3255d69c9e

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant