Skip to content

fix: add JUnit Platform launcher + testClassesDirs for Gradle 9#20429

Merged
davdhacs merged 5 commits into
masterfrom
davdhacs/gradle9-fix
Jun 9, 2026
Merged

fix: add JUnit Platform launcher + testClassesDirs for Gradle 9#20429
davdhacs merged 5 commits into
masterfrom
davdhacs/gradle9-fix

Conversation

@davdhacs

@davdhacs davdhacs commented May 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds two fixes to qa-tests-backend/build.gradle.kts that prepare for Gradle 9 and don't hurt on Gradle 8:

  1. junit-platform-launcherruntimeOnly dependency. Gradle 9 removed auto-provisioning. Without it, test tasks fail with "Failed to load JUnit Platform."

  2. testClassesDirs + classpath wiring — Gradle 9's register<Test> tasks don't inherit the test source set. Without it, custom tasks (testBAT, testSMOKE) report NO-SOURCE. Added in configureEach block.

Why not Gradle 9?

The com.google.protobuf plugin (0.8.19) uses the deprecated convention API removed in Gradle 9. Upgrading requires migrating to protobuf plugin 0.10+ which has DSL breaking changes. That's a separate, larger effort.

These two fixes are forward-compatible — they work on both Gradle 8 and 9, so when the protobuf plugin is upgraded, the test infrastructure is already ready.

Test plan

  • Existing groovy tests compile and pass (no regression on Gradle 8)
  • Style checks pass

🤖 Generated with Claude Code

Reverts the Gradle 8.13 downgrade (PR #20384) and fixes the root cause:

1. junit-platform-launcher runtimeOnly dependency — Gradle 9 removed
   auto-provisioning. Without this, test tasks fail with "Failed to
   load JUnit Platform."

2. testClassesDirs + classpath wiring in configureEach — Gradle 9's
   register<Test> tasks don't inherit the test source set. Without
   this, custom test tasks (testBAT, testSMOKE, etc.) report NO-SOURCE
   even after compilation succeeds.

Root cause verified locally and on CI:
- compileTestGroovy produces class files
- testSMOKE/testBAT find and execute tests
- 78+ BAT tests pass on KinD

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

openshift-ci Bot commented May 8, 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

@davdhacs davdhacs marked this pull request as ready for review May 8, 2026 13:56
@davdhacs davdhacs requested a review from janisz as a code owner May 8, 2026 13:56
@github-actions

github-actions Bot commented May 8, 2026

Copy link
Copy Markdown
Contributor

🚀 Build Images Ready

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

export MAIN_IMAGE_TAG=4.12.x-127-gd0bb99a0bd

Comment thread qa-tests-backend/build.gradle.kts
…radle 9

The protobuf plugin 0.8.19 uses the deprecated 'convention' API
which was removed in Gradle 9. Upgrading to protobuf plugin 0.10+
requires API migration in both build.gradle.kts (sourceSet.java
→ sourceSet.extensions) and protobuf.gradle (DSL changes).

Keep the JUnit Platform and testClassesDirs fixes — they're needed
for both Gradle 8 and 9. The Gradle 9 upgrade needs to be paired
with the protobuf plugin migration as a separate effort.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@davdhacs davdhacs changed the title fix: restore Gradle 9.4.1 with JUnit Platform fixes fix: add JUnit Platform launcher + testClassesDirs for Gradle 9 readiness May 8, 2026
@codecov

codecov Bot commented May 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 49.62%. Comparing base (65167c4) to head (2a60682).
⚠️ Report is 7 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #20429      +/-   ##
==========================================
- Coverage   49.65%   49.62%   -0.03%     
==========================================
  Files        2799     2800       +1     
  Lines      212919   212996      +77     
==========================================
- Hits       105715   105697      -18     
- Misses      99471    99559      +88     
- Partials     7733     7740       +7     
Flag Coverage Δ
go-unit-tests 49.62% <ø> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@davdhacs davdhacs changed the title fix: add JUnit Platform launcher + testClassesDirs for Gradle 9 readiness fix: add JUnit Platform launcher + testClassesDirs for Gradle 9 May 11, 2026
@coderabbitai

coderabbitai Bot commented May 28, 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: 412a11fa-92d8-4d0c-be39-925103cb7b6b

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 davdhacs/gradle9-fix

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 commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

/test eks-qa-e2e-tests

@davdhacs davdhacs merged commit d0bb99a into master Jun 9, 2026
97 checks passed
@davdhacs davdhacs deleted the davdhacs/gradle9-fix branch June 9, 2026 23:25
janisz added a commit that referenced this pull request Jun 11, 2026
… 9 (#20429)"

This reverts commit d0bb99a.

Signed-off-by: Tomasz Janiszewski <tomek@redhat.com>
janisz added a commit that referenced this pull request Jun 11, 2026
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.

2 participants