test: adapt test cases for Windows 10 environment#95
Conversation
…solate Linux-specific code 1. Skip permission-related tests on Windows due to OS differences 2. Add missing resource cleanup (logger) in test cases 3. Move Linux-specific code (syscall.Umask) to build-tagged files
|
@qiyoulin-ops there are some checks failing. Once you fix them I would review happily 👍 |
|
Addressed the following based on feedback:
PTAL. |
There was a problem hiding this comment.
Pull request overview
This PR adapts the test suite to run reliably on Windows 10 by avoiding OS-specific permission assumptions, ensuring resources are closed, and moving non-Windows-only tests into a dedicated file.
Changes:
- Skip permission-retention assertions on Windows for
TestOpenExisting. - Add missing
Close()calls in tests to avoid file handle leaks/locks. - Move permission/Umask-dependent tests into a non-Windows test file.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
timberjack_test.go |
Adds Windows skips/resource cleanup and relaxes path assertions for OS portability. |
timberjack_linux_test.go |
Introduces non-Windows (currently effectively Linux-only) tests that rely on POSIX permissions/syscall.Umask. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
fix(test): skip Windows permission tests, close unclosed resources, isolate Linux-specific code
Type
Details
Run
go test -v .under Windows 10Tests
go test ./...passes locallyBackwards compatibility
Related issues
Fixes # (if applicable)