Skip to content

CI: run cargo test and cargo clippy on the Windows job too #85

Open

Description

@Ahmar004

In simple words

CI checks the code with the tests and with clippy (Rust's linter) only on Linux. On Windows it only builds the program and runs three commands. So bugs that exist only on Windows get through CI. #78 (fixed in #79) and #83 (fixed in #84) are two examples.

Why it happens

  1. .github/workflows/ci.yml has two jobs.
  2. The check job (Ubuntu) runs cargo fmt --check, cargo clippy --locked --all-targets -- -D warnings, cargo test --locked and cargo deny check.
  3. The windows job (windows-2025) only runs cargo build --release, scripts/archive.py, and --version, setup --print and review --schema on the built proofline.exe.
  4. Code behind #[cfg(windows)] / #[cfg(not(unix))] is only compiled on Windows. Linux clippy never sees it, and Windows-specific behaviour (process spawning, paths, file names) is never tested.

What a Windows run finds today (Windows 11, main at 105f387)

cargo clippy --locked --all-targets -- -D warnings
cargo test --locked --no-fail-fast
  • A real bug: update::tests::detached_discovery_is_serialized_and_notices_arrive_on_the_next_invocation fails (src/update/tests.rs:291). That is Windows: scripts and CI wait 1–3 s for each proofline command because of the background update check #78, fixed in Windows: don't make scripts wait for the background update check #79.
  • Test setup problems. The product works here, but the tests need small changes to run on Windows:
    • 5 tests in tests/mcp.rs fail at tests/mcp.rs:138. Bridge::start calls env_clear() (tests/mcp.rs:314), which also removes SYSTEMROOT, and Windows networking can't start without it. Passing SYSTEMROOT through, as src/update.rs::checker_command already does (src/update.rs:195), makes all 5 pass.
    • tests/agent_install.rs:77 compares a short "8.3" temp path (C:\Users\RUNNER~1\…) with the full canonical path of the same folder.
    • tests/local_patch.rs:275 writes a file whose name Windows doesn't allow.
  • Clippy on Windows-only code: two errors in #[cfg(not(unix))] test code, src/agent/tests.rs:526 (redundant_clone) and :745 (permissions_set_readonly_false). Linux never compiles that code, so Linux clippy can't report them.

Totals: clippy exit 101 (2 errors). cargo test: lib 63 passed / 1 failed, agent_install 1/1, local_patch 13/1, mcp 0/5. All other test binaries pass.

Proposal

Add cargo clippy --locked --all-targets -- -D warnings and cargo test --locked to the windows job. First the three test setup problems and the two lints need fixing, and #79 merged, so the job starts green. I'm happy to send those test and lint fixes as a separate PR if you want this.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions