Skip to content

CI: compare the workflow path as posix so the Pester guard passes on Windows - #7750

Merged
danielhanchen merged 1 commit into
mainfrom
fix-pester-guard-windows-path
Aug 2, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
fix-pester-guard-windows-path

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Problem

The Guard the Pester bootstrap step added in #7743 fails on windows-latest, so setup.ps1 unit tests (VS 2026 / CMake guard) now fails on every PR that touches this workflow's paths (studio/**, unsloth/**, unsloth_cli/**, install.ps1, pyproject.toml, tests/studio_setup_ps1/**).

Path.relative_to() renders Windows separators, while the paths in the workflow YAML use forward slashes, so the membership check could never match:

E  AssertionError: assert '.github\\workflows\\studio-windows-inference-smoke.yml' in
   ['studio/**', 'unsloth/**', 'unsloth_cli/**', 'install.ps1', 'pyproject.toml', ...]

The guard itself is correct. Only the path comparison was platform-dependent, and it was written and run on Linux, where str() and as_posix() happen to agree.

Fix

Compare with as_posix().

Verification

Reproduced and confirmed on the real windows-latest runner rather than only locally:

  • Before: Guard the Pester bootstrap fails, Install Pester v5 and Run Pester suite skipped, job red.
  • After: job green, guard passes, and the Pester suite it gates runs as before.

The other seven assertions in the file are substring checks against the step body and are unaffected by path separators.

The guard step added in #7743 runs on windows-latest, where
Path.relative_to() renders backslashes. The paths in the workflow YAML use
forward slashes, so the membership check never matched and the pester job
failed on every PR that touches this workflow's paths.
@danielhanchen
danielhanchen merged commit f45a38c into main Aug 2, 2026
20 of 21 checks passed
@danielhanchen
danielhanchen deleted the fix-pester-guard-windows-path branch August 2, 2026 14:39
danielhanchen added a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Aug 2, 2026
The workflow's paths filter covers tests/studio/*.ps1, which does not match the
guard's .py file, so editing the guard alone did not run the job that executes
it on windows-latest. That is how the backslash comparison fixed in unslothai#7750 was
merged without the Windows job ever running.

Add the guard to the filter and assert its own coverage, so this cannot regress.
danielhanchen added a commit that referenced this pull request Aug 3, 2026
* Run the Windows Pester job when the guard itself changes

The workflow's paths filter covers tests/studio/*.ps1, which does not match the
guard's .py file, so editing the guard alone did not run the job that executes
it on windows-latest. That is how the backslash comparison fixed in #7750 was
merged without the Windows job ever running.

Add the guard to the filter and assert its own coverage, so this cannot regress.

* Give the Pester guard its own cheap workflow instead of the smoke suite

Listing the guard's .py file in studio-windows-inference-smoke.yml made a
guard-only edit launch all eight Windows smoke jobs, four of which download
GGUF models and run 30+ minutes, because that workflow has no job-level path
gating.

Run the same guard on the same OS in a single one-job workflow instead, and
assert it stays one Windows job.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant