WIP: continue migration to JUnit 5 (Plan A)#1320
Conversation
| Job job = getNextJob(); | ||
| if (job == null) { | ||
| Assert.fail("Existing jobs did not finish after " + waitTimeout + " milliseconds: " + expectedJobs); | ||
| org.junit.jupiter.api.Assertions.fail("Existing jobs did not finish after " + waitTimeout + " milliseconds: " + expectedJobs); //$NON-NLS-1$ //$NON-NLS-2$ |
There was a problem hiding this comment.
| org.junit.jupiter.api.Assertions.fail("Existing jobs did not finish after " + waitTimeout + " milliseconds: " + expectedJobs); //$NON-NLS-1$ //$NON-NLS-2$ | |
| fail("Existing jobs did not finish after " + waitTimeout + " milliseconds: " + expectedJobs); //$NON-NLS-1$ //$NON-NLS-2$ |
| <unit id="org.eclipse.jdt.source.feature.group" version="0.0.0"/> | ||
| <unit id="org.eclipse.platform.feature.group" version="0.0.0"/> | ||
| <unit id="org.eclipse.platform.source.feature.group" version="0.0.0"/> | ||
| <unit id="org.apache.lucene.analysis-common" version="0.0.0"/> |
| <location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit"> | ||
| <repository location="https://download.eclipse.org/tools/orbit/simrel/maven-osgi/release/4.39.0"/> | ||
| <unit id="junit-jupiter-api" version="5.14.3"/> | ||
| <unit id="junit-vintage-engine" version="5.14.3"/> |
There was a problem hiding this comment.
if we have fully migrated to junit 5 we should be able to remove the junit-vintage-engine, can we?
There was a problem hiding this comment.
i think so too. however, for some reason - tycho is using junit5vintage. I do not know how to make tycho use jupiter, and why the tests still keep using the vintage engine, despite best effort to remove the references to junit.
For this reason, "junit-vintage-engine" still remains in the ddk target file, as the tests will return an unresolved error when I remove that entry.
| <stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${workspace_loc:/ddk-parent}/../"/> | ||
| <intAttribute key="M2_COLORS" value="0"/> | ||
| <booleanAttribute key="M2_DEBUG_OUTPUT" value="false"/> | ||
| <stringAttribute key="M2_GOALS" value="clean verify -f ddk-parent/pom.xml --batch-mode --fail-at-end"/> |
There was a problem hiding this comment.
why do we remove the static code analysis?
There was a problem hiding this comment.
this was not intended. I was running maven on local workspace with modified configuration, and i accidentally checked this in.
c551216 to
7edfc07
Compare
|
Current state of this PR:
|
5c43feb to
5cb524e
Compare
5cb524e to
c862f5d
Compare
Updated ddk.target file. Directed tycho to use JUnit5. Changed swtbot dependency to JUnit5. Removed JUnit4 dependencies. Removed custom JUnit4 runners.
c862f5d to
a5bb6d7
Compare
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>
|
#1324 and related PRs document the way forward to fix the JUnit tests for the DDK. 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 |
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 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 #1320 / #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>
Updated ddk.target file.
Directed tycho to use JUnit5.
Changed swtbot dependency to JUnit5.
Removed JUnit4 dependencies.
Removed custom JUnit4 runners.