test(ship): give Verify_JSON an isolated root so it passes on main - #50
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Checklist
TestCmd_Subcommand_Verify_JSON); wholecmdshippackage passes under-race.git commit -sgolangci-lint/govulnchecknot installed locally; left to CI.Description
TestCmd_Subcommand_Verify_JSONranverifywithout--root, so it inspected the checkout it runs in. Since 1.10.8,shipwarns "nothing to ship" on any checkout with no diff againstmain, so the test passed on branches with unmerged commits and failed onmainitself: at22ff658(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