Skip to content

fix: pin orbit-aggregation to 4.37.0 to restore test discovery#1323

Merged
joaodinissf merged 3 commits into
dsldevkit:masterfrom
joaodinissf:fix/junit-silent-zero-orbit-pin-step-1
May 6, 2026
Merged

fix: pin orbit-aggregation to 4.37.0 to restore test discovery#1323
joaodinissf merged 3 commits into
dsldevkit:masterfrom
joaodinissf:fix/junit-silent-zero-orbit-pin-step-1

Conversation

@joaodinissf
Copy link
Copy Markdown
Collaborator

@joaodinissf joaodinissf commented Apr 30, 2026

Summary

Tests have been silently reporting Tests run: 0 since #1292 (2026-04-01) bumped orbit-aggregation from 2025-09 to 4.39.0. Tycho-Surefire treats zero discovered tests as success, so CI stayed green while coverage dropped to nothing. This PR pins orbit to 4.37.0, restoring 307 tests across 75 classes.

Why 4.37.0

orbit-aggregation 4.38.0+ ships every JUnit Jupiter / Platform / Vintage IU at both 5.x and 6.x simultaneously. Tycho's planner installs both families, leaving the OSGi runtime with two Class<?> instances of JUnit Platform types — LinkageError / ArrayStoreException / ServiceConfigurationError at test discovery, silently swallowed as Tests run: 0.

orbit 4.37.0 (Sept 2025) is the most recent release that ships JUnit at a single family (5.13.4 / Platform 1.13.4) and matches Eclipse 4.34's PDE JUnit runtime bridge. Pinning collapses the three JUnit-Platform-bearing classloaders (Tycho-Surefire's bundled provider, OSGi runtime, Eclipse PDE) onto a single agreed Platform version.

Changes

  • ddk-target/ddk.target: orbit-aggregation 4.39.04.37.0; adjust dep versions to 4.37.0-era values (Mockito 5.21→5.19, byte-buddy 1.18.5→1.17.7, etc.); inline 9 JUnit IUs at 5.13.4 / 1.13.4; drop the now-redundant maven-osgi/release/4.39.0 location (a second source of dual-version pollution) and the unused UML2 location at releases/2022-12 (stealth source of additional 5.9.1/1.9.1 IUs).
  • XtextBuildTriggerTest.java: drop the second IBuildFlag varargs matcher on two verify() sites — Mockito 5 enforces strict varargs counting, and the production scheduleBuildIfNecessary(Iterable<IProject>) is single-arg.
  • .github/workflows/verify.yml: fail the job if no TEST-*.xml files were written under any module (Tycho-Surefire writes none when discovery is empty — precise guard against silent-zero).

Verification

Local macOS aarch64 (-Dosgi.os=macosx -Dosgi.ws=cocoa -Dosgi.arch=aarch64, -XstartOnFirstThread, --add-modules=jdk.incubator.vector): 307 tests across 75 classes, 0 failures, ~1:29 wall clock. Tycho-Surefire's auto-detection selects the junit5vintage provider given Jupiter + vintage-engine on the classpath; no <providerHint> override is needed.

Step 1 of 4

