test: run tests on other BSD virtual machines#624
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #624 +/- ##
==========================================
+ Coverage 80.76% 80.96% +0.20%
==========================================
Files 164 163 -1
Lines 12116 12086 -30
==========================================
Hits 9785 9785
+ Misses 1836 1806 -30
Partials 495 495
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
…p environment setup
… jobs and update Go version download method
…and improve Go version handling; add QEMU support for FreeBSD
…pdate Go version to 1.26.2
…test jobs configuration in workflows
There was a problem hiding this comment.
Pull request overview
This PR aims to enable running the repository’s Go build/test suite on additional BSD platforms by adding a dedicated GitHub Actions workflow and adjusting build constraints/tests that are not applicable on OpenBSD/NetBSD.
Changes:
- Add a manual (“workflow_dispatch”) CI workflow to run
go build/go teston FreeBSD, NetBSD, and OpenBSD VMs. - Adjust several
//go:buildconstraints to exclude OpenBSD/NetBSD from systemd-related code/tests. - Reorganize a few scheduler handler type tests and add a small local
qemu/helper program + ignore its disk image directory.
Reviewed changes
Copilot reviewed 18 out of 19 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
systemd/read.go |
Excludes OpenBSD/NetBSD from systemd unit reading implementation via build tags. |
systemd/read_test.go |
Excludes OpenBSD/NetBSD from systemd unit reading tests via build tags. |
systemd/generate.go |
Excludes OpenBSD/NetBSD from systemd unit generation implementation via build tags. |
systemd/generate_test.go |
Excludes OpenBSD/NetBSD from systemd unit generation tests via build tags. |
systemd/drop_ins.go |
Excludes OpenBSD/NetBSD from drop-in handling via build tags. |
systemd/drop_ins_test.go |
Excludes OpenBSD/NetBSD from drop-in tests via build tags. |
schedule/schedule_systemd_test.go |
Excludes OpenBSD/NetBSD from systemd scheduler init test via build tags. |
schedule/handler_unix_test.go |
Removes some handler type tests; retains default-OS handler test. |
schedule/handler_systemd.go |
Excludes OpenBSD/NetBSD from the systemd scheduler handler implementation via build tags. |
schedule/handler_systemd_test.go |
Excludes OpenBSD/NetBSD from systemd handler tests via build tags; adds back a handler type assertion. |
schedule/handler_darwin_test.go |
Removes a crond handler type assertion from Darwin-only tests. |
schedule/handler_crond_test.go |
Adds a crond handler type assertion to the crond test file. |
qemu/main.go |
Adds a small QEMU runner helper (local tooling). |
preventsleep/caffeinate_test.go |
Restricts the caffeinate tests to darwin/windows/linux via build tags. |
go.mod |
Bumps the go directive to 1.26.2. |
crond/mock/main.go |
Simplifies mismatch reporting output in the crontab mock. |
.gitignore |
Ignores qemu/disk_images/. |
.github/workflows/test.yml |
Adds a new workflow to run tests on FreeBSD/NetBSD/OpenBSD VMs. |
.github/workflows/build.yml |
Minor formatting change (removes an empty line). |
Comments suppressed due to low confidence (1)
schedule/handler_unix_test.go:14
- On openbsd/netbsd builds, HandlerSystemd is now excluded (see handler_systemd.go build tag), so this test won’t compile and the default OS handler will fall back to crond via the fallback provider. Update this test’s build tag to also exclude openbsd/netbsd, or change the assertion to expect HandlerCrond on those platforms (and avoid referencing HandlerSystemd where it doesn’t exist).
func TestHandlerDefaultOS(t *testing.T) {
handler := NewHandler(SchedulerDefaultOS{})
assert.IsType(t, &HandlerSystemd{}, handler)
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…dd Linux and BSD handler tests
No description provided.