From fc49ccc84c250afe86ee0de657a91037060c0f9f Mon Sep 17 00:00:00 2001 From: henry Date: Fri, 22 May 2026 17:48:22 +0800 Subject: [PATCH] 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. --- .../test/unit/run-analyze-fts-repair.test.ts | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/gitnexus/test/unit/run-analyze-fts-repair.test.ts b/gitnexus/test/unit/run-analyze-fts-repair.test.ts index c35aae6e8..7b7030ee4 100644 --- a/gitnexus/test/unit/run-analyze-fts-repair.test.ts +++ b/gitnexus/test/unit/run-analyze-fts-repair.test.ts @@ -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(); }