Skip to content

Run the desktop app's Rust tests in CI on Linux, macOS, and Windows - #204

Merged
vycdev merged 3 commits into
developfrom
ci/cargo-test
Nov 19, 2026
Merged

vycdev merged 3 commits into
developfrom
ci/cargo-test

Conversation

@vycdev

@vycdev vycdev commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner

The v4.3.0 release review found that no workflow ran the desktop app's Rust tests. src-tauri has 30 unit tests, including the ones for Open in Slicer and #176, but CI and the release workflow only built the app. Now every pull request into develop or main, and every push to them, runs cargo test, and CI passed requires it.

Why Linux, macOS, and Windows. Each OS compiles different native code and runs a different set of tests. The default-app launcher uses GIO on Linux, Launch Services on macOS, and ShellExecuteEx on Windows. Three launcher tests exist only on macOS, and some slicer tests run only on Unix. An Ubuntu-only job would never compile the Windows code or run the macOS tests. The repo is public, so macOS and Windows runners cost nothing. The jobs run alongside the e2e suites, which already take longer, so the matrix adds no wait. The Windows leg found a real problem on its first run: rejects_paths_that_cannot_be_launched assumed a Unix host. Windows has no executable bit, so a plain .txt file counted as a Linux executable there. Shipped behavior is unaffected, because the platform is fixed to the host OS. That one case now runs only on Unix, like the other Unix-only checks in the file.

Details

  • Linux uses ubuntu-22.04 with the same packages as release.yml. ubuntu-latest is now 26.04, which lacks libwebkit2gtk-4.0-dev.
  • Swatinem/rust-cache caches the cargo registry and src-tauri/target. Pull request runs only restore it, so they don't fill the repo's cache quota.
  • cargo test --locked. No frontend build is needed, because debug builds use devUrl.
  • permissions: contents: read, persist-credentials: false, and the pull_request fork-safety note are unchanged.
  • The existing "Pull request CI and test:e2e:all" changelog bullet now covers this job.

Proof: cargo test --locked passed locally on macOS (30 tests), and actionlint and cargo fmt --check are clean. Two workflow_dispatch runs on this branch: the first passed Linux and macOS and failed on Windows with the test above. The second, with the fix, passed all three (Linux 27, macOS 30, Windows 26 tests), and the cargo cache cut compile time from about 1m40s to 14s on Linux. The e2e jobs in those dispatch runs failed for an unrelated reason. Runs on a feature branch can't restore develop's Chromium cache, and Playwright can't install Chromium on Ubuntu 26.04.

Reviewed with sol-loop: 2 rounds with gpt-6.2-sol. Sol verdict: approved

Council review

Rounds: 2

Delegate Round 1 Round 2
Claude Opus 5.5 9/10 10/10
GPT-6.2 Sol 9/10 9/10

Fixed: a test comment that overstated what a plain file passes when not on Unix. Declined, with both members' agreement: limiting the cargo cache's share of the repo cache quota (not needed now); making CI passed catch a matrix leg cancelled before it gets a runner (the e2e matrix has the same gap, so a fix belongs in a workflow-wide change); and dropping the extra Linux packages (the list is copied from release.yml as requested).

Created with Claude Opus 5.5 in Claude Code.

🤖 Generated with Claude Code

vycdev and others added 3 commits November 19, 2026 22:51
Add a rust_tests job that runs cargo test for src-tauri on Linux, macOS,
and Windows, with cached cargo builds, and require it in CI passed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Windows has no executable bit, so any file is executable there and the
Linux case in rejects_paths_that_cannot_be_launched failed on Windows.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@vycdev
vycdev merged commit ce6b3c9 into develop Nov 19, 2026
14 checks passed
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