test: isolate release checks and refresh docs

This commit is contained in:
Зарубин Филипп
2026-08-26 18:04:41 +03:00
parent 0315b82579
commit a67e1b4585
6 changed files with 49 additions and 41 deletions
+11 -6
View File
@@ -608,7 +608,12 @@ async function cmdSelftest() {
// 2–7. Изолированное состояние в tmp git-репо.
const tmp = mkdtempSync(path.join(os.tmpdir(), 'helioz-selftest-'))
try {
const env = { ...process.env, HELIOZ_HOME: tmp }
const env = {
...process.env,
HELIOZ_HOME: tmp,
GIT_CONFIG_GLOBAL: os.devNull,
GIT_CONFIG_SYSTEM: os.devNull,
}
const self = fileURLToPath(import.meta.url)
const execScript = path.join(path.dirname(self), 'helioz-exec.mjs')
const run = (args) => spawnSync(process.execPath, [self, ...args], { env, encoding: 'utf8' })
@@ -623,14 +628,14 @@ async function cmdSelftest() {
kimi: { invoke_read: stub, invoke_write: stub, stdin_prompt: true, roles: ['execute', 'verify'] },
codex: { invoke_read: stub, invoke_write: stub, stdin_prompt: true, roles: ['execute', 'verify'] },
}))
execFileSync('git', ['-C', tmp, 'init', '-q'])
execFileSync('git', ['-C', tmp, 'init', '-q'], { env })
writeFileSync(path.join(tmp, 'seed.txt'), 'seed\n')
execFileSync('git', ['-C', tmp, 'add', '-A'])
execFileSync('git', ['-C', tmp, '-c', 'user.email=g@c', '-c', 'user.name=gate', 'commit', '-qm', 'seed'])
execFileSync('git', ['-C', tmp, 'add', '-A'], { env })
execFileSync('git', ['-C', tmp, '-c', 'user.email=g@c', '-c', 'user.name=gate', 'commit', '-qm', 'seed'], { env })
// второй коммит: маркер требует base≠head с реальным diff (пустой diff = фордж, ревью kimi)
writeFileSync(path.join(tmp, 'seed.txt'), 'seed\nwork\n')
execFileSync('git', ['-C', tmp, 'add', '-A'])
execFileSync('git', ['-C', tmp, '-c', 'user.email=g@c', '-c', 'user.name=gate', 'commit', '-qm', 'work'])
execFileSync('git', ['-C', tmp, 'add', '-A'], { env })
execFileSync('git', ['-C', tmp, '-c', 'user.email=g@c', '-c', 'user.name=gate', 'commit', '-qm', 'work'], { env })
// пустая очередь → exit 2 (fail-closed)
eq(run(['--ready']).status, 2, 'пустая очередь обязана давать 2')