Skip to content

Commit b6edcf8

Browse files
authored
acceptance: fix force_pull_commands test on macOS (#5212)
## Why The acceptance test added in #5028 was merged with CI red on every platform. Two follow-up issues: 1. **macOS**: the script bails at the first `print_requests.py` call because `bundle summary` without `--force-pull` makes zero HTTP requests, so `out.requests.txt` is never created after the `rm -f` earlier in the script. `print_requests.py` then exits with `File [TEST_TMP_DIR]/out.requests.txt not found`, and the rest of the script never runs. The test only runs on darwin (`GOOS.windows = false`, `GOOS.linux = false`), so this manifested as a macOS-only failure. 2. **Linux/Windows**: the post-test `git diff --exit-code` check fails because `out.test.toml` was checked in using the older `[GOOS]` / `[EnvMatrix]` table form, but the framework now serializes those keys in dotted form. ## Changes **Before:** `bundle summary` (no `--force-pull`) makes 0 requests, file is missing, `print_requests.py` exits 1, the rest of the test never runs. **Now:** `touch out.requests.txt` before each `print_requests.py` call so the helper sees an empty file and prints nothing, matching the expected output. Also regenerate `out.test.toml` so it matches the current serialization format. ## Test plan - [x] `go test ./acceptance -run "TestAccept/bundle/state/force_pull_commands" -v` passes locally on darwin (both `direct` and `terraform` engines) - [x] `go test ./acceptance -run "^TestAccept$" -only-out-test-toml` produces no further diff - [x] `./task checks` clean This pull request and its description were written by Isaac.
1 parent f0edaa4 commit b6edcf8

2 files changed

Lines changed: 11 additions & 7 deletions

File tree

acceptance/bundle/state/force_pull_commands/out.test.toml

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

acceptance/bundle/state/force_pull_commands/script

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,26 @@ rm -f out.requests.txt
44
title "Modify PATH so that real open is not run"
55
export PATH=.:$PATH
66

7+
# touch out.requests.txt before each print_requests.py call: the commands without
8+
# --force-pull make zero HTTP requests, so the file is never created and
9+
# print_requests.py would otherwise exit with "File not found".
10+
711
title "bundle summary without --force-pull: no remote state read\n"
812
trace $CLI bundle summary > /dev/null
13+
touch out.requests.txt
914
print_requests.py --get //workspace-files/
1015

1116
title "bundle summary --force-pull: remote state read\n"
1217
trace $CLI bundle summary --force-pull > /dev/null
18+
touch out.requests.txt
1319
print_requests.py --get //workspace-files/
1420

1521
title "bundle open without --force-pull: no remote state read\n"
1622
musterr trace $CLI bundle open foo > /dev/null
23+
touch out.requests.txt
1724
print_requests.py --get //workspace-files/
1825

1926
title "bundle open --force-pull: remote state read\n"
2027
musterr trace $CLI bundle open foo --force-pull > /dev/null
28+
touch out.requests.txt
2129
print_requests.py --get //workspace-files/

0 commit comments

Comments
 (0)