QuiltMC / quilt-standard-libraries

A set of libraries to assist in making Quilt mods.
Apache License 2.0
152 stars 85 forks source link

Game Test API crashing regular runs with seperated source sets. #351

Closed JustPyrrha closed 8 months ago

JustPyrrha commented 11 months ago

When separating gametest code into its own source set, as the javadocs suggest, the testing library still trys to load the gametest entrypoint during regular runs causing a crash.

Expected Behaviour

The testing library only attempts to load quilt:game_test entrypoints when the quilt.game_test property is set to true.

Actual Behaviour

The testing library always trys to load quilt:game_test entrypoints during its own init entrypoint without checking if its a testing run.

Replication Steps

  1. Clone https://github.com/JustPyrrha/qsl-testing-bug (minimal replication project)
  2. Run either of the standard client or server runs.

Tested in both dev and prod environments. Dev using the above project with only qsl_base and testing (6.1.2+1.20.1), and prod using the above project and the latest qsl from modrinth (7.4.0+0.90.0-1.20.1).

LambdAurora commented 11 months ago

You're supposed to create a new QMJ file in the separate source set as if it was a new mod (like it is done in QSL).

JustPyrrha commented 11 months ago

ah that makes more sense, though the separate qmj isn't mentioned in the javadocs so that might be worth updating.

 * <p>
 * <h3>Get Started</h3>
 * Writing tests for your mod is relatively simple: create a new class that extends {@link org.quiltmc.qsl.testing.api.game.QuiltGameTest}, and add it
 * as an entrypoint of key {@value org.quiltmc.qsl.testing.api.game.QuiltGameTest#ENTRYPOINT_KEY}.
 * <p>