mirror of
https://github.com/browseros-ai/BrowserOS.git
synced 2026-05-18 19:16:22 +00:00
* fix: run full browseros-agent test suite * fix: stabilize server test reporting in CI * fix: address PR review feedback * refactor: extract server core test runner * refactor: group server tests by filesystem * fix: align CI suites with server test groups * fix: provision server env for all CI suites * fix: stabilize ci checks * fix: report real test counts in ci
30 lines
726 B
TypeScript
30 lines
726 B
TypeScript
import { spawnSync } from 'node:child_process'
|
|
import { mkdirSync } from 'node:fs'
|
|
import { dirname, resolve } from 'node:path'
|
|
|
|
const projectRoot = resolve(import.meta.dir, '..')
|
|
const junitPath = process.env.BROWSEROS_JUNIT_PATH?.trim()
|
|
const testArgs = process.argv.slice(2)
|
|
|
|
const cmd = [process.execPath, 'test']
|
|
|
|
if (junitPath) {
|
|
const outputPath = resolve(projectRoot, junitPath)
|
|
mkdirSync(dirname(outputPath), { recursive: true })
|
|
cmd.push('--reporter=junit', `--reporter-outfile=${outputPath}`)
|
|
}
|
|
|
|
cmd.push(...testArgs)
|
|
|
|
const result = spawnSync(cmd[0], cmd.slice(1), {
|
|
cwd: projectRoot,
|
|
env: process.env,
|
|
stdio: 'inherit',
|
|
})
|
|
|
|
if (result.error) {
|
|
throw result.error
|
|
}
|
|
|
|
process.exit(result.status ?? 1)
|