mirror of
https://github.com/garrytan/gstack.git
synced 2026-05-05 05:05:08 +02:00
fix: isolate E2E tests from production telemetry
E2E test runner now sets GSTACK_STATE_DIR to a temp directory so skill preamble telemetry goes to /tmp/ instead of ~/.gstack/. Prevents test runs from polluting production Supabase with fake crash events (was causing 252 spurious "timeout" crashes from a single test session). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -155,10 +155,16 @@ export async function runSkillTest(options: {
|
||||
const promptFile = path.join(workingDirectory, '.prompt-tmp');
|
||||
fs.writeFileSync(promptFile, prompt);
|
||||
|
||||
// Isolate telemetry: E2E tests use a temp state dir so they don't pollute
|
||||
// production telemetry with test events (e.g. fake timeout crashes).
|
||||
const testStateDir = path.join(os.tmpdir(), `gstack-e2e-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`);
|
||||
fs.mkdirSync(testStateDir, { recursive: true });
|
||||
|
||||
const proc = Bun.spawn(['sh', '-c', `cat "${promptFile}" | claude ${args.map(a => `"${a}"`).join(' ')}`], {
|
||||
cwd: workingDirectory,
|
||||
stdout: 'pipe',
|
||||
stderr: 'pipe',
|
||||
env: { ...process.env, GSTACK_STATE_DIR: testStateDir },
|
||||
});
|
||||
|
||||
// Race against timeout
|
||||
|
||||
Reference in New Issue
Block a user