Skip to content

Commit

Permalink
Add tests for configure on demand
Browse files Browse the repository at this point in the history
  • Loading branch information
modmuss50 committed Oct 10, 2024
1 parent ca9ed47 commit 12811c2
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,14 @@ import static org.gradle.testkit.runner.TaskOutcome.SUCCESS

@Timeout(value = 30, unit = TimeUnit.MINUTES)
class FabricAPITest extends Specification implements GradleProjectTestTrait {
public static final String COMMIT = "41bc64cd617f03d49ecc4a4f7788cb65d465415c"

@Unroll
def "build and run (gradle #version, mixin ap disabled: #disableMixinAp)"() {
setup:
def gradle = gradleProject(
repo: "https://github.com/FabricMC/fabric.git",
commit: "41bc64cd617f03d49ecc4a4f7788cb65d465415c",
commit: COMMIT,
version: version,
patch: "fabric_api"
)
Expand Down Expand Up @@ -127,4 +129,34 @@ class FabricAPITest extends Specification implements GradleProjectTestTrait {
[false, true].shuffled()
].combinations()
}

@Unroll
def "configure on demand (gradle #version)"() {
setup:
def gradle = gradleProject(
repo: "https://github.com/FabricMC/fabric.git",
commit: COMMIT,
version: version,
patch: "fabric_api"
)

when:
def result = gradle.run(
tasks: [
"fabric-resource-loader-v0:clean",
"fabric-resource-loader-v0:build"
],
args: [
"--parallel",
"--configure-on-demand",
],
configurationCache: false
)

then:
result.task(":fabric-resource-loader-v0:build").outcome == SUCCESS

where:
version << STANDARD_TEST_VERSIONS
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,19 @@ class MultiProjectTest extends Specification implements GradleProjectTestTrait {
where:
version << STANDARD_TEST_VERSIONS
}

@Unroll
def "configure on demand (gradle #version)"() {
setup:
def gradle = gradleProject(project: "multiproject", version: version)
when:
def result = gradle.run(tasks: [":core:build"], args: ["--configure-on-demand"])
then:
result.task(":core:build").outcome == SUCCESS
where:
version << STANDARD_TEST_VERSIONS
}
}

0 comments on commit 12811c2

Please sign in to comment.