Skip to content

Commit c07b356

Browse files
mchwangclaude
andcommitted
Run the shutdown test's Git commands through fixtureGit
main (#82) runs every test Git command with the hardened options and an allowlisted environment. The review-load gate test now commits through test/fixtures/git.ts like the other tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 28ba12c commit c07b356

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎test/runner-shutdown.test.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { mkdtempSync, rmSync, writeFileSync } from 'node:fs';
22
import { tmpdir } from 'node:os';
33
import { join } from 'node:path';
4-
import { execFileSync } from 'node:child_process';
54
import { request as httpRequest } from 'node:http';
65
import { randomUUID } from 'node:crypto';
76
import { afterEach, describe, expect, it, vi } from 'vitest';
@@ -12,6 +11,7 @@ import { ReviewService } from '../runner/review.ts';
1211
import { MergeCoordinator } from '../runner/merge.ts';
1312
import { ShuttingDownError } from '../runner/lifecycle.ts';
1413
import type { RunnerDeps } from '../runner/coordinator.ts';
14+
import { fixtureGit } from './fixtures/git.ts';
1515
import type { InvocationResult } from '../agents/contract.ts';
1616
import type { MergeGateway, MergeQueueGateway, RemoteMergeState } from '../github/merge.ts';
1717

@@ -166,8 +166,8 @@ describe('server shutdown', { timeout: 15_000 }, () => {
166166
it('answers 503, not 409, when a review load hits the write gate', async () => {
167167
const { app, config } = await serve();
168168
writeFileSync(join(config.repository, 'moved.txt'), 'x');
169-
execFileSync('git', ['-c', 'core.hooksPath=/dev/null', 'add', '-A'], { cwd: config.repository });
170-
execFileSync('git', ['-c', 'core.hooksPath=/dev/null', '-c', 'user.name=t', '-c', 'user.email=t@t', 'commit', '-qm', 'move head'], { cwd: config.repository });
169+
fixtureGit(config.repository, 'add', '-A');
170+
fixtureGit(config.repository, 'commit', '-qm', 'move head');
171171
app.service.store.closeWrites();
172172
const response = await api(app, 'GET', '/api/review');
173173
expect(response).toEqual({ status: 503, body: { error: 'The review server is shutting down.' } });

0 commit comments

Comments
 (0)