Skip to content

Commit ebd93ce

Browse files
committed
test: stabilize follow-up integration suites
1 parent 2d08c89 commit ebd93ce

6 files changed

Lines changed: 20 additions & 5 deletions

tests/impact-2hop.test.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { describe, it, expect, beforeEach, afterEach } from 'vitest';
1+
import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest';
22
import { promises as fs } from 'fs';
33
import os from 'os';
44
import path from 'path';
@@ -15,6 +15,11 @@ import {
1515
RELATIONSHIPS_FILENAME
1616
} from '../src/constants/codebase-context.js';
1717

18+
vi.mock('../src/core/reranker.js', () => ({
19+
rerank: vi.fn(async (_query: string, results: unknown) => results),
20+
getRerankerStatus: vi.fn(() => 'fallback')
21+
}));
22+
1823
describe('Impact candidates (2-hop)', () => {
1924
let tempRoot: string | null = null;
2025
const token = 'UNIQUETOKEN123';

tests/index-migration-atomic-swap.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ export function greet(user: User): string {
214214
// Verify staging directory is cleaned up
215215
const hasStaging = await stagingDirExists(contextDir);
216216
expect(hasStaging).toBe(false);
217-
});
217+
}, 30000);
218218

219219
it('should fail closed when meta points to missing artifacts', async () => {
220220
// Create an index with meta pointing to non-existent files

tests/search-decision-card.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ import path from 'path';
55
import { CodebaseIndexer } from '../src/core/indexer.js';
66
import { rmWithRetries } from './test-helpers.js';
77

8+
vi.mock('../src/core/reranker.js', () => ({
9+
rerank: vi.fn(async (_query: string, results: unknown) => results),
10+
getRerankerStatus: vi.fn(() => 'fallback')
11+
}));
12+
813
type ToolCallRequest = {
914
jsonrpc: '2.0';
1015
id: number;

tests/search-hints.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ describe('Search Hints', () => {
145145
// Should be capped at 3
146146
expect(utilResult.hints.callers.length).toBeLessThanOrEqual(3);
147147
}
148-
});
148+
}, 30000);
149149

150150
it('hints include tests when test files are detected', async () => {
151151
if (!tempRoot) throw new Error('tempRoot not initialized');

tests/search-snippets.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ import path from 'path';
55
import { CodebaseIndexer } from '../src/core/indexer.js';
66
import { rmWithRetries } from './test-helpers.js';
77

8+
vi.mock('../src/core/reranker.js', () => ({
9+
rerank: vi.fn(async (_query: string, results: unknown) => results),
10+
getRerankerStatus: vi.fn(() => 'fallback')
11+
}));
12+
813
describe('Search Snippets with Scope Headers', () => {
914
let tempRoot: string | null = null;
1015

tests/zombie-guard.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,6 @@ describe('zombie process prevention', () => {
117117
expect(result.code).toBe(1);
118118
// Should still honor a short timeout (allow CI/Windows process jitter).
119119
expect(elapsed).toBeGreaterThan(800);
120-
expect(elapsed).toBeLessThan(7_000);
121-
}, 10_000);
120+
expect(elapsed).toBeLessThan(8_000);
121+
}, 12_000);
122122
});

0 commit comments

Comments
 (0)