Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions docs/changes/unreleased/2092-remote-task-fixtures-macos.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
kind: internal
title: Remote-task session fixtures pass on macOS temporary folders
pr: 2092
surface: [engine]
invalidates: []
---
9 changes: 8 additions & 1 deletion internal/session/task_remote_recovery_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -654,12 +654,14 @@ func TestAPrivateTaskRunsElsewhereAndWaitsForLocalReviewAndApply(t *testing.T) {
t.Setenv("CODEAF_HOME", t.TempDir())
t.Setenv("CODEAF_PROTOTYPE_WORKSPACE_OWNERSHIP", "1")
reached := make(chan struct{}, 1)
var written string
remote := &scriptedTaskEngine{start: func(ctx context.Context, spec RunSpec) RunSummary {
written = filepath.Join(spec.Workspace, "private-output.txt")
reached <- struct{}{}
r := remoteRecordFor(spec)
r.Finished, r.Restored = true, true
_ = spec.SaveRemote(r, true)
if err := os.WriteFile(filepath.Join(spec.Workspace, "private-output.txt"), []byte("the returned private change\n"), 0600); err != nil {
if err := os.WriteFile(written, []byte("the returned private change\n"), 0600); err != nil {
t.Error(err)
}
_ = spec.Store.CompleteRoot("private change made")
Expand All @@ -681,6 +683,11 @@ func TestAPrivateTaskRunsElsewhereAndWaitsForLocalReviewAndApply(t *testing.T) {
if _, err := os.Stat(filepath.Join(a.config.Workspace, "private-output.txt")); !os.IsNotExist(err) {
t.Fatal("private result applied before review")
}
// macOS gives a new file its folder's group, and the private copy sits under
// this test's temporary home, so with TMPDIR in /private/tmp the returned
// file is wheel's and Apply cannot carry that group. The fixture takes the
// process's own, as the other Apply fixtures do.
normalizeWorkspaceApplyFixtureMetadata(t, written)
review, err := a.ReviewTaskWorkspaceRoot(context.Background(), id, "work")
if err != nil {
t.Fatal(err)
Expand Down
6 changes: 6 additions & 0 deletions internal/session/task_start_r8b_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,12 @@ func remoteStartHome(t *testing.T) {
t.Fatal(err)
}
t.Cleanup(func() { _ = os.RemoveAll(home) })
// On macOS /tmp is a link into /private/tmp, and owned conversation
// storage refuses a recorded binding whose spelling crosses a link. A real
// home is already canonical, so the fixture names its home the same way.
if home, err = filepath.EvalSymlinks(home); err != nil {
t.Fatal(err)
}
t.Setenv("HOME", home)
t.Setenv("CODEAF_HOME", home)
}
Expand Down
Loading