From a40f6a5077001fbfbdc7529663a4ebcba608f5e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romuald=20Cz=C5=82onkowski?= Date: Sun, 21 Dec 2025 15:33:25 +0100 Subject: [PATCH] test: make templates database validation critical instead of optional MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously, the CI test only warned when templates were missing but always passed. This allowed the templates database to be lost without failing CI. Now the test will fail if templates are empty or below the expected count of 2500. Conceived by Romuald Członkowski - https://www.aiadvisors.pl/en 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- tests/integration/ci/database-population.test.ts | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/tests/integration/ci/database-population.test.ts b/tests/integration/ci/database-population.test.ts index 5a66d56..247979c 100644 --- a/tests/integration/ci/database-population.test.ts +++ b/tests/integration/ci/database-population.test.ts @@ -175,14 +175,18 @@ describe.skipIf(!dbExists)('Database Content Validation', () => { ).toBeGreaterThan(100); // Should have ~108 triggers }); - it('MUST have templates table (optional but recommended)', () => { + it('MUST have templates table populated', () => { const templatesCount = db.prepare('SELECT COUNT(*) as count FROM templates').get(); - if (templatesCount.count === 0) { - console.warn('WARNING: No workflow templates found. Run: npm run fetch:templates'); - } - // This is not critical, so we don't fail the test - expect(templatesCount.count).toBeGreaterThanOrEqual(0); + expect(templatesCount.count, + 'CRITICAL: Templates table is EMPTY! Templates are required for search_templates MCP tool and real-world examples. ' + + 'Run: npm run fetch:templates OR restore from git history.' + ).toBeGreaterThan(0); + + expect(templatesCount.count, + `WARNING: Expected at least 2500 templates, got ${templatesCount.count}. ` + + 'Templates may have been partially lost. Run: npm run fetch:templates' + ).toBeGreaterThanOrEqual(2500); }); });