mirror of
https://github.com/Matysh/houseplan-card
synced 2026-09-28 19:01:34 +00:00
fix: verify demo bundle freshness for smokes too
Golden runs, benchmarks and documentation captures each called assertFreshDemoBundle; the smoke launcher never did, so all ~128 smokes could silently test a stale demo/srv/assets bundle. On #234 that cost a round of analysis: three assertions went red and a fourth went green, because the old code was wrong in two places that agreed with each other, and a mixed result reads as a logic defect rather than a stale artefact. launch() now runs the check once for every smoke, against the repository root rather than the serving root — demo/srv has no src/** to fingerprint. HP_ALLOW_STALE_BUNDLE=1 skips it for debugging and warns out loud, because a guard that says nothing when it steps aside is the silent success this project keeps removing. A mutation entry proves the call cannot quietly disappear. Issue: #236 User-Visible: no
This commit is contained in:
@@ -81,6 +81,19 @@ export const MUTANTS = [
|
||||
replace: ' for (let i = 0; i < Math.min(count, (recorded?.length ?? 0)); i++) {',
|
||||
}],
|
||||
},
|
||||
{
|
||||
id: 'smoke-launcher-skips-freshness',
|
||||
guard: 'node --test --test-name-pattern="launcher enforces the gate" '
|
||||
+ 'test/bundle-freshness.test.mjs',
|
||||
because: 'a smoke run against a stale demo bundle does not fail cleanly — on #234 three '
|
||||
+ 'assertions went red while a fourth went green, because the old code was wrong in two '
|
||||
+ 'places that agreed with each other, and the mixed result reads as a logic defect (#236)',
|
||||
patches: [{
|
||||
file: 'demo/serve.mjs',
|
||||
find: ' await assertFreshDemoBundleUnlessAllowed(page, REPO_ROOT);',
|
||||
replace: ' // freshness intentionally skipped by the mutant',
|
||||
}],
|
||||
},
|
||||
{
|
||||
id: 'snapn-returns-input-near-node',
|
||||
guard: 'npx tsc -p tsconfig.test.json && node scripts/fix-test-build.mjs '
|
||||
@@ -684,8 +697,8 @@ export const MUTANTS = [
|
||||
+ 'changing the separate room-fill gradient',
|
||||
patches: [{
|
||||
file: 'src/device-presentation.ts',
|
||||
find: ' if (lqi <= 40) return \'low\';',
|
||||
replace: ' if (lqi < 40) return \'low\';',
|
||||
find: ' if (lqi <= 40) return \\'low\\';',
|
||||
replace: ' if (lqi < 40) return \\'low\\';',
|
||||
}],
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user