Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
test(D14): backend- and filesystem-gated cases report skip, not pass
garrytanc08bdae489fb
diff --git a/test/persistence-git-publication.test.ts b/test/persistence-git-publication.test.tsindex 37c4c3de8a..4fbc076696 100644--- a/test/persistence-git-publication.test.ts+++ b/test/persistence-git-publication.test.ts@@ -6,6 +6,7 @@ import { git, gitFixture } from './helpers/git-publication.ts';import { withEnv } from './helpers/with-env.ts';const fixtures: ReturnType<typeof gitFixture>[] = [];+const caseInsensitiveFs = (() => { const probe = gitFixture(); try { return probe.caseInsensitive; } finally { probe.cleanup(); } })();function fixture() { const f = gitFixture(); fixtures.push(f); return f; }afterEach(() => { for (const f of fixtures.splice(0)) f.cleanup(); });@@ -90,9 +91,8 @@ test('native path lookup fixes existing aliases but never folds POSIX case-distipublished(f, f.caseInsensitive ? 'Notes/new.md' : 'notes/new.md', 'New\n');});-test('native ambiguous aliases refuse instead of picking one hardlink name', async () => {+test.skipIf(!caseInsensitiveFs)('native ambiguous aliases refuse instead of picking one hardlink name', async () => {const f = fixture();- if (!f.caseInsensitive) return;writeFileSync(join(f.root, 'Notes', 'Old.md'), 'Native\n');linkSync(join(f.root, 'Notes', 'Old.md'), join(f.root, 'Notes', 'Other.md'));const before = git(f.root, 'rev-parse', 'HEAD');@@ -100,9 +100,8 @@ test('native ambiguous aliases refuse instead of picking one hardlink name', asyexpect(git(f.root, 'rev-parse', 'HEAD')).toBe(before);});-test('case-distinct directories retain separate files and staged changes', async () => {+test.skipIf(caseInsensitiveFs)('case-distinct directories retain separate files and staged changes', async () => {const f = fixture();- if (f.caseInsensitive) return;mkdirSync(join(f.root, 'notes'));for (const directory of ['Notes', 'notes']) writeFileSync(join(f.root, directory, 'page.md'), `Before ${directory}\n`);git(f.root, 'add', '.'); git(f.root, '-c', 'core.hooksPath=', 'commit', '-m', 'Distinct paths');diff --git a/test/persistence-journal.test.ts b/test/persistence-journal.test.tsindex ad64d698d8..15fff76b24 100644--- a/test/persistence-journal.test.ts+++ b/test/persistence-journal.test.ts@@ -84,9 +84,8 @@ describe('durable mutation journal', () => {}});- test('Postgres admission survives a real counter lock held beyond one SQL lock deadline', async () => {- const engine = engines.find(candidate => candidate.kind === 'postgres');- if (!engine) return;+ test.skipIf(!process.env.DATABASE_URL)('Postgres admission survives a real counter lock held beyond one SQL lock deadline', async () => {+ const engine = engines.find(candidate => candidate.kind === 'postgres')!;const a = await admission(engine, 'admission-counter-contention');let held!: () => void;const ready = new Promise<void>(resolve => { held = resolve; });@@ -105,9 +104,8 @@ describe('durable mutation journal', () => {} finally { await blocker; }});- test('persistent Postgres contention returns a bounded typed error without inventing an accepted receipt', async () => {- const engine = engines.find(candidate => candidate.kind === 'postgres');- if (!engine) return;+ test.skipIf(!process.env.DATABASE_URL)('persistent Postgres contention returns a bounded typed error without inventing an accepted receipt', async () => {+ const engine = engines.find(candidate => candidate.kind === 'postgres')!;const a = await admission(engine, 'admission-bounded-contention');let held!: () => void;let release!: () => void;@@ -134,9 +132,8 @@ describe('durable mutation journal', () => {await cancelWriteRequest(engine, a.principal, a.requestId!);});- test('Postgres admission progresses while short counter transactions keep the lock queue occupied', async () => {- const engine = engines.find(candidate => candidate.kind === 'postgres');- if (!engine) return;+ test.skipIf(!process.env.DATABASE_URL)('Postgres admission progresses while short counter transactions keep the lock queue occupied', async () => {+ const engine = engines.find(candidate => candidate.kind === 'postgres')!;const a = await admission(engine, 'admission-queue-progress');await engine.executeRaw("INSERT INTO persistence_counters(key) VALUES('brain') ON CONFLICT DO NOTHING");const [before] = await engine.executeRaw<{ lifetime_ids: string }>("SELECT lifetime_ids::text FROM persistence_counters WHERE key='brain'");@@ -173,9 +170,8 @@ describe('durable mutation journal', () => {await cancelWriteRequest(engine, a.principal, a.requestId!);}, 15000);- test('contended admissions release PostgreSQL pool capacity for reads before the counter unlocks', async () => {- const engine = engines.find(candidate => candidate.kind === 'postgres');- if (!engine) return;+ test.skipIf(!process.env.DATABASE_URL)('contended admissions release PostgreSQL pool capacity for reads before the counter unlocks', async () => {+ const engine = engines.find(candidate => candidate.kind === 'postgres')!;const inputs = await Promise.all(Array.from({ length: 3 }, (_, i) => admission(engine, `admission-reader-capacity-${i}`)));await engine.executeRaw("INSERT INTO persistence_counters(key) VALUES('brain') ON CONFLICT DO NOTHING");const [before] = await engine.executeRaw<{ lifetime_ids: string }>("SELECT lifetime_ids::text FROM persistence_counters WHERE key='brain'");