Skip to content

ci: run the Go suite on pull requests across Linux, macOS, and Windows - #126

Merged
TsekaLuk merged 2 commits into
mainfrom
ci/go-tests-on-pr
Aug 10, 2026
Merged

ci: run the Go suite on pull requests across Linux, macOS, and Windows#126
TsekaLuk merged 2 commits into
mainfrom
ci/go-tests-on-pr

Conversation

@TsekaLuk

Copy link
Copy Markdown
Contributor

Why

runtime/go had zero coverage on pull requests. The verify job in pr.yml never sets up Go, so no PR check has ever run go test. The only workflows that do run it are tauri-desktop-release.yml (release-time only) and computer-e2e.yml (chronically red on main). e2e.yml installs Go, but purely to build the runtime binary for its Playwright run — it never invokes the test suite.

That gap matters more than usual right now: the remaining open ports (#79, #80, #83, #84) are all Go-side — SSH transport, mobile pairing, watchdog and scan bounds. Without this job, none of them can be regression-checked by CI at all.

This also closes the last open acceptance criterion of #81, which asks for automated acceptance covering both Windows and macOS.

What

A separate go-tests job, deliberately not folded into verify so the Go suite does not extend that job's critical path:

platform packages -race
ubuntu-latest ./... yes
macos-15 ./... yes
windows-latest runtimecore, runtimehttp, hostprobe no

Windows runs a subset because providercli and the cmd/* packages stub their subprocesses with #!/bin/sh fixtures that cmd.exe cannot execute. The three packages it does run are the ones carrying platform-dependent behaviour — worktree hook execution (.cmd temp file + cmd.exe /d /s /c + taskkill /t /f versus /bin/bash -c + Setpgid), path handling, and host capability probing. -race is omitted on Windows because the detector needs a CGO toolchain the runner does not reliably provide; Linux and macOS already cover it.

One test could only ever have passed on POSIX

runtime_rpc_workspace_projection_test.go already had a GOOS-aware runtimeRPCStartupMarkerCommand(), but its setup hook was hardcoded to printf setup > setup-ran.txt. The setup hook runs through cmd.exe on Windows, which has no printf. Added the matching runtimeRPCSetupMarkerCommand() and compared the marker trimmed, since cmd.exe's echo appends CRLF.

Verification

  • GOOS=windows GOARCH=amd64 go vet clean on all three Windows-matrix packages, test files included — so they compile for the target.
  • Full local suite go test ./... -race green, exit 0, matching the pre-change baseline on main (1a208d27b).
  • pnpm verify:tauri-mainline passes with two new contract rules pinning the matrix and the GOOS-aware setup marker.
  • pr.yml parsed and the matrix asserted programmatically rather than by eye.

Whether the three packages actually pass on a Windows runner is what this PR exists to find out; that answer only comes from CI. If something platform-specific surfaces there, the fix belongs in this PR.

🤖 Generated with Claude Code

TsekaLuk and others added 2 commits August 10, 2026 10:06
`verify` never set up Go, so nothing gated `runtime/go` on a pull request.
The only workflows that ran `go test` were `tauri-desktop-release.yml`
(release-time) and `computer-e2e.yml` (chronically red), and `e2e.yml`
installs Go purely to build the runtime binary for its Playwright run.

Add a separate `go-tests` job so the Go suite does not extend `verify`'s
critical path. Linux and macOS run everything under `-race`; Windows runs
the packages that carry platform-dependent behaviour — worktree hooks,
path handling, host capability probing — because `providercli` and the CLI
packages stub subprocesses with `#!/bin/sh` fixtures cmd.exe cannot run.

The worktree projection test hardcoded `printf setup > setup-ran.txt` as
its setup hook while its startup sibling was already GOOS-aware, so it
could only have passed on POSIX. Give it the same treatment and compare
the marker trimmed, since cmd.exe's `echo` appends CRLF.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…suming a POSIX shell

The new Go job found both of these on its first run — neither is
reproducible on macOS, which is why the suite had been green locally.

Remote directory browsing never sorted. It reads entries through
`(*os.File).ReadDir(n)`, which returns raw directory order, unlike
`os.ReadDir` which sorts; the bound on entries is why the file method is
used. Meanwhile the local browser sorts directories first, then
case-insensitively by name (runtimecore files.go). So the same directory
listed in filesystem order over SSH and alphabetically when local. macOS
happened to return a sorted order and hid it; Linux ext4 did not.

Apply the local browser's comparator. The test now creates "zeta dir" and
"alpha file.txt" as well, because with only the original two entries the
expected order is identical under three different sorts — it asserted
nothing about ordering.

The worktree PTY teardown tests hardcoded /bin/sh as the session command.
They need any long-lived process to hold a PTY, so give them cmd.exe on
Windows rather than skipping: worktree teardown is precisely what the
Windows job is there to cover, since its process-tree kill path differs
most from the others.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@TsekaLuk
TsekaLuk merged commit 3c01580 into main Aug 10, 2026
6 of 8 checks passed
@TsekaLuk
TsekaLuk deleted the ci/go-tests-on-pr branch August 10, 2026 02:41
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