Files
houseplan-card/scripts/trail-resume-test-guard.mjs
T
Codexandclaude[bot] 51beeeb2c4 ci: mutant selection sees wrapper defaults, guard imports, fixtures and registry edits
guardInputs() replaces guardFiles() in selection and fingerprints: the
files named in the guard, the GUARD_INPUTS a wrapper declares (read
statically — the wrappers run on import), and the closure of imports and
path literals of every guard file, stopping at src/** which stays the
patch side. A diff that touches the registry itself selects every added or
changed definition against the base registry read from git. Five mutants
guard the manifest and this selection.

Issue: #492
User-Visible: no
2026-09-08 21:55:07 +00:00

25 lines
973 B
JavaScript

#!/usr/bin/env node
import { spawnSync } from 'node:child_process';
import { existsSync } from 'node:fs';
import { join } from 'node:path';
const localPython = process.platform === 'win32'
? join(process.cwd(), '.venv', 'Scripts', 'python.exe')
: join(process.cwd(), '.venv', 'bin', 'python');
const python = process.env.PYTHON
|| (existsSync(localPython) ? localPython : (process.platform === 'win32' ? 'python' : 'python3'));
/** Входы обёртки для отбора мутантов (#492 §6.1): запускаемые pytest-модули. */
export const GUARD_INPUTS = ['tests_backend/test_trails.py', 'tests_backend/test_trail_recorder.py'];
const result = spawnSync(python, [
'-m', 'pytest',
...GUARD_INPUTS,
'-q', '-k', 'resume or short_available',
], { stdio: 'inherit' });
if (result.error) {
console.error(`trail resume guard could not start ${python}: ${result.error.message}`);
process.exit(2);
}
process.exit(result.status ?? 2);