Step 1 of a staged JUnit cleanup: step 2 (#1324, #1325) migrates remaining JUnit 4 source surface to Jupiter, step 3 (#1326) drops org.junit 4.13.2 and vintage-engine, step 4 (#1327) atomically upgrades to JUnit 6 + Eclipse 4.39.

🤖 Generated with Claude Code

@joaodinissf joaodinissf marked this pull request as draft April 30, 2026 21:08
@joaodinissf joaodinissf marked this pull request as ready for review April 30, 2026 22:05
@joaodinissf joaodinissf marked this pull request as draft April 30, 2026 22:06
@joaodinissf joaodinissf force-pushed the fix/junit-silent-zero-orbit-pin-step-1 branch from 4057bb7 to 57eea8e Compare May 4, 2026 23:23
@joaodinissf joaodinissf marked this pull request as ready for review May 4, 2026 23:24
Tests have been silently reporting "Tests run: 0" since dsldevkit#1292
(2026-04-01) bumped orbit-aggregation from 2025-09 to 4.39.0.
Tycho-Surefire treats zero discovered tests as success, so CI
remained green while test coverage dropped to nothing.

Root cause: orbit-aggregation 4.38.0+ ships every JUnit Jupiter,
Platform, and Vintage IU at both the 5.x and 6.x version families
simultaneously. Tycho's planner pulls in both families, so the
OSGi runtime ends up with two Class<?> instances of JUnit Platform
types, producing LinkageError / ArrayStoreException during test
discovery (different classloaders for the same FQN).

orbit-aggregation 4.37.0 (Sept 2025) is the last release that
ships JUnit at a single family (5.13.4 / Platform 1.13.4) and
matches Eclipse 4.34's PDE JUnit runtime bridge. Pinning to it,
removing the now-redundant maven-osgi/release/4.39.0 location,
and inlining the JUnit IUs at 5.13.4 / 1.13.4 restores the three
JUnit-Platform-bearing classloaders to a single agreed version.

Also dropped: the unused releases/2022-12 UML2 location, which
was a stealth source of additional JUnit 5.9.1 / 1.9.1 IUs (DDK
does not consume any UML2 features).

Verified locally on macOS aarch64: 307 tests across 75 classes,
0 failures. Tycho-Surefire's auto-detection selects the
junit5vintage provider given Jupiter + vintage-engine on the
classpath; no providerHint override is needed.

This is step 1 of a staged plan. Subsequent PRs will:
  step 2 - migrate remaining JUnit 4 source surface to Jupiter
  step 3 - drop org.junit 4.13.2 and junit-vintage-engine entirely
  step 4 - upgrade to JUnit 6 + Eclipse 4.39 atomically

Credit: Kris Limbo's dsldevkit#1320 / dsldevkit#1321 (Plan A / Plan B) proved the
JUnit 5 migration direction; both encountered the same LinkageError
during diagnosis that this fix sidesteps via version alignment.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@joaodinissf joaodinissf force-pushed the fix/junit-silent-zero-orbit-pin-step-1 branch from 57eea8e to 289d3f6 Compare May 4, 2026 23:37
…IfNecessary call

XtextBuildTrigger.scheduleFullBuild() invokes
buildScheduler.scheduleBuildIfNecessary(projects) - single arg, no
IBuildFlag varargs - but the test verified the call with two matchers:
eq(projects) and ArgumentMatchers.<IBuildFlag[]>any(). Mockito 5.x
treats the second matcher as expecting a second explicit argument,
not "varargs may be empty", so verify reports an argument-count
mismatch:

  Wanted: scheduleBuildIfNecessary([], <any>);
  Actual: scheduleBuildIfNecessary([]);

The test passed under Mockito 4.x where vararg `any()` matched zero
or more vararg invocations.

This isn't introduced by step 1's 5.21->5.19 patch bump; both are
strict. Master has had Mockito 5.x in scope since orbit-aggregation
4.39 (PR dsldevkit#1292), but tests being silent-zero (Tycho-Surefire
reporting `Tests run: 0` as success) hid the failure. Step 1
restores test discovery, which surfaces this latent mismatch and
makes the test fail deterministically (verified locally: 307 tests,
1 failure on this exact assertion).

Drop the second matcher on both verify sites (the never() check and
the positive verify); they now match the production single-arg call.
The IBuildFlag import is no longer needed.

Bundled in PR dsldevkit#1323 so its "restored 307 tests" claim lands green;
splitting would ship the orbit-pin PR with a known-failing test.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@joaodinissf joaodinissf force-pushed the fix/junit-silent-zero-orbit-pin-step-1 branch from 289d3f6 to 02fb8b1 Compare May 4, 2026 23:44
KrisLimbo
KrisLimbo previously approved these changes May 5, 2026
Copy link
Copy Markdown
Member

@rubenporras rubenporras left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should rather pin the junit in the pom.xml by setting the Junit provider to Junit 5 or by selecting the plugin versions (as I did in ASMD). I think the fisrt one is easier, so it is the preferred one for me.

@rubenporras
Copy link
Copy Markdown
Member

rubenporras commented May 5, 2026

Can we try <providerHint>junit5</providerHint> in the tycho-surefire-plugin plugin?

@joaodinissf
Copy link
Copy Markdown
Collaborator Author

I also tried this, it doesn't work as you suggest. I'll explain later.

@rubenporras
Copy link
Copy Markdown
Member

I can believe that, then selecting the plugin versions in the target file?

Comment thread .github/workflows/verify.yml Outdated
# Tycho-Surefire reports `Tests run: 0` as success — fail the job if no tests ran.
if: always()
run: |
total=$(find . -path '*/target/surefire-reports/TEST-*.xml' -print0 \
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe simplify this check.

Tycho-Surefire reports `Tests run: 0` as exit code 0, so a broken
test discovery yields a green build with no tests run. PR dsldevkit#1292 went
undetected for ~30 days for this reason: orbit-aggregation 4.39.0
introduced JUnit 5.x and 6.x simultaneously, breaking JUnit Platform
discovery, and CI happily reported pass.

Tycho-Surefire writes no TEST-*.xml when discovery yields zero, so a
file-existence check on `**/target/surefire-reports/TEST-*.xml`
suffices to catch the silent-zero failure mode. The step runs with
`if: always()` so it fires even after build failures.

Verified empirically: master (orbit-4.39.0, silent-zero) produces 0
TEST-*.xml; the check correctly fails. Working state (orbit-4.37.0,
357 tests) produces 81 TEST-*.xml; check passes.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@joaodinissf joaodinissf force-pushed the fix/junit-silent-zero-orbit-pin-step-1 branch from 02fb8b1 to 7241fcf Compare May 5, 2026 22:36
@joaodinissf joaodinissf merged commit 85c9280 into dsldevkit:master May 6, 2026
3 checks passed
joaodinissf added a commit that referenced this pull request May 6, 2026
…IfNecessary call

XtextBuildTrigger.scheduleFullBuild() invokes
buildScheduler.scheduleBuildIfNecessary(projects) - single arg, no
IBuildFlag varargs - but the test verified the call with two matchers:
eq(projects) and ArgumentMatchers.<IBuildFlag[]>any(). Mockito 5.x
treats the second matcher as expecting a second explicit argument,
not "varargs may be empty", so verify reports an argument-count
mismatch:

  Wanted: scheduleBuildIfNecessary([], <any>);
  Actual: scheduleBuildIfNecessary([]);

The test passed under Mockito 4.x where vararg `any()` matched zero
or more vararg invocations.

This isn't introduced by step 1's 5.21->5.19 patch bump; both are
strict. Master has had Mockito 5.x in scope since orbit-aggregation
4.39 (PR #1292), but tests being silent-zero (Tycho-Surefire
reporting `Tests run: 0` as success) hid the failure. Step 1
restores test discovery, which surfaces this latent mismatch and
makes the test fail deterministically (verified locally: 307 tests,
1 failure on this exact assertion).

Drop the second matcher on both verify sites (the never() check and
the positive verify); they now match the production single-arg call.
The IBuildFlag import is no longer needed.

Bundled in PR #1323 so its "restored 307 tests" claim lands green;
splitting would ship the orbit-pin PR with a known-failing test.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@joaodinissf joaodinissf deleted the fix/junit-silent-zero-orbit-pin-step-1 branch May 19, 2026 13:22
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.

3 participants