Use writable macOS runner workdir
Some checks failed
Cache: Publish Nix / Publish Nix Cache (push) Failing after 22s
Build Rust / Cargo Test (push) Successful in 4m42s
Build Site / Next.js Build (push) Failing after 5s
Lint Governance / BEP Metadata (push) Successful in 1s

This commit is contained in:
Conrad Kramer 2026-06-07 08:42:45 -07:00
parent 4e31d54a45
commit 6b9065008d
4 changed files with 38 additions and 7 deletions

View file

@ -0,0 +1,25 @@
package nsc
import "testing"
func TestMacOSRunnerWorkDirUsesWritableEphemeralPath(t *testing.T) {
cases := []struct {
name string
configured string
want string
}{
{name: "empty", configured: "", want: "/tmp/forgejo-runner"},
{name: "linux var state", configured: "/var/lib/forgejo-runner", want: "/tmp/forgejo-runner"},
{name: "custom tmp", configured: "/tmp/custom-runner", want: "/tmp/custom-runner"},
{name: "home path", configured: "/Users/runner/forgejo-runner", want: "/Users/runner/forgejo-runner"},
}
for _, tc := range cases {
t.Run(tc.name, func(t *testing.T) {
got := macosRunnerWorkDir(tc.configured)
if got != tc.want {
t.Fatalf("macosRunnerWorkDir(%q) = %q, want %q", tc.configured, got, tc.want)
}
})
}
}