mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-10-26 14:00:26 +00:00
Run modded and buildSrc tests
- Add a root moddedTest that runs adapters/modded-common through the Fabric build - Make check depend on moddedTest, ordered ahead of the loader jars - Gate the buildSrc jar on the buildSrc tests so they stop being skipped - Drop an unreachable classpath guard from SchemaBuilderPlatformIsolationTest
This commit is contained in:
1 parent
89dc5d0447
commit
7841efed54
3 files changed
+56
-3
No files matched your search
-3
@@ -13,13 +13,10 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.junit.Assert.assertThrows;
|
|
||||||
|
|
||||||
public class SchemaBuilderPlatformIsolationTest {
|
public class SchemaBuilderPlatformIsolationTest {
|
||||||
@Test
|
@Test
|
||||||
public void enumSchemaDoesNotResolveBukkitOnlyMethodSignatures() {
|
public void enumSchemaDoesNotResolveBukkitOnlyMethodSignatures() {
|
||||||
assertThrows(ClassNotFoundException.class, () -> Class.forName("org.bukkit.block.BlockFace"));
|
|
||||||
|
|
||||||
JSONObject schema = new SchemaBuilder(DirectionModel.class, null).construct();
|
JSONObject schema = new SchemaBuilder(DirectionModel.class, null).construct();
|
||||||
JSONObject direction = schema.getJSONObject("properties").getJSONObject("direction");
|
JSONObject direction = schema.getJSONObject("properties").getJSONObject("direction");
|
||||||
String definitionKey = direction.getString("$ref").substring("#/definitions/".length());
|
String definitionKey = direction.getString("$ref").substring("#/definitions/".length());
|
||||||
|
|||||||
@@ -446,6 +446,56 @@ tasks.named('neoforgeJar').configure {
|
|||||||
mustRunAfter(tasks.named('forgeJar'))
|
mustRunAfter(tasks.named('forgeJar'))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// adapters/modded-common has no build of its own: its sources are compiled by each loader wrapper, so
|
||||||
|
// its tests only run when one of those wrappers is asked for `test`. The Fabric wrapper is the one
|
||||||
|
// that runs them as plain JUnit - NeoForge's moddev unit-test harness boots the mod through FML's
|
||||||
|
// transforming class loader and dies on a split-package ServiceConfigurationError before any test
|
||||||
|
// starts. One loader is enough: the sources are identical across all three.
|
||||||
|
tasks.register('moddedTest', Exec) {
|
||||||
|
group = 'verification'
|
||||||
|
description = 'Runs the adapters/modded-common test suite through the Fabric adapter build.'
|
||||||
|
workingDir = layout.projectDirectory.dir('adapters/fabric').asFile
|
||||||
|
String wrapperScript = System.getProperty('os.name').toLowerCase().contains('windows') ? 'gradlew.bat' : 'gradlew'
|
||||||
|
List<String> command = [
|
||||||
|
layout.projectDirectory.file(wrapperScript).asFile.absolutePath,
|
||||||
|
'test',
|
||||||
|
'--console=plain',
|
||||||
|
"-PirisVersion=${project.version}",
|
||||||
|
"-PminecraftVersion=${minecraftVersion}",
|
||||||
|
"-PfabricLoaderVersion=${fabricLoaderVersion}",
|
||||||
|
"-PuseLocalVolmLib=${useLocalVolmLib}",
|
||||||
|
"-PvolmLibCoordinate=${volmLibCoordinate}"
|
||||||
|
]
|
||||||
|
if (localVolmLibDirectory != null && !localVolmLibDirectory.isBlank()) {
|
||||||
|
command.add("-PlocalVolmLibDirectory=${localVolmLibDirectory}")
|
||||||
|
}
|
||||||
|
commandLine(command)
|
||||||
|
inputs.files(moddedSharedInputs).withPropertyName('moddedSharedSources')
|
||||||
|
inputs.files(
|
||||||
|
layout.projectDirectory.file('adapters/fabric/src').asFile,
|
||||||
|
layout.projectDirectory.file('adapters/fabric/build.gradle').asFile,
|
||||||
|
layout.projectDirectory.file('adapters/fabric/settings.gradle').asFile
|
||||||
|
).withPropertyName('adapterSources')
|
||||||
|
inputs.property('irisVersion', project.version.toString())
|
||||||
|
inputs.property('minecraftVersion', minecraftVersion)
|
||||||
|
inputs.property('fabricLoaderVersion', fabricLoaderVersion)
|
||||||
|
inputs.property('useLocalVolmLib', useLocalVolmLib)
|
||||||
|
inputs.property('volmLibCoordinate', volmLibCoordinate)
|
||||||
|
inputs.property('localVolmLibCheckout', localVolmLibCheckout == null ? '' : localVolmLibCheckout.absolutePath)
|
||||||
|
outputs.dir(layout.projectDirectory.dir('adapters/fabric/build/test-results/test'))
|
||||||
|
mustRunAfter(tasks.named('jar'))
|
||||||
|
mustRunAfter(project(':core').tasks.named('check'))
|
||||||
|
mustRunAfter(project(':spi').tasks.named('jar'))
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.named('fabricJar').configure {
|
||||||
|
mustRunAfter(tasks.named('moddedTest'))
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.named('check').configure {
|
||||||
|
dependsOn('moddedTest')
|
||||||
|
}
|
||||||
|
|
||||||
List<String> commonModdedArtifactEntries = [
|
List<String> commonModdedArtifactEntries = [
|
||||||
'META-INF/iris/generation-kernels/catalog.tsv',
|
'META-INF/iris/generation-kernels/catalog.tsv',
|
||||||
'META-INF/iris/generation-kernels/abi-1.revision',
|
'META-INF/iris/generation-kernels/abi-1.revision',
|
||||||
|
|||||||
@@ -18,6 +18,12 @@ repositories {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Nothing else asks buildSrc for `test`: Gradle only requests the jar that carries the build logic.
|
||||||
|
// Gating the jar on the tests is what makes them run at all, and it costs nothing once they are green.
|
||||||
|
tasks.named('jar').configure {
|
||||||
|
dependsOn(tasks.named('test'))
|
||||||
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation(gradleApi())
|
implementation(gradleApi())
|
||||||
implementation('org.ow2.asm:asm:9.10.1')
|
implementation('org.ow2.asm:asm:9.10.1')
|
||||||
|
|||||||
Reference in new issue
Block a user