mirror of
https://github.com/Matysh/houseplan-card
synced 2026-09-30 11:49:16 +00:00
ci: include dynamic backend inputs in gates (#542)
Issue: #542 User-Visible: no
This commit is contained in:
committed by
claude[bot]
parent
9c08d583ab
commit
744f502ba3
@@ -271,6 +271,21 @@ const BROWSER_PROTOCOL = ['demo/serve.mjs', 'demo/srv/demo.html', 'demo/bundle-f
|
||||
const WORKFLOW = ['.github/workflows/validate.yml'];
|
||||
/** Протокол реюза: кто считает ключ, тот и вход (§5.1 protocol). */
|
||||
const REUSE_PROTOCOL = ['scripts/gate-reuse.mjs', 'scripts/check-inputs.mjs'];
|
||||
/**
|
||||
* Cross-runtime inputs, которые pytest читает динамически и которые поэтому
|
||||
* нельзя вывести из статических import/string ссылок (#542).
|
||||
*
|
||||
* test_validation.py собирает путь к TS-константе через os.path.join и имя
|
||||
* fixture через Python f-string -> Node dynamic import; test_support_package.py
|
||||
* тем же способом читает logic.ts. Держим точные файлы, не src/** или
|
||||
* demo/fixtures/**: остальные UI-входы не должны без причины запускать backend.
|
||||
*/
|
||||
const BACKEND_DYNAMIC_INPUTS = [
|
||||
'src/plan-optimizer.ts',
|
||||
'src/logic.ts',
|
||||
'demo/fixtures/large-house.mjs',
|
||||
'demo/fixtures/visual-matrix.mjs',
|
||||
];
|
||||
|
||||
export const CHECKS = {
|
||||
preflight: {
|
||||
@@ -315,6 +330,7 @@ export const CHECKS = {
|
||||
entries: ['tests_backend/**/*.py', 'scripts/support-relay/tests/**/*.py', 'scripts/dump-config-schema.py'],
|
||||
// manifest.json несёт версию: кандидат релиза обязан прогнать backend заново
|
||||
roots: ['custom_components/**/*.py', 'custom_components/houseplan/manifest.json', 'scripts/support-relay/**/*.py',
|
||||
...BACKEND_DYNAMIC_INPUTS,
|
||||
'tests_backend/**', 'pyproject.toml', 'pytest.ini', 'scripts/backend-coverage-baseline.txt',
|
||||
'scripts/config-schema.json', ...REUSE_PROTOCOL, ...WORKFLOW],
|
||||
reuse: true,
|
||||
|
||||
@@ -3915,6 +3915,17 @@ const MUTANT_DEFINITIONS = [
|
||||
replace: " roots: ['src/**', 'custom_components/**/*.py', 'custom_components/houseplan/manifest.json', 'scripts/support-relay/**/*.py',",
|
||||
}],
|
||||
},
|
||||
{
|
||||
id: 'backend-dynamic-inputs-dropped',
|
||||
guard: 'node --test --test-name-pattern="#542" test/check-inputs.test.mjs test/gate-reuse.test.mjs',
|
||||
because: 'backend pytest reads selected TS sources and browser fixtures through os.path.join and a '
|
||||
+ 'Python f-string dynamic import; without exact roots selection and reuse silently miss them (#542)',
|
||||
patches: [{
|
||||
file: 'scripts/check-inputs.mjs',
|
||||
find: ' ...BACKEND_DYNAMIC_INPUTS,',
|
||||
replace: ' // mutant: dynamic cross-runtime inputs are absent',
|
||||
}],
|
||||
},
|
||||
{
|
||||
id: 'guard-inputs-ignore-wrapper-defaults',
|
||||
guard: 'node --test --test-name-pattern="#492 §8.2" test/mutation-gate.test.mjs',
|
||||
|
||||
Reference in New Issue
Block a user