diff --git a/src/bootstrap/app/build.gradle b/src/bootstrap/app/build.gradle index d00bc45f..cfefa7b2 100644 --- a/src/bootstrap/app/build.gradle +++ b/src/bootstrap/app/build.gradle @@ -440,6 +440,18 @@ tasks.named('architectureTest', Test) { tasks.named('conditionalTransportBuildContractTest', Test) { inputs.file('build.gradle').withPathSensitivity(PathSensitivity.RELATIVE).withPropertyName('buildScript') } +// The ApprovalTests snapshot tests (EnvelopeContractTest) compare what they build with the +// *.approved.* files beside their sources. Gradle compiles only the .java files under src/test/java +// and copies only src/test/resources, so without this input a change to a snapshot alone left `test` +// up to date or let it come from the build cache: the comparison did not run and the build passed. +// The .received.* files next to them are output, not input: every comparison writes one, a passing +// comparison deletes it and a failing one leaves it behind. +tasks.named('test', Test) { + inputs.files(fileTree('src/test/java') { include '**/*.approved.*' }) + .withPathSensitivity(PathSensitivity.RELATIVE) + .ignoreEmptyDirectories() + .withPropertyName('approvedSnapshots') +} // Fast developer test lane. Whole-repository ArchUnit graphs and full composition-root boot // characterizations have their own source sets, so the ordinary lane does not compile or execute