Skip to content

Move the builder checks to JUnit - #84

Merged
dshadowwolf merged 1 commit into
master-2.0-1.21.1-neofrom
junit-builder-checks
Nov 2, 2026
Merged

dshadowwolf merged 1 commit into
master-2.0-1.21.1-neofrom
junit-builder-checks

Conversation

@faceofcat

Copy link
Copy Markdown
Collaborator

What this is

The last PR of the machine module stack, after #81, #82 and #83. It finishes the move to JUnit that #82 started, and only touches tests, build scripts and docs. Nothing under src/main changes.

The 16 remaining src/builderTest programs (17 classes with GuiProtocolTest) move to src/test and run under ./gradlew test. One run now reports every failing check, instead of stopping at the first failed task.

  • Each main becomes a @Test method. BlockEntitiesTest.standaloneMachine and GuiProtocolTest (called from ScreenLoaderTest) become tests of their own. The check bodies are unchanged apart from dropping the "passed" prints.
  • The builderTest source set and its 16 verify* JavaExec tasks are gone. The test task sets mmdlib.resources and mmdlib.generated for VanillaExamplesTest and RuntimeBehaviorTest.
  • Docs that named the old tasks now name the test classes, and the CI comment and build.gradle no longer mention them.

Review notes

  • One commit, rebased onto the merged Machine recipe types: datapack loading, lookup, datagen and JEI #83. Most of the diff is file renames, so "hide whitespace" and the renames view should make it quick.
  • These are still long tests. Most of these classes are one @Test that stops at its first failed check, because I moved them as they were. Failures across classes are all reported now, but a class still stops at its first. I'd split them up when they next change, rather than in this PR.
  • They now share one JVM, where each used to get its own. See the random-order run below.
  • build still doesn't run any of this, as on Test infrastructure: JUnit 5, game tests and CI #82. It's all on ./gradlew check.

Testing

  • ./gradlew check passes locally: 70 unit tests with no failures, and all 18 game tests.
  • The unit tests also pass with classes and methods in four random orders, each starting from a different class, so they don't depend on running order or on each other's state.
  • check got a little faster, because 16 forked JVMs became one: 1m 7s down to 52s, and 55 tasks down to 38. That's one local --rerun-tasks run each, so treat it as a rough figure.
  • I didn't run the GUI smoke test locally. It's unaffected by this change, and the CI job on this PR covers it.

🤖 Generated with Claude Code

https://claude.ai/code/session_018zpP6ZrFjaGe477FvWAZKo

The 16 builderTest programs (17 classes with GuiProtocolTest) move to
src/test and run under ./gradlew test, so one run reports every failing
check instead of stopping at the first failed task.

- Each main becomes a @test method; BlockEntitiesTest.standaloneMachine
  and GuiProtocolTest (called from ScreenLoaderTest) become tests of their
  own. The check bodies are unchanged apart from dropping the "passed"
  prints.
- The builderTest source set and its 16 verify* JavaExec tasks are gone;
  the test task sets mmdlib.resources and mmdlib.generated for
  VanillaExamplesTest and RuntimeBehaviorTest.
- Docs that named the old tasks now name the test classes, and the CI
  comment and build.gradle no longer mention them.

The checks passed in one JVM with classes and methods in four random orders
(they used to run in separate JVMs).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018zpP6ZrFjaGe477FvWAZKo
@dshadowwolf
dshadowwolf merged commit d30d142 into master-2.0-1.21.1-neo Nov 2, 2026
3 checks passed
@faceofcat
faceofcat deleted the junit-builder-checks branch November 2, 2026 19:06
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