Skip to content

Cross-runtime test infrastructure (coordinated Windows + WSL tests) #13

@djdarcy

Description

@djdarcy

Summary

Extend the test infrastructure to cover cross-runtime flows: scenarios
where a file is created on one runtime (Windows) and read/operated on
from another (WSL), or vice versa.

The existing scripts/run-cross-platform-tests.sh runs the suite
independently on both Windows and WSL. This issue adds tests that
require both runtimes to be present and coordinate between them.

Scenarios to cover

  1. WSL writes, Windows reads: create a file + metadata in WSL,
    then verify filekit on Windows sees it correctly (timestamps,
    mode, xattrs-translated-to-attribs if any)
  2. Windows writes, WSL reads: create a file with SDDL ACLs and
    NTFS ctime in Windows, verify filekit in WSL sees the POSIX
    translation correctly (ctime is lost, SDDL is invisible, but
    mtime/size/mode are preserved)
  3. UNC src, local dst: when unctools is installed, verify the
    alias detection from sub-issue #N+5 works end-to-end across real
    network boundaries (or a local simulated UNC via net share)
  4. WSL mount src, Windows-form dst: /mnt/c/Users/foo/src.txt
    and C:\Users\foo\dst.txt -- these are the same underlying
    NTFS files, filekit should handle them correctly regardless of
    which runtime initiates the copy
  5. Metadata preservation across runtimes: SDDL on Windows ->
    copy to WSL local fs -> SDDL is lost as expected, POSIX mode is
    reasonable; copy back to NTFS and SDDL is missing (documented
    expected behavior, NOT a bug)

Implementation

Phase A: test fixtures that span runtimes

# tests/cross_runtime/conftest.py

@pytest.fixture
def wsl_writeable_on_c():
    """A path that WSL can write and Windows can read on NTFS."""
    # Create via WSL subprocess if running on Windows,
    # or natively if running in WSL
    ...

@pytest.fixture
def windows_writeable_from_wsl():
    """Same thing from the other direction."""
    ...

Phase B: coordinated test runner

Extend scripts/run-cross-platform-tests.sh:

# New subcommand: cross-runtime tests that coordinate between both sides
./scripts/run-cross-platform-tests.sh --cross-runtime

The runner:

  1. On Windows: creates a fixture file, records its state
  2. Invokes WSL to verify the fixture from the Linux side
  3. Invokes WSL to modify the fixture in a known way
  4. Returns to Windows and verifies the modifications are visible

Phase C: CI integration (longer term)

GitHub Actions windows-latest runners don't have WSL pre-installed,
but self-hosted runners can. This sub-issue tracks adding a
"cross-runtime" CI job that runs on a self-hosted runner with both
Windows and WSL. For v0.3.0 this is optional; manual local runs are
enough.

Acceptance criteria

  • tests/cross_runtime/ directory with at least 5 scenarios
    from the list above
  • scripts/run-cross-platform-tests.sh --cross-runtime mode
  • Tests skip gracefully when the companion runtime isn't available
    (e.g., on Linux-only CI or on Windows without WSL installed)
  • Documented expected-loss cases (SDDL lost on NTFS → ext4 → NTFS
    round-trip, for example)
  • Tests pass on the dev box's Windows + WSL setup

Dependencies

  • Blocked by: #N+1 (data submodule -- we need something to test),
    #N+5 (cross-runtime continuity -- we need the alias detection
    that this infrastructure exercises)
  • Related to: #N+4 (parse_user_input_path -- needed to handle
    path forms that come from the other runtime)

Non-goals

  • This issue is NOT about setting up a full CI farm with self-hosted
    runners. That's a separate infra project.
  • This issue does NOT test Windows-to-macOS or Linux-to-macOS
    cross-runtime flows (we don't have macOS hardware in the loop
    yet -- community testing welcome per docs/platform-support.md).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestv0.3.0Targeted for v0.3.0 release

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions