From 6a4fea60e030e4a89a2227b3973e20eb1b097ec4 Mon Sep 17 00:00:00 2001 From: Yige Date: Sat, 5 Dec 2026 23:51:30 +0800 Subject: [PATCH] test(registry): permit additional fixed app releases (#45) Co-authored-by: Corona --- scripts/application-authoring.test.mjs | 1 - scripts/authored-release.test.mjs | 2 +- scripts/catalog/validator.test.mjs | 22 ++++------------------ 3 files changed, 5 insertions(+), 20 deletions(-) diff --git a/scripts/application-authoring.test.mjs b/scripts/application-authoring.test.mjs index 2279fb1..145767a 100644 --- a/scripts/application-authoring.test.mjs +++ b/scripts/application-authoring.test.mjs @@ -21,7 +21,6 @@ test('根格式仍为4.2,作者Schema保持主仓固定字节,合成fixtures const root = JSON.parse(readFileSync(join(source,'manifest.json'),'utf8')) assert.equal(root.version,'4.2.0') assert.equal(readFileSync(join(source,'SCHEMA_VERSION'),'utf8').trim(),'4.2.0') - assert.equal(root.stats.webBundles,undefined) assert.equal(createHash('sha256').update(readFileSync(join(source,'schemas/registry-entry.v4.3.schema.json'))).digest('hex'),'27a7f86b82f5d88bfe1eae2d083540359ed8f2fccffa8f3d040fdc58d0cf3900') for (const id of readdirSync(join(source,'fixtures/authoring/entries'))) assert.equal(existsSync(join(source,'entries',id)),false,id) }) diff --git a/scripts/authored-release.test.mjs b/scripts/authored-release.test.mjs index 420525e..1300386 100644 --- a/scripts/authored-release.test.mjs +++ b/scripts/authored-release.test.mjs @@ -132,7 +132,7 @@ test('普通条目与external-integration不被作者Schema重定义', () => { rmSync(join(root, 'entries', id), { recursive: true }) mutate(root, 'manifest.json', manifest => { manifest.stats.totalEntries -= 1 - const stat = { 'native-app': 'nativeApps', 'docker-app': 'dockerApps' }[entry.type] + const stat = { 'native-app': 'nativeApps', 'docker-app': 'dockerApps', 'web-bundle': 'webBundles' }[entry.type] if (stat) manifest.stats[stat] -= 1 }) } diff --git a/scripts/catalog/validator.test.mjs b/scripts/catalog/validator.test.mjs index 9bfd513..917c37c 100644 --- a/scripts/catalog/validator.test.mjs +++ b/scripts/catalog/validator.test.mjs @@ -198,25 +198,11 @@ function codes(report) { } test('当前 v4.2 条目保持可读,原生应用与既有 App/Service 具备 sidecar', () => { - const report = validateRegistry(repoRoot) + const report = validateRegistry(repoRoot, { requireSidecars: true }) assert.equal(report.ok, true, JSON.stringify(report.errors, null, 2)) - assert.deepEqual({ - totalEntries: report.counts.totalEntries, - dockerApps: report.counts.dockerApps, - nativeApps: report.counts.nativeApps, - mcpServices: report.counts.mcpServices, - httpApis: report.counts.httpApis, - externalIntegrations: report.counts.externalIntegrations, - }, { - totalEntries: 32, - dockerApps: 9, - nativeApps: 4, - mcpServices: 13, - httpApis: 5, - externalIntegrations: 1, - }) - assert.equal(report.counts.sidecars + report.counts.legacyOnly, report.counts.totalEntries - report.counts.externalIntegrations) - assert.equal(report.warnings.filter((item) => item.code === 'missing-sidecar').length, report.counts.legacyOnly) + assert.ok(report.counts.totalEntries > 0) + assert.equal(report.counts.legacyOnly, 0) + assert.equal(report.counts.sidecars, report.counts.totalEntries - report.counts.externalIntegrations) }) test('合法 listing-only App sidecar 通过', () => {