Skip to content

Latest commit

 

History

History
74 lines (61 loc) · 4.47 KB

README.md

File metadata and controls

74 lines (61 loc) · 4.47 KB

MC-Runtime-Test-Mods

Mods for Mc-Runtime-Test.

MC-Runtime-Test | HMC | HMC-Specifics | HMC-Optimizations

GitHub All Releases GitHub Github last-commit

Warning

NOT AN OFFICIAL MINECRAFT PRODUCT. NOT APPROVED BY OR ASSOCIATED WITH MOJANG OR MICROSOFT.

This is a set of mods developed for the mc-runtime-test Github action. The action allows you to run the Minecraft Java client inside your Github CI/CD pipeline for testing purposes.

The mods in this repository all do the same thing: When the game is ready, they join a SinglePlayer world, possibly execute all registered gametests and then exit the game signaling success or failure via the exit code.

Mc-Runtime-Test-Mods can be configured via a few System properties. These are listed and documented here. You can set these properties in the mc-runtime-test action with the headlessmc-command input, like this:

uses: 3arthqu4ke/[email protected]
with:
  mc: 1.21.4
  modloader: fabric
  regex: .*fabric.*
  mc-runtime-test: fabric
  java: ${{ env.java_version }}
  headlessmc-command: -lwjgl --retries 2 --jvm "-D<systemProperty>=<value> -Djava.awt.headless=true"

If you run the game with xvfb the -lwjgl flag is not needed. For more information how the command works checkout the headlessmc launcher that mc-runtime-test uses.

The Mc-Runtime-Test-Mod has been written with unimined which allows us to support forge, neoforge and fabric. Additionally, we use manifold for its Java Pre-Processor, which allows us to support all the following Minecraft versions within one code base:

Version Forge Fabric NeoForge
1.21 - 1.21.3
1.20.2 - 1.20.6
1.20.1 ⚠️
1.19 - 1.19.4 -
1.18.2 -
1.17.1 -
1.16.5 -
1.12.2 ⚠️ -
1.8.9 ⚠️ -
1.7.10 ⚠️ -

Versions marked with ⚠️ have not been tested yet, HeadlessMc should support them, though.

Running your own tests

MC-Runtime-Test does not provide a framework for full integration tests. You can, however, use Minecraft's own Game-Test Framework. MC-Runtime-Test will basically execute the /test runall command after joining the world. On Neoforge/Lexforge gametest discovery does really not work in production, you might need to register them themselves and use other hacks to get the structure templates correctly, but we are working on it. You can also use the headlessmc-command input to specify additional SystemProperties with the --jvm flag. E.g. -DMcRuntimeGameTestMinExpectedGameTests=<int> to specify how many gametests you expect to be executed at minimum and otherwise fail if not enough gametests have been found.