forked from anomalyco/opencode
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Problem
packages/opencode/test/tasks/pipeline.test.ts (added in Phase 3b) uses a hardcoded temp directory path in beforeEach:
const testDir = `/tmp/taskctl-pipeline-test-${Date.now()}-${Math.random()}`While the Date.now()/Math.random() suffix prevents the worst collisions, the correct pattern for this repo is to use the tmpdir() fixture from test/fixture/fixture.ts, which provides:
- Automatic cleanup via
await using - Realpath resolution
- Null-byte sanitization (CI safety)
- Consistent patterns with all other test files
Fix
Replace the manual temp dir construction in beforeEach with the tmpdir() fixture pattern used in store.test.ts, scheduler.test.ts, etc:
import { tmpdir } from "../fixture/fixture"
// In each test:
test("example", async () => {
await using tmp = await tmpdir()
await Instance.provide({ directory: tmp.path, fn: async () => {
// test body
}})
})Acceptance criteria
-
pipeline.test.tsusestmpdir()fixture pattern - No hardcoded
/tmppaths remain - All tests still pass
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working