Repository navigation
fix(build): compile and run unit tests on darwin - #45
Open
mattmattox wants to merge 1 commit into
Open
mattmattox wants to merge 1 commit into
mattmattox wants to merge 1 commit into
Conversation
Cast statfs Bsize to int64 so pkg/monitors/system builds on macOS, where the field is uint32. Make the unit tests portable: short unix socket paths under the 104-byte limit, squat the wildcard address in the Prometheus bind-failure test, discover the loopback interface name, and skip tests that need 127.0.0.0/8 aliases or inotify rename semantics when the host lacks them. Remove the unused command-call tracking and testKernelPanicLog from the logpattern mocks, and revive the memory estimation assertions that were commented out. Closes #20 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.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.
go build ./...failed on macOS becausesyscall.Statfs_t.Bsizeisuint32on darwin andint64on Linux. The cast fixes the build;//nolint:unconvertkeeps golangci-lint quiet on Linux where the cast is a no-op.With the build fixed, five packages still failed on darwin for host reasons, not bugs: unix socket paths over the 104-byte limit, a wildcard-vs-specific bind that BSD allows, an interface literally named
lo, loopback aliases 127.0.0.2/.3, and inotify rename semantics. Tests are made portable or skip with a reason; Linux assertions are unchanged.Also removes the dead logpattern mock helpers and revives the commented-out memory estimation assertions. Darwin is not added to goreleaser here.
Verified on macOS:
go build ./... && go vet ./... && go test -short ./...;GOOS=linuxbuild and vet pass.Closes #20
🤖 Generated with Claude Code