Skip to content

ci: add windows-latest to test matrix#2233

Merged
mnriem merged 9 commits intogithub:mainfrom
mnriem:issue-2232-windows-ci
Apr 15, 2026
Merged

ci: add windows-latest to test matrix#2233
mnriem merged 9 commits intogithub:mainfrom
mnriem:issue-2232-windows-ci

Conversation

@mnriem
Copy link
Copy Markdown
Collaborator

@mnriem mnriem commented Apr 15, 2026

Add windows-latest to the pytest job OS matrix so tests run on both Ubuntu and Windows for all Python versions.

Closes #2232

Add windows-latest to the pytest job OS matrix so tests run on both
Ubuntu and Windows for all Python versions.

Closes github#2232
Copilot AI review requested due to automatic review settings April 15, 2026 19:23
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Expands the CI test coverage by running the existing pytest GitHub Actions job on both Ubuntu and Windows across the supported Python versions, addressing Issue #2232.

Changes:

  • Switch pytest job runner from a fixed ubuntu-latest to a matrix-selected runner.
  • Add windows-latest to the pytest job OS matrix (resulting in a 2×3 matrix with the existing Python versions).
Show a summary per file
File Description
.github/workflows/test.yml Updates the pytest job to run on both ubuntu-latest and windows-latest via a matrix.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 1/1 changed files
  • Comments generated: 0

mnriem added 2 commits April 15, 2026 14:33
Add sys.platform skip markers to all test classes and methods that
execute bash scripts via subprocess, so they are skipped on Windows
where bash is not available. Mixed classes with both bash and pwsh
tests have markers on individual bash methods only.
- test_manifest: use platform-appropriate absolute path (C:\ on Windows
  vs /tmp on POSIX) since /tmp is not absolute on Windows
- test_extensions: add agent_scripts.ps entry and platform-conditional
  assertions for codex skill fallback variant test
- test_timestamp_branches: use json.dumps() instead of f-string to
  properly escape Windows backslash paths in feature.json
Copilot AI review requested due to automatic review settings April 15, 2026 19:42
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds Windows coverage to the GitHub Actions pytest job, and adjusts/guards a set of tests so the suite can run on Windows runners without failing on bash-only scenarios.

Changes:

  • Expand CI pytest job to run on a two-OS matrix: ubuntu-latest and windows-latest.
  • Skip bash-dependent integration tests on Windows (and fix a Windows path/JSON escaping edge case in tests).
  • Make a skills-registration test assert the correct script variant depending on OS fallback behavior.
Show a summary per file
File Description
.github/workflows/test.yml Switch pytest job to an OS matrix including Windows.
tests/test_timestamp_branches.py Skip many bash-driven tests on Windows; adjust JSON writing for Windows path escaping.
tests/test_extensions.py Make fallback-script-variant expectations OS-dependent and include PowerShell agent script mapping.
tests/test_cursor_frontmatter.py Skip bash integration tests on Windows.
tests/integrations/test_manifest.py Use an OS-appropriate absolute path to keep the “absolute path rejected” test valid on Windows.
tests/extensions/git/test_git_extension.py Skip bash extension script tests on Windows.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 6/6 changed files
  • Comments generated: 2

Comment thread tests/test_timestamp_branches.py Outdated
Comment thread tests/test_timestamp_branches.py Outdated
Address PR review feedback:
- Define a reusable requires_bash marker in conftest.py and use it
  across all 3 test files instead of repeating the skipif inline
- Move test_powershell_scanner_uses_long_tryparse_for_large_prefixes
  into its own TestSequentialBranchPowerShell class so it is not
  incorrectly skipped on Windows by the class-level bash marker
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds Windows CI coverage for the pytest suite and adjusts tests to be Windows-compatible by skipping bash-dependent tests and using Windows-safe path/JSON handling.

Changes:

  • Update GitHub Actions pytest job to run on both ubuntu-latest and windows-latest across Python 3.11–3.13.
  • Introduce a shared requires_bash skip marker and apply it to bash-dependent test classes/methods.
  • Make selected assertions/test inputs OS-aware (Windows vs non-Windows), including absolute-path and generated-script expectations.
Show a summary per file
File Description
.github/workflows/test.yml Expands pytest job to a cross-OS matrix including Windows.
tests/conftest.py Adds requires_bash marker for conditionally skipping bash-dependent tests.
tests/test_timestamp_branches.py Skips bash-based test groups on Windows; fixes JSON writing for Windows paths.
tests/test_extensions.py Makes a script-selection assertion OS-aware (Windows prefers PowerShell).
tests/test_cursor_frontmatter.py Skips git+bash integration tests on Windows via requires_bash.
tests/integrations/test_manifest.py Uses a Windows absolute path when running on Windows to validate absolute-path rejection.
tests/extensions/git/test_git_extension.py Skips bash-script extension tests on Windows via requires_bash.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 7/7 changed files
  • Comments generated: 1

Comment thread tests/conftest.py
Replace sys.platform == 'win32' with an actual bash invocation test
to handle environments where bash exists but is non-functional (e.g.,
WSL stub on Windows without an installed distro).
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR expands CI test coverage to Windows by adding windows-latest to the GitHub Actions pytest matrix, and updates tests to be Windows-compatible (or to skip bash-dependent suites when bash isn’t suitable).

