test: add architecture and OpenAPI validation tooling

This commit is contained in:
2026-08-25 12:22:14 +08:00
parent 24df851acf
commit 0e0b6f8264
13 changed files with 544 additions and 17 deletions
+17 -1
View File
@@ -117,12 +117,28 @@ test('Jenkins cannot invoke the Node contract without declaring a Node runtime',
if (!pipeline.includes('java-topology-contract.test.mjs')) continue
assert.match(
pipeline,
/(?:nodejs\s*\(|NodeJSInstallation|docker(?:\.image\([^)]*node:|\s+run[^\n]*\bnode:))/,
/(?:nodejs\s*\(|NodeJSInstallation|docker(?:\.image\([^)]*node:|\s+run[^\n]*\bnode:))/,
`${path} must declare how Node is provided before invoking the topology contract`
)
}
})
test('Maven verify publishes JaCoCo reports without enforcing a threshold', async () => {
const pom = await read('pom.xml')
const gitlab = await read('.gitlab-ci.yml')
const jacoco = pom.match(/<plugin>\s*<groupId>org\.jacoco<\/groupId>[\s\S]*?<\/plugin>/)?.[0] ?? ''
assert.match(jacoco, /<artifactId>jacoco-maven-plugin<\/artifactId>/)
assert.match(jacoco, /<goal>prepare-agent<\/goal>/)
assert.match(jacoco, /<phase>verify<\/phase>/)
assert.match(jacoco, /<goal>report<\/goal>/)
assert.match(jacoco, /<format>HTML<\/format>/)
assert.match(jacoco, /<format>XML<\/format>/)
assert.doesNotMatch(jacoco, /<goal>check<\/goal>|<rules>/)
assert.match(gitlab, /^ - "\*\*\/target\/site\/jacoco\/"$/m)
assert.match(gitlab, /^ - "\*\*\/target\/jacoco\.exec"$/m)
})
test('regional Compose and Nacos manifests cover the service-map topology', async () => {
const services = parseServiceMap(await read('deploy/service-map.yml'))
const composeByRegion = new Map([