test: update FTS verify test to match non-fatal behavior

The test previously asserted that FTS verification failure throws during
full analyze. Since FTS failure is now non-fatal (graceful degradation),
update the test to verify analyze completes successfully with a warning
instead of throwing.

The repair-mode test (--repair-fts) still asserts a throw, which is
correct: if the user explicitly requests FTS repair, failure should be
reported.
This commit is contained in:
henry 2026-05-22 17:48:22 +08:00
parent 7b75cfb585
commit fc49ccc84c

View file

@ -199,7 +199,7 @@ describe('runFullAnalysis FTS repair and verification failure paths', () => {
}
});
it('fails full analyze when FTS verification reports missing indexes after creation', async () => {
it('logs warning when FTS verification reports missing indexes after creation', async () => {
vi.doMock('../../src/core/lbug/lbug-adapter.js', () => ({
initLbug: vi.fn(async () => undefined),
loadGraphToLbug: vi.fn(async () => undefined),
@ -227,15 +227,17 @@ describe('runFullAnalysis FTS repair and verification failure paths', () => {
const tmpRepo = await createTempDir('gitnexus-run-analyze-full-verify-fail-');
try {
const { runFullAnalysis } = await import('../../src/core/run-analyze.js');
await expect(
runFullAnalysis(
tmpRepo.dbPath,
{ force: true },
{
onProgress: () => {},
},
),
).rejects.toThrow(/FTS verification failed - missing indexes after analyze/i);
// FTS verification failure is now non-fatal — analyze completes with a warning
// instead of throwing, so embedding generation can proceed.
const result = await runFullAnalysis(
tmpRepo.dbPath,
{ force: true },
{
onProgress: () => {},
},
);
expect(result).toBeDefined();
expect(result.repoPath).toContain('gitnexus-run-analyze-full-verify-fail-');
} finally {
await tmpRepo.cleanup();
}