Skip to content

feat: launch a Minecraft client in CI to verify the mod works in-game#22

Merged
dsnsgithub merged 4 commits into
mainfrom
claude/fabric-launch-test-ci-15ditk
Jul 2, 2026
Merged

feat: launch a Minecraft client in CI to verify the mod works in-game#22
dsnsgithub merged 4 commits into
mainfrom
claude/fabric-launch-test-ci-15ditk

Conversation

@dsnsgithub

@dsnsgithub dsnsgithub commented Jul 2, 2026

Copy link
Copy Markdown
Owner

Summary

CI now verifies the mod in a real running game. On every push, the workflow builds the jar, boots a production Fabric client (Minecraft 26.2 + Fabric Loader with Fabric API, Mod Menu, and Cloth Config as real mod jars) under a virtual display, generates and enters a survival singleplayer world with the HUD active, and fails the build if the game crashes anywhere along the way. The in-world screenshot is posted on the pull request as a quick visual sanity check.

Key Changes

  • CI workflow (.github/workflows/build.yml)
    • Installs Xvfb and runs the new runProductionClientGameTest Gradle task after the build
    • Posts (and keeps updated) a single PR comment embedding the in-world screenshot; images are stored per commit on the ci-screenshots branch so older comments keep rendering
    • Uploads game logs and screenshots as a client-launch-test artifact, including on failure, for easy crash diagnosis
    • Adds workflow-level contents: write / pull-requests: write permissions for the screenshot step, and renames all steps to consistent title case
  • Build configuration (build.gradle)
    • Registers runProductionClientGameTest (Loom ClientProductionRunTask), which launches a production client with the built mod jar, the dependency mods from the new productionRuntimeMods configuration, and the gametest mod; on Linux CI Loom runs it under Xvfb automatically
    • Wires a gametest source set via fabricApi.configureTests and packages it as gametestJar
  • Client gametest (src/gametest/)
    • Screenshots the title screen, creates a survival-mode singleplayer world, waits for chunks to render, lets the world tick with the HUD rendering, and screenshots it
    • Asserts both screenshot PNGs actually exist and are non-empty, so a green build guarantees the captures were taken
  • Dependencies (gradle.properties)
    • Mod Menu 18.0.0-alpha.8 → 20.0.0-alpha.1 and Cloth Config 26.1.154 → 26.2.155: the launch test caught that the older Mod Menu versions crash Minecraft 26.2 at the title screen (NoSuchMethodError: I18n.exists in its TitleScreen mixin)

Notes

  • The test world uses the gametest framework's default flat terrain for speed and determinism; survival game mode is confirmed by the health/hunger bars in the capture
  • Rendering on CI uses Mesa's software OpenGL under Xvfb; audio, narrator, and Realms warnings in the logs are expected in that headless environment and are non-fatal
  • With warm Gradle caches the launch test adds roughly a minute to the workflow

🤖 Generated with Claude Code

https://claude.ai/code/session_01HqYsmitMrdZZBkd7zHTgYA

claude added 3 commits July 2, 2026 11:11
Registers a runProductionClientGameTest Loom task that boots a real
production Fabric client (fabric-loader + the built jar + fabric-api,
modmenu and cloth-config via productionRuntimeMods) under XVFB and
fails if the game does not reach the title screen and exit cleanly.
The build workflow now runs it after the build and uploads the game
logs and screenshots as artifacts.

Also bumps modmenu to 20.0.0-alpha.1 and cloth-config to 26.2.155:
the launch test caught that modmenu 18.x/19.x crash on Minecraft 26.2
at the title screen (NoSuchMethodError: I18n.exists in its TitleScreen
mixin).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HqYsmitMrdZZBkd7zHTgYA
Adds a client gametest mod (gametest source set) that the production
launch task now loads alongside the built jar. The test screenshots the
title screen, creates a survival singleplayer world, waits for chunks
to render and the world to tick with the HUD active, screenshots it,
then exits. Any crash on the way fails the build, and the screenshots
are uploaded with the existing client-launch-test artifact.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HqYsmitMrdZZBkd7zHTgYA
The gametest now fails if takeScreenshot did not produce a non-empty
PNG. The workflow gains a step that publishes the survival world
screenshot to a ci-screenshots branch and keeps a single PR comment
updated with it as a visual sanity check.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HqYsmitMrdZZBkd7zHTgYA
@dsnsgithub dsnsgithub changed the title Add production client launch test to CI pipeline feat: add Minecraft Client automated CI tests Jul 2, 2026
@dsnsgithub dsnsgithub changed the title feat: add Minecraft Client automated CI tests feat: add automated CI tests by launching a Minecraft instance Jul 2, 2026
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown

Client launch test

The game launched and entered a survival singleplayer world on efad29b:

BetterHUD in a survival world

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HqYsmitMrdZZBkd7zHTgYA
@dsnsgithub dsnsgithub changed the title feat: add automated CI tests by launching a Minecraft instance feat: launch a Minecraft client in CI to verify the mod works in-game Jul 2, 2026
@dsnsgithub dsnsgithub merged commit 5bfac3a into main Jul 2, 2026
1 check passed
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