Files
zpan/scripts/lint-test-boundaries.mjs
Jasper Van b92df828ab ci: parallelize and isolate test suites (#556)
* ci: parallelize and isolate test suites

* ci: avoid unavailable Playwright video runtime

* ci: shard coverage and cache docker smoke

* ci: balance Playwright shards by test

* ci: smoke test the CLI container

* ci: enforce merged coverage thresholds

* ci: ratchet canonical coverage baseline

* ci: make coverage ratchet lossless

* ci: organize parallel gates by responsibility

* perf(ci): reduce total runner time

* perf(ci): balance runner cost and latency

* perf(ci): suppress passing test logs

* fix(test): make coverage sorting proof deterministic

* perf(docker): exclude test-only build inputs

* perf(ci): scope Docker smokes to packaging changes

* refactor(test): enforce fast test boundaries

* test: isolate coverage ownership

* perf(test): run backend projects concurrently

* perf(ci): separate test layers by runtime

* perf(test): separate integration boundaries

* perf(ci): prioritize test runners

* docs(ci): clarify package scheduling

* test: restore shared Cloudflare mocks

* fix(preview): isolate Cloudflare E2E build config

* fix(auth): bind preview sessions to request origin

* revert: remove ineffective preview auth workaround

* fix(auth): stop signing JWTs on session reads
2026-08-05 15:01:12 -04:00

24 lines
889 B
JavaScript

import { readFileSync, readdirSync } from 'node:fs'
import { join, relative } from 'node:path'
const root = process.cwd()
const violations = walk(join(root, 'server'))
.filter((file) => file.endsWith('.test.ts'))
.filter((file) => !/\.(?:integration|cf|libsql)\.test\.ts$/.test(file))
.filter((file) => /createTestApp|better-sqlite3|new Database\s*\(/.test(readFileSync(file, 'utf8')))
.map((file) => relative(root, file))
if (violations.length > 0) {
console.error('Unit tests must not create database-backed fixtures.')
console.error('Rename these files to *.integration.test.ts:')
for (const file of violations) console.error(`- ${file}`)
process.exit(1)
}
function walk(directory) {
return readdirSync(directory, { withFileTypes: true }).flatMap((entry) => {
const path = join(directory, entry.name)
return entry.isDirectory() ? walk(path) : [path]
})
}