test: guard the POSIX 0600 assertions that cannot hold on Windows - #118
Merged
Conversation
The two private-permission assertions added in #116 compare `stat.S_IMODE(...) == 0o600` unconditionally. Windows does not expose POSIX owner/group bits: `os.chmod` there only toggles the read-only flag, and `st_mode` reports 0o666 for a writable file. Both tests therefore failed on `windows-latest` for Python 3.11 and 3.12 and turned `main` red. Pull-request CI runs the Linux lane only, so the exact-head PR checks could not see it. Apply the convention this repository already uses in `tests/test_engine/test_private_flow_config.py`: keep the exact 0o600 assertion on POSIX and assert the file exists on Windows, with a comment naming why the mode bits are unavailable there. The POSIX assertion is not weakened and no test is skipped. Tests: tests/test_engine/test_push_result_contract.py and tests/test_engine/test_runner_loop.py -- 65 passed. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
What
Guard the two
stat.S_IMODE(...) == 0o600assertions added in #116 so they runon POSIX only, matching the convention already used in
tests/test_engine/test_private_flow_config.py.Why
mainwent red immediately after #116 merged:Windows does not expose POSIX owner/group bits.
os.chmodthere only togglesthe read-only flag, and
st_modereports0o666(438) for a writable file, sothe exact
0o600(384) comparison can never hold. Both tests failed onwindows-latestfor Python 3.11 and 3.12.test.ymlruns the Linux lane only for pull requests and the fullLinux/macOS/Windows matrix on exact
main, so the exact-head PR checks on #116could not see this.
How
Keep the exact
0o600assertion on POSIX. On Windows assert the file exists andcomment why the mode bits are unavailable. The POSIX assertion is unchanged, and
no test is skipped or weakened.
Tests
tests/test_engine/test_push_result_contract.pyandtests/test_engine/test_runner_loop.py: 65 passed.ruff check engine/ tests/ scripts/: passed.🤖 Generated with Claude Code