Draft
Enhance test coverage for ModStitch gradle plugin across all platforms#37
Conversation
…l platforms Co-authored-by: isXander <43245524+isXander@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Improve the test coverage of this gradle plugin. View the extension Modstitch and its nested API. This will provide you with a documented feature-set of the gradle plugin.
Understand that this plugin is a thin abstraction layer on top of the two Minec...
Enhance test coverage for ModStitch gradle plugin across all platforms
Aug 7, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR significantly improves the test coverage of the ModStitch gradle plugin by adding comprehensive integration tests that validate the documented feature-set across all three supported platforms: Fabric Loom, NeoForge MDG, and MDGLegacy.
Overview
ModStitch is a thin abstraction layer on top of Minecraft mod-loader gradle plugins, providing a unified API for building mods across different platforms. The existing test coverage was minimal and didn't comprehensively validate the broad feature set documented in the
ModstitchExtensionAPI.What's Added
8 New Comprehensive Test Classes
CoreConfigurationTests - Tests core configuration features:
MetadataManifestTests - Tests metadata and manifest generation:
fabric.mod.json,neoforge.mods.toml,mods.toml)MixinConfigurationTests - Tests mixin integration:
ParchmentConfigurationTests - Tests parchment mappings:
ProxyConfigurationTests - Tests dependency abstraction:
modstitchImplementationvsmodstitchModImplementationRunConfigurationTests - Tests run configuration setup:
JarInspectionTests - Tests built artifact validation using JAR inspection:
ExtensionIntegrationTests - Tests extension integration:
UnitTestingIntegrationTests - Tests unit testing functionality:
Platform Coverage
Each test is implemented across all three supported platforms with appropriate tags:
@Tag("loom")- Fabric Loom tests@Tag("mdg")- NeoForge ModDevGradle tests@Tag("mdgl")- Legacy Forge ModDevGradle testsThis ensures platform parity and validates that the abstraction layer works consistently across all mod loaders.
Key Testing Techniques
JarFileto inspect built JAR contents and validate structureBenefits
ModstitchExtensionAPIThe test suite follows the request for "fewer tests but broader feature coverage" by creating focused integration tests that validate complete workflows rather than many small unit tests. The JAR inspection technique specifically addresses the requirement to validate built artifacts are structured correctly.
Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
maven.fabricmc.net/usr/lib/jvm/temurin-17-jdk-amd64/bin/java --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.xml/javax.xml.namespace=ALL-UNNAMED -Xmx4G -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant -cp /home/REDACTED/.gradle/wrapper/dists/gradle-8.14.3-all/10utluxaxniiv4wxiphsi49nj/gradle-8.14.3/lib/gradle-daemon-main-8.14.3.jar -javaagent:/home/REDACTED/.gradle/wrapper/dists/gradle-8.14.3-all/10utluxaxniiv4wxiphsi49nj/gradle-8.14.3/lib/agents/gradle-instrumentation-agent-8.14.3.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 8.14.3(dns block)maven.neoforged.net/usr/lib/jvm/temurin-17-jdk-amd64/bin/java --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.xml/javax.xml.namespace=ALL-UNNAMED -Xmx4G -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant -cp /home/REDACTED/.gradle/wrapper/dists/gradle-8.14.3-all/10utluxaxniiv4wxiphsi49nj/gradle-8.14.3/lib/gradle-daemon-main-8.14.3.jar -javaagent:/home/REDACTED/.gradle/wrapper/dists/gradle-8.14.3-all/10utluxaxniiv4wxiphsi49nj/gradle-8.14.3/lib/agents/gradle-instrumentation-agent-8.14.3.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 8.14.3(dns block)If you need me to access, download, or install something from one of these locations, you can either:
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.