Skip to content

test(ship): give Verify_JSON an isolated root so it passes on main - #50

Merged
teragrid merged 1 commit into
mainfrom
feature/fix-verify-json-test-root
Sep 21, 2026
Merged

teragrid merged 1 commit into
mainfrom
feature/fix-verify-json-test-root

Conversation

@teragrid

Copy link
Copy Markdown
Owner

This PR addresses:
The one failing test on main (76 of 77 packages pass), and the reason the nightly macOS/Windows jobs are red. Recorded as "deliberately not changed" in the 1.10.9 CHANGELOG.

Scope

  • Bug fix
  • New feature (core)
  • New feature (plugin)
  • Documentation / Docs
  • Refactor / Tooling

Checklist

  • Tests added: this is a test fix. Before/after on a main checkout: fails without the change, passes with it (TestCmd_Subcommand_Verify_JSON); whole cmdship package passes under -race.
  • Fixes: #NNN: n/a
  • Signed-off-by: git commit -s
  • Pre-push checklist: golangci-lint/govulncheck not installed locally; left to CI.

Description

TestCmd_Subcommand_Verify_JSON ran verify without --root, so it inspected the checkout it runs in. Since 1.10.8, ship warns "nothing to ship" on any checkout with no diff against main, so the test passed on branches with unmerged commits and failed on main itself: at 22ff658 (the v1.10.8 release commit), at v1.10.9, and in the nightly. It passed in PR CI only because PR branches have changes.

The fix passes --root t.TempDir(), as the neighbouring tests in the file already do. Test-only; no production code touched.

🤖 Generated with Claude Code

TestCmd_Subcommand_Verify_JSON ran `verify` without --root, so it inspected the
checkout it runs in. Since 1.10.8 ship warns "nothing to ship" on any checkout with no
diff against main, so the test passed on branches with unmerged commits and failed on
main itself: at 22ff658 (the v1.10.8 release commit), at v1.10.9, and in the nightly
macOS/Windows jobs. Use t.TempDir() as the root, as the neighbouring tests do.

Verified: fails without the change on a main checkout, passes with it; the whole cmdship
package passes under -race.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Signed-off-by: VietKing <likeawind510@gmail.com>
@teragrid
teragrid merged commit 2c81f41 into main Sep 21, 2026
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants