diff --git a/test/unit/srv/kg-featured-topics-job.test.js b/test/unit/srv/kg-featured-topics-job.test.js index 3589dcbba..c862994f9 100644 --- a/test/unit/srv/kg-featured-topics-job.test.js +++ b/test/unit/srv/kg-featured-topics-job.test.js @@ -3,7 +3,16 @@ import cds from '@sap/cds'; describe('kg-featured-topics-job', () => { beforeAll(async () => { - await cds.deploy(['db/knowledge-graph.cds','db/homepage-featured.cds','db/tutorials.cds','db/missions.cds']).to('sqlite::memory:'); + // Deploy the FULL db model, not a hand-picked subset. cds.deploy().to() + // mutates the process-level cds.db/cds.model singleton for the whole vitest + // fork worker; a partial set leaked a schema missing db/schema.cds tables + // (e.g. DeveloperEnvironmentTabs) into later files in the same CI worker, + // crashing the GDPR anonymize cascade's nested-subject SELECT with + // "no such table: DeveloperEnvironmentTabs" (#977 made that SELECT fatal). + // Deploying all of db/ (not srv/) restores every table + @PersonalData + // annotation into the singleton without loading service handlers; the job + // under test only needs an empty DB, so the full model is harmless. + await cds.deploy(['db']).to('sqlite::memory:'); }); it('runs without throwing when inputs are empty', async () => {