test(cron): handle Windows path and permission semantics - #60888
Conversation
tonydwb
left a comment
There was a problem hiding this comment.
Code Review Summary
Verdict: Comment (token read-only)
PR 60888 adds unit tests for Windows path and permission semantics in cron. Test improvements for cross-platform compatibility. Well-scoped (2 files, 32 additions, 19 deletions). No security issues or debug artifacts detected.
LGTM - awaiting maintainer approval.
|
Thanks for the focused Windows portability coverage. The premise remains valid on current main: The patch matches existing repository precedent: The PR is behind current main, but the two changed test regions remain applicable; salvage should be mechanical. Automated hermes-sweeper review. |
|
Independent confirmation: I reproduced the same two failures and arrived at the same fix independently on a different Windows setup — Python 3.13.14 (the original report in #60243 was 3.11.15), so the issue and this fix hold across Python versions. For the workdir test, the One thing worth flagging for reviewers: this is the cron instance of a recurring HOME / POSIX-assumption pattern that also shows up in:
The Not opening a competing PR — this one covers it. Posting only to add the cross-version verification and the cross-issue context. |
Summary
~workdir normalization test patch Windows-native home variables (USERPROFILE,HOMEDRIVE,HOMEPATH) in addition toHOME.Root cause
Two tests encoded POSIX-only assumptions:
chmod(0600/0700)throughstat().st_modeas strict POSIX mode bits.Path("~").expanduser()on Windows usesUSERPROFILE/HOMEDRIVE+HOMEPATH, notHOMEalone.Test plan
tests/cron/test_file_permissions.pystrict0600/0700assertions failed as0666/0777.tests/cron/test_cron_workdir.py::TestNormalizeWorkdir::test_tilde_expandsresolved toC:\Users\82109instead of patchedHOME.Scope note
This is intentionally separate from the cron profile-scoped jobs storage fix in #60882.