Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

fix(test:stress): list a file that skips for want of its owning job's prerequisite as not stressed

garrytan60557b495353
diff --git a/scripts/stress/README.md b/scripts/stress/README.md
index fbbf10d188..36bada0d29 100644
--- a/scripts/stress/README.md
+++ b/scripts/stress/README.md
@@ -59,9 +59,10 @@ passed, 1 a failure, 2 a usage or setup error, 130/143 cancelled.
Paid-provider files (`*.live.test.ts`, `test/live/`,
`scripts/e2e-live-key-only.txt`) are listed as not stressed. A file whose
-every test skips on this platform, or skips without an unavailable secret, is
-listed as not stressed with that reason; any other run with zero executed
-tests fails.
+every test skips on this platform, skips without an unavailable secret, or
+skips without a prerequisite its owning job in `heavy-tests.yml`,
+`native-locks.yml` or `macos-validation.yml` installs, is listed as not
+stressed with that reason; any other run with zero executed tests fails.
## Isolation and receipts
diff --git a/scripts/stress/run.ts b/scripts/stress/run.ts
index 5899d9a734..c2bebd8cd7 100644
--- a/scripts/stress/run.ts
+++ b/scripts/stress/run.ts
@@ -346,11 +346,16 @@ export interface FileResult {
reason?: string; seedBase: number; firstIteration: number; iterations: IterationResult[]; reproduce: string;
}
+/** Workflows whose dedicated jobs provide prerequisites (agent binaries, native targets) the stress shards lack. */
+const OWNING_WORKFLOWS = ['heavy-tests.yml', 'native-locks.yml', 'macos-validation.yml'];
+
function skipReason(file: string): string | null {
const text = readFileSync(join(ROOT, file), 'utf8');
if (/process\.platform/.test(text)) return `every test skipped on ${process.platform}: platform-only tests, run by their owning native lane; not stressed`;
const keys = [...new Set([...text.matchAll(/process\.env\.([A-Z0-9_]*(?:API_KEY|TOKEN|SECRET))/g)].map(m => m[1]!))];
if (keys.length) return `every test skipped without ${keys.join(', ')} (secret not available here); not stressed`;
+ const owner = OWNING_WORKFLOWS.find(w => { const p = join(ROOT, '.github/workflows', w); return existsSync(p) && readFileSync(p, 'utf8').includes(file); });
+ if (owner) return `every test skipped here: its prerequisite (agent binary or native target) comes from its owning job in .github/workflows/${owner}; not stressed`;
return null;
}
diff --git a/test/scripts/test-stress.test.ts b/test/scripts/test-stress.test.ts
index 67cae18233..ec43c4a5c0 100644
--- a/test/scripts/test-stress.test.ts
+++ b/test/scripts/test-stress.test.ts
@@ -78,6 +78,16 @@ describe('test:stress runner', () => {
expect(r.manifest.not_stressed.map((n: { file: string }) => n.file)).toEqual(['test/platform.test.ts']);
});
+ test('a file that skips without a prerequisite its owning heavy-tests job installs is not stressed', () => {
+ const root = tree({
+ 'test/door.serial.test.ts': "import { describe, test } from 'bun:test';\nconst BIN = Bun.which('some-agent-cli-not-installed');\ndescribe.skipIf(!BIN)('door', () => { test('install', () => {}); });\n",
+ '.github/workflows/heavy-tests.yml': 'jobs:\n door:\n steps:\n - run: bun test --timeout=600000 test/door.serial.test.ts\n',
+ });
+ const r = stress(root, 'test/door.serial.test.ts', '--iterations', '2');
+ expect(r.code, r.out).toBe(0);
+ expect(r.manifest.files[0]).toMatchObject({ status: 'not-stressed', reason: expect.stringContaining('owning job in .github/workflows/heavy-tests.yml') });
+ });
+
test('a test that ran in the first iteration and skips later is an unexpected skip', () => {
const root = tree({ 'test/vanish.test.ts': "import { test } from 'bun:test';\nif (Number(process.env.GBRAIN_TEST_SEED) % 2 === 1) test('sometimes', () => {});\ntest('always', () => {});\n" });
const r = stress(root, 'test/vanish.test.ts', '--iterations', '2', '--seed', '1');