fix(test): skip POSIX permission assertions on Windows - #855
Merged
chenyme merged 2 commits intoAug 5, 2026
Conversation
Windows has no POSIX permission bits: os.WriteFile mode is ignored and files report 0666-style permissions, so the 0600 assertions in the qualityguard bootstrap and runtime-config tests always fail on Windows. Skip them on Windows; POSIX behavior is unchanged. (cherry picked from commit 0b9d048)
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.
概述
v3.1.0 新增的 qualityguard 相关测试在 Windows 上必挂:
bootstrap.json与runtime-config.json写入后断言文件权限为0600,但 Windows 没有 POSIX 权限位,os.WriteFile的 mode 参数被忽略,文件恒为0666样式(Go 官方文档:Windows 仅使用 0200 位控制只读属性)。改动
qualityguard/bootstrap_test.go与transport/http/egress/handler_test.go的权限断言加runtime.GOOS != "windows"分支兼容性
0600断言照常执行)go test ./...全绿。