mirror of
https://git.openapi.site/https://github.com/desirecore/registry.git
synced 2026-12-06 03:19:01 +08:00
test(registry): permit additional fixed app releases (#45)
Co-authored-by: Corona <corona@CoronadeMac-Mini-2.local>
This commit is contained in:
1 parent
7cac37deff
commit
6a4fea60e0
3 files changed
+5
-20
No files matched your search
@@ -21,7 +21,6 @@ test('根格式仍为4.2,作者Schema保持主仓固定字节,合成fixtures
|
|||||||
const root = JSON.parse(readFileSync(join(source,'manifest.json'),'utf8'))
|
const root = JSON.parse(readFileSync(join(source,'manifest.json'),'utf8'))
|
||||||
assert.equal(root.version,'4.2.0')
|
assert.equal(root.version,'4.2.0')
|
||||||
assert.equal(readFileSync(join(source,'SCHEMA_VERSION'),'utf8').trim(),'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')
|
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)
|
for (const id of readdirSync(join(source,'fixtures/authoring/entries'))) assert.equal(existsSync(join(source,'entries',id)),false,id)
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ test('普通条目与external-integration不被作者Schema重定义', () => {
|
|||||||
rmSync(join(root, 'entries', id), { recursive: true })
|
rmSync(join(root, 'entries', id), { recursive: true })
|
||||||
mutate(root, 'manifest.json', manifest => {
|
mutate(root, 'manifest.json', manifest => {
|
||||||
manifest.stats.totalEntries -= 1
|
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
|
if (stat) manifest.stats[stat] -= 1
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -198,25 +198,11 @@ function codes(report) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
test('当前 v4.2 条目保持可读,原生应用与既有 App/Service 具备 sidecar', () => {
|
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.equal(report.ok, true, JSON.stringify(report.errors, null, 2))
|
||||||
assert.deepEqual({
|
assert.ok(report.counts.totalEntries > 0)
|
||||||
totalEntries: report.counts.totalEntries,
|
assert.equal(report.counts.legacyOnly, 0)
|
||||||
dockerApps: report.counts.dockerApps,
|
assert.equal(report.counts.sidecars, report.counts.totalEntries - report.counts.externalIntegrations)
|
||||||
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)
|
|
||||||
})
|
})
|
||||||
|
|
||||||
test('合法 listing-only App sidecar 通过', () => {
|
test('合法 listing-only App sidecar 通过', () => {
|
||||||
|
|||||||
Reference in new issue
Block a user