🟢 Add Windows-native test coverage for OS provider#6690
Merged
Conversation
Contributor
Test Results5 226 tests 5 222 ✅ 2m 20s ⏱️ Results for commit d70cf5a. ♻️ This comment has been updated with latest results. |
Member
|
/review |
|
Unable to complete the code review. Reason: Failed to clone the repository: code review: git fetch: error: RPC failed; curl 56 Recv failure: Connection reset by peer You can try |
Contributor
Author
|
/review |
1 similar comment
Contributor
Author
|
/review |
Add _windows_test.go files to exercise native Windows code paths (registry API, WMI, IP Helper API, fsutil) that were previously untested. These tests complement the Windows CI workflow from PR #6687. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
db528c5 to
0c7a472
Compare
The hardcoded /tmp/test_hash path doesn't exist on Windows. Use t.TempDir() with filepath.Join for a cross-platform temp path. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
afero MemMapFs Chmod doesn't work on Windows, and Unix file permissions don't apply there. Guard Chmod and permission-based filtering with runtime.GOOS checks. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move the shared mock type from build_version_windows_test.go into its own file so the cross-file dependency is self-documenting. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
Author
|
/review |
1 similar comment
Contributor
Author
|
/review |
Replace runtime.GOOS guards with a //go:build !windows file (find_files_unix_test.go) for chmod/permission tests, keeping find_files_test.go fully cross-platform. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add defer f.Close() to prevent Windows file-locking error during t.TempDir() cleanup. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
Author
|
/review |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Summary
_windows_test.gofiles to exercise native Windows code paths (registry API, WMI, IP Helper API, fsutil) that were previously untestedTest files added
providers/os/registry/registrykey_windows_test.goparseRegistryKeyPath()unit tests +GetNativeRegistryKeyItems/GetNativeRegistryKeyChildrenintegration testsproviders/os/resources/networkinterface/windows_routes_native_test.goformatDestination,formatGateway,getInterfaceName,parseSockaddrInetunit tests +List()integration testproviders/os/fsutil/find_files_windows_test.gohandleFsError()unit tests for all error typesproviders/os/detector/windows/build_version_windows_test.goGetWindowsOSBuild()integration test via mock local connectionproviders/os/detector/windows/wmi_windows_test.gotoString/intToStringunit tests +GetWmiInformation()integration testTest plan
GOOS=windows go vet ./providers/os/...🤖 Generated with Claude Code