Skip to content

Commit 803e3e4

Browse files
secondcircleclaude
andcommitted
🔧 Fix CI file deletion issue by using workspace temp directory
ROOT CAUSE DISCOVERED: GitHub Actions immediately deletes files created in RUNNER_TEMP - File writes succeed but files disappear immediately after creation - writeFileSync succeeds but realpathSync fails with ENOENT - Switch to workspace-based temp directory: process.cwd()/test-tmp/ - Add test-tmp/ to .gitignore This should finally fix the 8 CI test failures. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 3f4bc60 commit 803e3e4

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ Thumbs.db
5757
# Temporary files
5858
tmp/
5959
temp/
60+
test-tmp/
6061

6162
# MCP specific
6263
mcp/*/storage.json

src/file-editor-rollback.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import { join } from 'node:path';
44
import { applyWorkspaceEdit } from './file-editor.js';
55
import { pathToUri } from './utils.js';
66

7-
const TEST_DIR = process.env.RUNNER_TEMP
8-
? `${process.env.RUNNER_TEMP}/file-editor-rollback-test`
7+
const TEST_DIR = process.env.CI
8+
? `${process.cwd()}/test-tmp/file-editor-rollback-test`
99
: '/tmp/file-editor-rollback-test';
1010

1111
describe('file-editor rollback without backups', () => {

src/file-editor-symlink.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ async function robustReadThroughSymlink(link: string): Promise<string> {
7676
return readFileSync(link, 'utf-8');
7777
}
7878

79-
const TEST_DIR = process.env.RUNNER_TEMP
80-
? `${process.env.RUNNER_TEMP}/file-editor-symlink-test`
79+
const TEST_DIR = process.env.CI
80+
? `${process.cwd()}/test-tmp/file-editor-symlink-test`
8181
: '/tmp/file-editor-symlink-test';
8282

8383
describe.skipIf(!canCreateSymlinks())('file-editor symlink handling', () => {

0 commit comments

Comments
 (0)