Skip to content

Spec 29: Windows test-fixture port — bring the test matrix back to Windows #101

@0bserver07

Description

@0bserver07

Goal

Port the ~40 POSIX-shaped test fixtures so the Tests workflow can run on windows-latest again.

Why now

v0.7.3 added a Windows test job; v0.7.4 had to revert it because ~40 tests have hard-coded /Users/... literals, raw Path.resolve() that drive-prefixes on Windows, paths comparing \ vs /. The runtime code paths are correct (production code paths fixed in v0.7.3+) — only the tests are POSIX-shaped. The build matrix still validates Windows on every push (wheel + smoke test); this is the missing pytest coverage.

Schema

None. Pure test refactor.

User-visible surface

None (CI-only).

Implementation plan

  1. Audit: grep -rn "/Users/" tests/ → list every hard-coded POSIX literal.
  2. Replace each with tmp_path / "Users/..." or a cross-platform pathlib construction.
  3. Audit: every test that calls Path.resolve() or Path.absolute() on a non-existent string path. On Windows these prepend the current drive — which is fine, but assertions about the resulting string break. Use os.path.samefile or normalised-comparison helpers.
  4. Audit: tests that compare paths with assert "foo/bar" in result — replace with pathlib-based or separator-normalised comparison.
  5. Audit: tests that call os.symlink, os.chmod(0o000), os.fork, signal.SIGTERM — already partially skipif'd (v0.7.3); finish the work.
  6. Re-enable windows-latest in .github/workflows/test.yml matrix.
  7. Iterate based on the actual Windows CI failures (some won't surface until run on Windows).

Tests

None new — this is fixing existing tests.

Hard parts

  • Some tests will need >1 round of CI feedback before fully green.
  • A few may turn out to be genuinely Windows-incompatible (e.g., test exercising fcntl semantics) — those get @pytest.mark.skipif(sys.platform == "win32") with rationale.
  • tests/conftest.py:set_home_env (v0.7.3) is the cross-platform helper for HOME — use it everywhere monkeypatch.setenv("HOME", ...) appears.

Out of scope

  • Adding new tests.
  • Adding more platforms (Linux already covered; macOS in build.yml; Windows is the gap).

Dependencies

  • None.

Estimated effort

Size L — single agent, ~2-3 hr (audit + refactor + multiple Windows-CI iterations).

Hard rules

  • DO NOT touch versions / CHANGELOG headings.
  • DO NOT skip tests just to make them green — fix the root cause; only skip when the test is genuinely Windows-incompatible (and document why in the skipif reason).
  • Branch: feat/windows-test-port off main.
  • Multiple commits OK as Windows CI iterates.

Metadata

Metadata

Assignees

No one assigned

    Labels

    size-l~2 hr agent runspecSpec/feature for an agent to implementwave-6Wave 6: sensitive / long-tail

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions