Skip to content

Commit ad37ce2

Browse files
authored
ci: catch new untracked files after running tests (#5412)
The `designer_notebook` acceptance test (added in #5370) was missing its generated `out.test.toml`. The file is written as a side effect of test discovery and explicitly excluded from output comparison, so a missing copy never fails a test — and the post-test `git diff --exit-code` guard didn't catch it either, because plain `git diff` ignores untracked files. The result: the file silently regenerated as an untracked change in every worktree that ran the acceptance suite. This adds the missing `out.test.toml` and fixes the CI guard to register untracked files with `git add --intent-to-add .` before diffing, so any new file appearing after a test run now fails the build. Gitignored test artifacts are unaffected, since intent-to-add respects `.gitignore`. This pull request and its description were written by Isaac.
1 parent 47079b9 commit ad37ce2

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

.github/workflows/push.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,15 @@ jobs:
152152
if-no-files-found: warn
153153
retention-days: 7
154154

155-
- name: Check out.test.toml files are up to date
155+
- name: Check no files changed or appeared after running tests
156156
run: |
157+
# Register untracked files with intent-to-add so `git diff` reports them
158+
# too; a plain `git diff` ignores new files, which is how a missing
159+
# out.test.toml previously slipped through. Ignored test artifacts are
160+
# unaffected because intent-to-add respects .gitignore.
161+
git add --intent-to-add .
157162
if ! git diff --exit-code; then
158-
echo "ERROR: detected changed files in the repository; Most likely you have out.test.toml files that are out of date. Run 'go test ./acceptance -run \"^TestAccept$\" -only-out-test-toml' to update."
163+
echo "ERROR: detected changed or new files in the repository; Most likely you have out.test.toml files that are out of date. Run 'go test ./acceptance -run \"^TestAccept$\" -only-out-test-toml' to update."
159164
exit 1
160165
fi
161166

acceptance/bundle/paths/designer_notebook/out.test.toml

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)