diff --git a/.gitignore b/.gitignore index 122dbbe7..ae53be55 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,14 @@ build/ .settings/ # jqwik property-test runtime state .jqwik-database +# ApprovalTests writes .received. next to each .approved. snapshot, under the +# test's source folder, when it compares and deletes it when they match; a failed comparison leaves +# it behind. Approve by copying it over the approved file, never by committing it. Only Java source +# folders: fixtures elsewhere may carry ".received." in their names. An approved snapshot is never +# ignored, even when a test parameter puts ".received." into its name; in turn a received file whose +# parameter puts ".approved." into its name shows up in `git status`. +src/**/src/*/java/**/*.received.* +!src/**/src/*/java/**/*.approved.* .DS_Store # Local Claude Code state (worktrees, settings.local.json, notes) stays out. The shared project # settings, path rules, skills and subagent definitions are committed: everyone who opens the repository gets them (CLAUDE.md). diff --git a/src/bootstrap/app/build.gradle b/src/bootstrap/app/build.gradle index cfefa7b2..4bf8e1e7 100644 --- a/src/bootstrap/app/build.gradle +++ b/src/bootstrap/app/build.gradle @@ -347,9 +347,9 @@ def repositoryRootForContractTests = rootProject.projectDir // fresh checkout (the files carry their source's modification time). // Every whole-repository file-tree input below also leaves directories out: Gradle then drops every // directory entry, not only empty ones, and keeps the files. :app-bootstrap:test writes -// .approval_tests_temp/ here (ApprovalTests' .gitignore, logs and the scripts it downloads) when it -// executes, not when it comes from the cache, so the architecture and repository-contract keys -// followed whether the same build had executed `test`, and a pull request missed main's entries. +// .approval_tests_temp/ here (ApprovalTests' .gitignore and logs) when it executes, not when it comes +// from the cache, so the architecture and repository-contract keys followed whether the same build +// had executed `test`, and a pull request missed main's entries. // No include reaches those files today; the exclude keeps it that way when an include widens. // These lanes judge files, not directories. The one directory rule, no subdirectory and no unknown // file under docs/registries, keeps its own input (registryCatalog). @@ -452,6 +452,21 @@ tasks.named('test', Test) { .ignoreEmptyDirectories() .withPropertyName('approvedSnapshots') } +// ApprovalTests (EnvelopeContractTest) writes its logs to .approval_tests_temp/ in this leaf, the +// working directory, on every comparison. Unless told not to, it also downloads two helper scripts +// (approve_all.py, remove_abandoned_files.py) from the main branch of a GitHub repository into the +// same folder and marks them executable (org.approvaltests.internal.logs.LoggingUtils): the test +// reached outside the network and left unpinned fetched executables in the source tree. The library +// reads only this environment variable for it, no system property or package setting. Every Test +// task of this leaf gets it, not only `test`: the tag lanes run classes of the same source set and +// architectureTest has its runtime classpath, ApprovalTests included. The folder and its logs stay: +// Git ignores them (the library writes a .gitignore of `*` there) and the whole-repository inputs +// above exclude them. The library fetches a script only when it is missing, so a checkout that ran +// the tests before keeps the two it fetched until .approval_tests_temp/ is removed. A run from an +// IDE, without this setting, still downloads them. +tasks.withType(Test).configureEach { + environment 'APPROVALTESTS_DISABLE_SCRIPT_DOWNLOADS', '1' +} // 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