Repository navigation
ci: run the test suite on Windows too - #10
Merged
Merged
Conversation
The Windows service, its config seeding and the service runner are all behind //go:build windows, so an ubuntu-only pipeline never compiled them. The bug that made 'service install' read a stale machine-wide config copy sat in one of those files, and its tests could not run anywhere in CI. Linters stay on the Linux job: staticcheck, gosec and govulncheck are platform-independent, and a second pass buys nothing.
InitFileLogger opened the log file and kept the handle for the life of the process. Windows refuses to delete or replace a file another handle holds, which failed the logger test outright once the suite started running there, and left the service holding its log after shutdown. CloseFileLogger flushes and closes it, a second InitFileLogger closes the file the first one opened, and the Windows service runner closes the sink on the way out instead of only syncing it.
gosec flags the bare call. Nothing useful can be done with a failure to close the outgoing file, and failing the new logger over it would be worse, so the error is discarded explicitly.
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.
The Windows service, its config seeding and the service runner are all behind
//go:build windows, so the ubuntu-only pipeline never compiled them. The bug that madeservice installread a stale machine-wide config copy sat in one of those files, and its tests could not run anywhere in CI.Linters stay on the Linux job — staticcheck, gosec and govulncheck are platform-independent.
Opened as a PR rather than pushed straight to main so the new job proves itself (notably
-raceon Windows) before it lands.