From 47a8edd6b6b13b279ae87267f0665c94f8115359 Mon Sep 17 00:00:00 2001 From: Andrey Avtomonov Date: Wed, 10 Jun 2026 01:15:44 +0200 Subject: [PATCH] test: retarget reindex per-scope error case to a broken manifest Reading a broken standalone source was made non-fatal in de1f1a8d (it is surfaced for repair instead of throwing), so the reindex per-scope error test no longer captured an error. Point it at a corrupt manifest shard, which is the remaining fatal read failure the per-scope catch must isolate, and assert the captured error names the offending file. --- packages/cli/test/context/index-sync/reindex.test.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/cli/test/context/index-sync/reindex.test.ts b/packages/cli/test/context/index-sync/reindex.test.ts index fe7698ba..3f6cb6b1 100644 --- a/packages/cli/test/context/index-sync/reindex.test.ts +++ b/packages/cli/test/context/index-sync/reindex.test.ts @@ -159,13 +159,16 @@ describe('reindexLocalIndexes', () => { '---\nsummary: Revenue\nusage_mode: auto\n---\n\nPaid orders.\n', 'utf-8', ); - await mkdir(join(project.projectDir, 'semantic-layer/warehouse'), { recursive: true }); - await writeFile(join(project.projectDir, 'semantic-layer/warehouse/broken.yaml'), 'not: [valid', 'utf-8'); + // A broken standalone source is surfaced for repair rather than failing the + // scope, so use a corrupt machine-generated manifest shard, which is the + // remaining fatal read failure that the per-scope catch must isolate. + await mkdir(join(project.projectDir, 'semantic-layer/warehouse/_schema'), { recursive: true }); + await writeFile(join(project.projectDir, 'semantic-layer/warehouse/_schema/broken.yaml'), 'not: [valid', 'utf-8'); const summary = await reindexLocalIndexes(project, { force: false, embeddingService: null }); expect(summary.scopes.find((scope) => scope.label === 'global')?.error).toBeUndefined(); - expect(summary.scopes.find((scope) => scope.label === 'warehouse')?.error).toContain('YAML'); + expect(summary.scopes.find((scope) => scope.label === 'warehouse')?.error).toContain('_schema/broken.yaml'); }); it('marks a scope errored when configured embeddings fail', async () => {