Conversation
Proxy config tests hardcoded PATH=/bin:/usr/bin for the child shell, which fails on distros like NixOS where core utilities live elsewhere. Ubuntu-based CI happened to have those tools at the hardcoded paths, masking the problem. Use the test runner's own PATH for the child process instead, and resolve bash via PATH rather than assuming /bin/bash. /bin/sh is left unchanged since it is a stable, portable path across supported platforms. Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Makes proxy-script tests portable across Linux distributions by avoiding hardcoded utility paths.
Changes:
- Resolve Bash through the inherited
PATH. - Pass the test runner鈥檚
PATHto isolated child environments.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
targets/linux/rpm/distro/zypper_install_test.go |
Makes Zypper proxy tests portable. |
targets/linux/rpm/distro/dnf_install_test.go |
Makes DNF proxy tests portable. |
targets/linux/deb/distro/install_test.go |
Inherits PATH in APT proxy tests. |
generator_nodemodules_test.go |
Inherits PATH in npm proxy tests. |
馃挕 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
Proxy config tests hardcoded child PATH=/bin:/usr/bin and invoked bash via /bin/bash. Ubuntu-based CI happened to have those tools at those paths, but the tests failed on NixOS and other distros where core utilities live elsewhere.
This changes the child process PATH to inherit the test runner's PATH and resolves bash via PATH instead of assuming /bin/bash. /bin/sh is left unchanged since it's a stable, portable path. Proxy env var isolation (the child process only gets an explicit env list) is preserved.
Testing:
go test --test.short --timeout=10m ./...go run ./cmd/lint ./...