Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

test: CI contract tests follow the 1.4.4 pin; audit and capture probes stop depending on 1.4.3's output

garrytan42741e10aa40
diff --git a/test/release-workflow.test.ts b/test/release-workflow.test.ts
index 7767fde3e7..7c0ec8b942 100644
--- a/test/release-workflow.test.ts
+++ b/test/release-workflow.test.ts
@@ -29,7 +29,7 @@ describe('release.yml ↔ binary-self-update asset contract', () => {
test('release compiler is covered by the required native runtime matrix', () => {
const build = WORKFLOW.slice(WORKFLOW.indexOf(' build:'), WORKFLOW.indexOf(' release:'));
const compiler = build.match(/bun-version:\s*(\S+)/)?.[1];
- expect(compiler).toBe('1.4.3');
+ expect(compiler).toBe('1.4.4');
const native = readFileSync(join(ROOT, '.github/workflows/native-locks.yml'), 'utf8');
const matrices = [...native.matchAll(/bun:\s*\[([^\]]+)\]/g)];
expect(matrices).toHaveLength(4);
diff --git a/test/scripts/capture-test-log.test.ts b/test/scripts/capture-test-log.test.ts
index fbadc0b972..d7ae00baca 100644
--- a/test/scripts/capture-test-log.test.ts
+++ b/test/scripts/capture-test-log.test.ts
@@ -181,7 +181,8 @@ describe('failure step summary (B13)', () => {
it('an assertion failure shows the diff and a -t repro for exactly that test', async () => {
const r = await failing('math.test.ts', `import { describe, test, expect } from 'bun:test';
-describe('math', () => { test('adds (carry)', () => { expect(1 + 1).toBe(3); }); test('passes', () => {}); });`);
+describe('math', () => { test('adds (carry)', () => { expect(1 + 1).toBe(3); });
+ test('passes', () => {}); });`);
expect(r.code).toBe(1);
expect(r.summary).toContain('### test (3): exited 1');
expect(r.summary).toContain('#### math.test.ts › math > adds (carry)');
diff --git a/test/scripts/ci-dependency-audit.test.ts b/test/scripts/ci-dependency-audit.test.ts
index 28b54f32d4..cf73ead934 100644
--- a/test/scripts/ci-dependency-audit.test.ts
+++ b/test/scripts/ci-dependency-audit.test.ts
@@ -34,17 +34,29 @@ async function audit(statuses: number[], env: Record<string, string> = {}) {
return { status, out: out + err, calls };
}
+/** Requests one `bun audit` makes against a registry that keeps answering 503: 1 on Bun 1.4.3, 6 on 1.4.4, which retries itself. */
+async function requestsPerAudit() {
+ plan = [503]; calls = 0;
+ const child = Bun.spawn(['bun', 'audit'], { cwd: ROOT, stdout: 'ignore', stderr: 'ignore', env: { ...process.env, BUN_CONFIG_REGISTRY: `http://127.0.0.1:${server.port}/` } });
+ await child.exited;
+ return calls;
+}
+
test('a registry that keeps answering 503 is audit_registry_unavailable after bounded retries, never advisories', async () => {
+ const perAudit = await requestsPerAudit();
+ expect(perAudit).toBeGreaterThan(0);
const run = await audit([503]);
expect(run.status).toBe(1);
expect(run.out).toContain('::error::audit_registry_unavailable');
expect(run.out).toContain('- 503 (attempt 3)');
expect(run.out).not.toContain('found advisories');
- expect(run.calls).toBe(6);
-});
+ // Root and admin/, three attempts each.
+ expect(run.calls).toBe(2 * 3 * perAudit);
+}, 60_000);
test('a 503 that recovers on retry is a clean audit', async () => {
- const run = await audit([503, 200]);
+ // Every request of the first attempt fails, so the script's own retry is what recovers.
+ const run = await audit([...Array<number>(await requestsPerAudit()).fill(503), 200]);
expect(run.status).toBe(0);
expect(run.out).toContain('retrying in 0s');
expect(run.out).toContain('bun audit: no advisories.');
diff --git a/test/scripts/data-safety-native-workflow.test.ts b/test/scripts/data-safety-native-workflow.test.ts
index b7bd6be426..eac0825565 100644
--- a/test/scripts/data-safety-native-workflow.test.ts
+++ b/test/scripts/data-safety-native-workflow.test.ts
@@ -38,7 +38,7 @@ describe('data-safety native CI coverage', () => {
expect(job['timeout-minutes']).toBe(5);
expect(job.strategy['fail-fast']).toBe(false);
expect(job.strategy.matrix.runner).toEqual(['windows-2022', 'windows-11-arm']);
- expect(job.strategy.matrix.bun).toEqual(['1.4.0', '1.4.3']);
+ expect(job.strategy.matrix.bun).toEqual(['1.4.0', '1.4.4']);
expect(job.steps.some(entry => entry.run === 'bun scripts/native/verify.ts')).toBe(true);
const step = job.steps.find(entry => entry.name === 'Compare native hidden-window launch behavior');
expect(step).toBeDefined();
@@ -73,7 +73,7 @@ describe('data-safety native CI coverage', () => {
expect(job['timeout-minutes']).toBe(5);
expect(job.strategy['fail-fast']).toBe(false);
expect(job.strategy.matrix.runner).toEqual(['windows-2022', 'windows-11-arm']);
- expect(job.strategy.matrix.bun).toEqual(['1.4.0', '1.4.3']);
+ expect(job.strategy.matrix.bun).toEqual(['1.4.0', '1.4.4']);
expect(job.steps.some(entry => entry.run === 'bun scripts/native/verify.ts')).toBe(true);
const step = job.steps.find(entry => entry.name === 'Compare cmdlet and direct dotnet ACL programs');
expect(step).toBeDefined();
diff --git a/test/scripts/native-lock-prebuilds.test.ts b/test/scripts/native-lock-prebuilds.test.ts
index 5a7739a744..dea5c64a3e 100644
--- a/test/scripts/native-lock-prebuilds.test.ts
+++ b/test/scripts/native-lock-prebuilds.test.ts
@@ -91,7 +91,7 @@ describe('native lock distribution integrity', () => {
continue;
}
const matrix = job.strategy.matrix;
- expect(matrix.bun).toEqual(['1.4.0', '1.4.3']);
+ expect(matrix.bun).toEqual(['1.4.0', '1.4.4']);
const script = job.steps.map(step => step.run ?? '').join('\n');
expect(script).toContain('bun scripts/ci-bun-install.ts --frozen-lockfile --ignore-scripts');
const lockTests = script.split('\n').find(line => /\bbun test\b/.test(line) && line.includes('test/native-lock.test.ts'));
@@ -108,7 +108,7 @@ describe('native lock distribution integrity', () => {
}
}
expect(pairs.sort()).toEqual(Object.keys(manifest.artifacts)
- .flatMap(target => ['1.4.0', '1.4.3'].map(bun => `${target}/${bun}`)).sort());
+ .flatMap(target => ['1.4.0', '1.4.4'].map(bun => `${target}/${bun}`)).sort());
expect(new Set(pairs).size).toBe(16);
});
});
diff --git a/test/scripts/postgres-unit-arms.test.ts b/test/scripts/postgres-unit-arms.test.ts
index 09036cafb7..a8339078eb 100644
--- a/test/scripts/postgres-unit-arms.test.ts
+++ b/test/scripts/postgres-unit-arms.test.ts
@@ -40,7 +40,7 @@ describe('postgres-unit-arms list', () => {
const shards = Array.from({ length: ARM_SHARDS }, (_, i) => i + 1);
expect(job).toContain(`shard: [${shards.join(', ')}]`);
expect(job).toContain(`Unit-lane PostgreSQL arms \${{ matrix.shard }}/${ARM_SHARDS}`);
- expect(job).toContain(`run: bun scripts/postgres-unit-arms.ts run \${{ matrix.shard }} ${ARM_SHARDS} \${{ matrix.bun == '1.4.3' && '--postgres-only' || '' }}\n`);
+ expect(job).toContain(`run: bun scripts/postgres-unit-arms.ts run \${{ matrix.shard }} ${ARM_SHARDS} \${{ matrix.bun == '1.4.4' && '--postgres-only' || '' }}\n`);
expect(job).toMatch(new RegExp(`- name: Require PostgreSQL arms of unit-lane suites\\n\\s+timeout-minutes: ${ARM_STEP_TIMEOUT_MS / 60_000}\\n`));
const ports = [...job.matchAll(/ports: \['(\d+):5432'\]/g)].map(m => m[1]);
const urls = [...job.matchAll(/postgres:\/\/gbrain_test:gbrain_test@127\.0\.0\.1:(\d+)\/gbrain_test/g)].map(m => m[1]);