Repository navigation
Fix go-archive PATH stubbing for cross-platform tests - #9656
Merged
taylorsilva merged 1 commit intoJul 28, 2026
Merged
taylorsilva merged 1 commit into
taylorsilva merged 1 commit into
Conversation
Replace PATH=/dev/null with GinkgoT().Setenv + TempDir so missing tar/unzip lookups fail the same way on every platform, and PATH is restored automatically after each spec.
aliculPix4D
commented
Jul 23, 2026
|
|
||
| AfterEach(func() { | ||
| Expect(os.Setenv("PATH", oldPATH)).To(Succeed()) | ||
| // Set PATH to a temporary directory to ensure that the tar executable |
Contributor
Author
There was a problem hiding this comment.
I wonder if a comment is even required here, honestly.
Contributor
Author
aliculPix4D
commented
Jul 23, 2026
| // will not be found. The directory must exist, so that the lookup fails | ||
| // identically on every platform. GinkgoT().Setenv will restore PATH after | ||
| // the spec. | ||
| GinkgoT().Setenv("PATH", GinkgoT().TempDir()) |
Contributor
Author
There was a problem hiding this comment.
Thanks to @marco-m-pix4d for suggesting this.
marco-m
reviewed
Jul 23, 2026
Comment on lines
+147
to
+150
| // Set PATH to a temporary directory to ensure that the tar executable | ||
| // will not be found. The directory must exist, so that the lookup fails | ||
| // identically on every platform. GinkgoT().Setenv will restore PATH after | ||
| // the spec. |
Contributor
There was a problem hiding this comment.
Maybe the first comment in the file is enough.
I don't have a strong opinion.
taylorsilva
approved these changes
Jul 27, 2026
taylorsilva
left a comment
Member
There was a problem hiding this comment.
Comments do read as repetitive, but I'm fine with allowing this in the tests.
Member
|
Re-running checks |
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.
Fix go-archive PATH stubbing for cross-platform tests
Replace
PATH=/dev/nullwithGinkgoT().Setenv + TempDirso missingtar/unziplookups fail the same way on every platform, andPATHis restored automatically after each spec.