fix: BSD tests#631
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #631 +/- ##
=======================================
Coverage 80.99% 80.99%
=======================================
Files 162 162
Lines 12112 12113 +1
=======================================
+ Hits 9809 9810 +1
Misses 1806 1806
Partials 497 497
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
…irectory creation
…ncurrency handling
…erminated child processes
There was a problem hiding this comment.
Pull request overview
This PR targets improving test reliability and behavior consistency on BSD platforms, and re-enables CI coverage for BSD VMs.
Changes:
- Adjusts OS-specific test logic (e.g., Windows checks, BSD-specific exit code variance) and makes some time-based tests deterministic via
testing/synctest. - Improves temp directory creation fallback behavior by ensuring the user cache directory exists before creating a temp dir within it.
- Expands/reshapes platform-specific
util.Executable()behavior and restructures lock PID-related tests to avoid NetBSD failures; re-enables BSD GitHub Actions workflow triggers.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| wrapper_test.go | Uses platform.IsWindows() and broadens accepted interrupt-related error strings for stream source tests. |
| util/write/file_test.go | Wraps a timing-sensitive test in synctest.Test to avoid flaky sleeps/timeouts. |
| util/tempdir_test.go | Switches to require.NoError so assertions don’t proceed with invalid dir values. |
| util/tempdir.go | Ensures os.UserCacheDir() path exists (os.MkdirAll) before attempting os.MkdirTemp there. |
| util/executable_symlink.go | Broadens build tags for the non-Darwin/non-Windows executable resolution implementation and updates docs. |
| util/executable_os.go | Adds a Darwin/Windows-specific Executable() implementation (os.Executable-based). |
| util/executable_linux_test.go | Broadens build tags for resolveExecutable tests to match non-Darwin/non-Windows targets. |
| shell/command_test.go | Makes the “local file” command test choose an existing file in the package dir instead of a hardcoded filename. |
| lock_test.go | Adds a new test intended to validate lock release behavior when signalled. |
| lock/lock_test.go | Removes PID/process-related tests (moved out) and drops related imports. |
| lock/lock_pid_test.go | Adds PID/process-related tests back under a !netbsd build tag. |
| .github/workflows/BSD-tests.yml | Re-enables push/PR triggers for BSD test workflow and updates VM action version. |
Comments suppressed due to low confidence (1)
util/executable_symlink.go:16
- The new build constraint (
!darwin && !windows) makes this implementation ofExecutable()apply to all non-Darwin/non-Windows targets (e.g., plan9, wasip1, etc.), butresolveExecutable()assumes Unix-style absolute paths (executable[0] == '/'). Either narrow the build tags to the actual intended OS set (Linux + the BSDs) or make the path logic fully OS-agnostic (e.g., usefilepath.IsAbs/filepath.Separator) so the broader tag is correct.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…adge; refactor lock tests and add executable resolution tests for BSD systems
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 13 out of 13 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
util/executable_symlink.go:4
- The build tag here (
!darwin && !windows) makes this implementation apply to all other GOOS targets (e.g., linux, the BSDs, but also any other non-darwin/non-windows ports). The doc comment says this behavior is for “Linux and BSDs”, and the behavior change could be unintended for other OSes that previously usedos.Executable.
Consider either (a) narrowing the build constraint to the specific OSes you intend to support with os.Args[0] resolution, or (b) adjusting the comment to accurately describe the broader build scope and explicitly documenting why this is safe for all non-darwin/non-windows platforms.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.