Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
test(stress): pin the shape of scripts/stress/iteration-weights.json (sorted test paths, positive whole milliseconds), so the weights file has a test lane
garrytand78dd7786882
diff --git a/scripts/structural-suites.tsv b/scripts/structural-suites.tsvindex 9255410a9c..e112864d50 100644--- a/scripts/structural-suites.tsv+++ b/scripts/structural-suites.tsv@@ -343,6 +343,7 @@ test/scripts/serial-files.test.ts scripts/serial-files.tsv (serial lane manifesttest/scripts/stress-gate.test.ts docs anchors 1 readFileSynctest/scripts/stress-gate.test.ts gate plan 5 readFileSynctest/scripts/stress-plan.test.ts execution profiles 3 readFileSync+test/scripts/stress-plan.test.ts shards 5 readFileSynctest/scripts/test-env-opt-ins-guard.test.ts check-test-env-opt-ins 5 readFileSynctest/scripts/test-shard.slow.test.ts test-shard.sh — LPT balance contract 5 readFileSynctest/scripts/test-shard.slow.test.ts test-shard.sh — exclusion contract 7 readFileSyncdiff --git a/test/scripts/stress-plan.test.ts b/test/scripts/stress-plan.test.tsindex d1ecbde006..8a97e94ec9 100644--- a/test/scripts/stress-plan.test.ts+++ b/test/scripts/stress-plan.test.ts@@ -193,4 +193,15 @@ describe('shards', () => {expect(shards.map(s => s.items.reduce((n, i) => n + i.count, 0))).toEqual([6, 4]);expect(iterationEstimateMs('test/other.test.ts', 'postgres-arm', measured)).toBe(150_000);});++ test('scripts/stress/iteration-weights.json keeps the shape mine-iterations writes: sorted test paths, positive whole milliseconds', () => {+ const weights = JSON.parse(readFileSync(join(REPO, 'scripts/stress/iteration-weights.json'), 'utf8')) as Record<string, unknown>;+ const files = Object.keys(weights);+ expect(files.length).toBeGreaterThan(0);+ expect(files).toEqual([...files].sort((a, b) => (a < b ? -1 : 1)));+ for (const [file, ms] of Object.entries(weights)) {+ expect(file).toMatch(/^test\/.+\.test\.ts$/);+ expect(Number.isInteger(ms) && (ms as number) > 0).toBe(true);+ }+ });});