Changes:

  • Run pytest on both ubuntu-latest and windows-latest for Python 3.11–3.13.
  • Add a shared requires_bash marker and apply it to bash-executing test suites.
  • Adjust a few tests to be OS-aware (Windows vs POSIX paths; PowerShell vs bash script expectations).
Show a summary per file
File Description
.github/workflows/test.yml Expands the pytest job to run on an OS matrix including Windows.
tests/conftest.py Introduces requires_bash and a bash-availability probe for conditional skipping.
tests/test_timestamp_branches.py Marks bash-driven test classes with @requires_bash; fixes JSON writing for Windows paths; adds a PS static guard test.
tests/test_extensions.py Makes fallback-script assertions OS-specific and adds PS agent script entry in the test frontmatter.
tests/test_cursor_frontmatter.py Skips the bash-based integration test suite when bash isn’t available.
tests/integrations/test_manifest.py Updates absolute-path traversal test to use a Windows absolute path on win32.
tests/extensions/git/test_git_extension.py Skips bash-executing extension tests when bash isn’t available.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 7/7 changed files
  • Comments generated: 1

Comment thread tests/conftest.py
mnriem added 2 commits April 15, 2026 15:22
On Windows, verify uname -s reports MSYS, MINGW, or CYGWIN so the WSL
launcher (System32\bash.exe) is rejected — it cannot handle native
Windows paths used by test fixtures. Add SPECKIT_TEST_BASH=1 env var
escape hatch to force-enable bash tests in non-standard setups.
Copilot AI review requested due to automatic review settings April 15, 2026 20:23
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds Windows CI coverage for the pytest suite by expanding the GitHub Actions OS matrix and adapting tests to behave correctly on Windows (skipping bash-dependent tests and handling Windows-specific path behavior).

Changes:

  • Run pytest in CI on both ubuntu-latest and windows-latest across Python 3.11–3.13.
  • Introduce a requires_bash pytest mark to skip bash-script tests when a compatible bash isn’t available (and avoid WSL bash).
  • Make a few tests platform-aware (e.g., absolute-path rejection test; Codex skill script expectations).
Show a summary per file
File Description
.github/workflows/test.yml Expands pytest job to a Windows+Ubuntu OS matrix.
tests/conftest.py Adds bash detection and requires_bash skip mark for bash-dependent tests.
tests/test_timestamp_branches.py Applies @requires_bash to bash-driven tests and improves JSON writing for a PS case.
tests/extensions/git/test_git_extension.py Applies @requires_bash to bash-script test classes.
tests/test_cursor_frontmatter.py Skips git+bash integration tests when bash isn’t available.
tests/integrations/test_manifest.py Makes absolute-path test portable across Windows/POSIX.
tests/test_extensions.py Makes Codex skill script assertions OS-dependent and adds PS agent script path.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 7/7 changed files
  • Comments generated: 2

Comment thread tests/test_timestamp_branches.py
Comment thread tests/conftest.py
- Check resolved bash path for System32 before spawning any subprocess
  to avoid WSL init prompts and timeout during test collection
- Convert remaining feature_json f-string writes to json.dumps() so
  paths with backslashes produce valid JSON on Windows
On Windows, subprocess.run(['bash', ...]) uses CreateProcess which
searches System32 before PATH — finding WSL bash even when
shutil.which('bash') returns Git-for-Windows. Probe with bare 'bash'
(same as test helpers) so the detection matches actual test behavior.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends CI test coverage to Windows by adding windows-latest to the GitHub Actions pytest matrix, and updates the test suite to be Windows-compatible by conditionally skipping bash-dependent tests and adjusting a few OS-specific assertions.

Changes:

  • Add windows-latest to the pytest job OS matrix in .github/workflows/test.yml.
  • Introduce a shared requires_bash pytest mark (with Windows-aware bash detection) and apply it to bash-dependent test classes.
  • Make a handful of tests OS-aware (e.g., absolute-path rejection test, script variant assertions).
Show a summary per file
File Description
tests/test_timestamp_branches.py Marks bash-executing test classes with @requires_bash; uses json.dumps for feature.json writes.
tests/test_extensions.py Makes script-variant assertions OS-aware; adds PowerShell agent script path to frontmatter fixture.
tests/test_cursor_frontmatter.py Skips Cursor integration tests when bash isn’t available.
tests/integrations/test_manifest.py Uses an OS-appropriate absolute path to keep absolute-path validation test portable.
tests/extensions/git/test_git_extension.py Skips bash-based git extension tests when bash isn’t available.
tests/conftest.py Adds _has_working_bash() detection and requires_bash pytest mark for cross-platform skipping.
.github/workflows/test.yml Runs pytest on both Ubuntu and Windows for all supported Python versions.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 7/7 changed files
  • Comments generated: 0 new

@mnriem mnriem merged commit 9988a46 into github:main Apr 15, 2026
11 checks passed
@mnriem mnriem deleted the issue-2232-windows-ci branch April 15, 2026 20:37
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.

Add windows-latest to test.yml

2 participants