Skip to content

Junit silent zero orbit pin step 1 2#1330

Closed
KrisLimbo wants to merge 4 commits into
dsldevkit:masterfrom
KrisLimbo:junit-silent-zero-orbit-pin-step-1-2
Closed

Junit silent zero orbit pin step 1 2#1330
KrisLimbo wants to merge 4 commits into
dsldevkit:masterfrom
KrisLimbo:junit-silent-zero-orbit-pin-step-1-2

Conversation

@KrisLimbo
Copy link
Copy Markdown
Collaborator

This is on top of your junit-silent-zero-pin-step-1, Joao.
I believe this is the minimum set of changes to make the tests run on JUnit 5.

joaodinissf and others added 4 commits May 5, 2026 01:35
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>
…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>
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>
1. Select the plugin versions in the target file.
2. Re-pin orbit aggregation back to 4.39.0.
   Removed reference to org.junit 4.13.2.
3. Upgrade Eclipse release to 2026-03.
4. Removed references to junit-vintage-engine.
5. Migrate remaining JUnit4 Assert Calls as per PR1325.
@KrisLimbo KrisLimbo requested a review from joaodinissf May 6, 2026 05:51
@KrisLimbo KrisLimbo closed this May 7, 2026
@KrisLimbo KrisLimbo deleted the junit-silent-zero-orbit-pin-step-1-2 branch May 7, 2026 01:55
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