test(renderer): run every Electron suite from one command
The Electron suites were only reachable one npm script at a time, so a new one was covered by whoever remembered it existed. test:electron:all builds once and runs all five, reporting a single summary and a non-zero exit. The runner lives under tests/ rather than app/scripts/, which .gitignore excludes entirely. The image row spacing assertion also stops hard-coding the current gap -- it had 0.59px of headroom -- and calibrates against the spacing the rest of the timeline is using. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
5f7f6d7cd5
commit
b72e0fcaf3
@@ -0,0 +1,32 @@
|
||||
// Runs every Electron regression suite against one build and reports a single
|
||||
// summary. Each suite already prints its own PASS/FAIL lines; this exists so a
|
||||
// new suite is covered by one command instead of only being run by whoever
|
||||
// remembers it is there.
|
||||
|
||||
import { spawnSync } from 'node:child_process'
|
||||
import path from 'node:path'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import electron from 'electron'
|
||||
|
||||
const appRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..')
|
||||
const suites = [
|
||||
'electron-concurrency.mjs',
|
||||
'electron-session-images.mjs',
|
||||
'electron-session-virtualization.mjs',
|
||||
'electron-session-reader-state.mjs',
|
||||
'electron-file-references.mjs',
|
||||
]
|
||||
|
||||
const failed = []
|
||||
for (const suite of suites) {
|
||||
console.log(`\n=== ${suite} ===`)
|
||||
const result = spawnSync(electron, ['--no-sandbox', path.join('tests', suite)], {
|
||||
cwd: appRoot,
|
||||
stdio: 'inherit',
|
||||
})
|
||||
if (result.status !== 0) failed.push(`${suite} (exit ${result.status ?? 'signal'})`)
|
||||
}
|
||||
|
||||
console.log(`\n${suites.length - failed.length}/${suites.length} Electron suites passed`)
|
||||
for (const failure of failed) console.error(`FAILED: ${failure}`)
|
||||
process.exit(failed.length ? 1 : 0)
|
||||
Reference in New Issue
Block a user