Caleb Cushing
09/18/2025, 10:56 AMVampire
09/18/2025, 11:13 AMExecution failed for task ':test'.
> There are test sources present and no filters are applied, but the test task did not discover any tests to execute. This is likely due to a misconfiguration. Please check your test configuration. If this is not a misconfiguration, this error can be disabled by setting the 'failOnNoDiscoveredTests' property to false.
Caleb Cushing
09/18/2025, 11:14 AMVampire
09/18/2025, 11:14 AMNO-SOURCECaleb Cushing
09/18/2025, 11:15 AMCaleb Cushing
09/18/2025, 11:15 AMVampire
09/18/2025, 11:16 AMCaleb Cushing
09/18/2025, 11:16 AMVampire
09/18/2025, 11:16 AM--tests or similar filtering and no test is found it also failsCaleb Cushing
09/18/2025, 11:16 AMVampire
09/18/2025, 11:17 AMCaleb Cushing
09/18/2025, 11:18 AMVampire
09/18/2025, 11:18 AMVampire
09/18/2025, 11:18 AMCaleb Cushing
09/18/2025, 11:18 AMVampire
09/18/2025, 11:18 AM@SkipWhenEmpty if there are no files to testCaleb Cushing
09/18/2025, 11:19 AMVampire
09/18/2025, 11:19 AMVampire
09/18/2025, 11:19 AMCaleb Cushing
09/18/2025, 11:19 AMVampire
09/18/2025, 11:19 AMCaleb Cushing
09/18/2025, 11:19 AMCaleb Cushing
09/18/2025, 11:19 AMCaleb Cushing
09/18/2025, 11:20 AMCaleb Cushing
09/18/2025, 11:20 AMVampire
09/18/2025, 11:21 AMCaleb Cushing
09/18/2025, 11:22 AMCaleb Cushing
09/18/2025, 11:22 AMCaleb Cushing
09/18/2025, 11:22 AMVampire
09/18/2025, 11:23 AMmaybe tasks in general should fail if they need inputs and have noneusing
tasks.configureEach {
inputs.file(buildFile).skipWhenEmpty()
}
because a task is only skipped for NO-SOURCE if all @SkipWhenEmpty inputs are empty.Caleb Cushing
09/18/2025, 11:23 AMCaleb Cushing
09/18/2025, 11:24 AMVampire
09/18/2025, 11:24 AMbuildFile actually existsCaleb Cushing
09/18/2025, 11:24 AMVampire
09/18/2025, 11:26 AMtasks.configureEach {
val fakeFke = Files.createTempFile("fake", ".fke")
fakeFke.toFile().deleteOnExit()
inputs.file(fakeFke).skipWhenEmpty()
}
for exampleCaleb Cushing
09/18/2025, 11:27 AMval available =
tasks.register("tests available") {
val java: Provider<FileCollection> = sourceSets.test.map { it.java }
doLast {
if (java.get().isEmpty) throw RuntimeException("no tests found")
}
}
inputs.dir(rootProject.file("buildSrc/src/main"))
finalizedBy(available)
afterSuite(
KotlinClosure2<TestDescriptor, TestResult, Unit>(
{ descriptor, result ->
if (descriptor.parent == null) {
logger.lifecycle("Tests run: ${result.testCount}, Failures: ${result.failedTestCount}, Skipped: ${result.skippedTestCount}")
if (result.testCount == 0L) throw IllegalStateException("You cannot have 0 tests")
}
Unit
},
),
)Vampire
09/18/2025, 11:28 AMI'll figure out how to keep this stuff up laterUhm, didn't I just tell you how?
Caleb Cushing
09/18/2025, 11:29 AMCaleb Cushing
09/18/2025, 11:29 AM