Skip to content

Commit 7491976

Browse files
committed
test(dogfood): the newly landed position-environment-write-through boot goes through bootShowcase
bootShowcase passes the showcase's own directory as hostRoot, so the file no longer changes the process cwd to reach it. Its databaseFile option and its two reboots after stop() are unchanged. Claude-Session: https://claude.ai/code/session_01DhTqaEHqPVSVnAkjG3jywn Co-authored-by: Claude <noreply@anthropic.com>
1 parent 6b16077 commit 7491976

1 file changed

Lines changed: 3 additions & 10 deletions

File tree

‎packages/qa/dogfood/test/position-environment-write-through.dogfood.test.ts‎

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,22 +31,18 @@
3131
// boot changes nothing.
3232

3333
import { describe, it, expect, beforeAll, afterAll } from 'vitest';
34-
import showcaseStack from '@objectstack/example-showcase';
35-
import { bootStack, type VerifyStack } from '@objectstack/verify';
34+
import { type VerifyStack } from '@objectstack/verify';
35+
import { bootShowcase } from './showcase-boot.js';
3636
import { createSecurityCatalogReader } from '@objectstack/core';
37-
import { fileURLToPath } from 'node:url';
3837
import { mkdtempSync, rmSync } from 'node:fs';
3938
import { tmpdir } from 'node:os';
4039
import { join } from 'node:path';
4140

42-
/** Package-relative refs resolve against the cwd — see the sibling cold-boot files. */
43-
const SHOWCASE_DIR = fileURLToPath(new URL('../../../../examples/app-showcase/', import.meta.url));
4441
const SYS = { context: { isSystem: true } } as const;
4542
/** The backfill's ledger row (`position-environment-backfill.ts`). */
4643
const LEDGER_ID = 'adr-0131-position-environment-backfill';
4744

4845
describe('[ADR-0131 D3] Setup positions reach the environment ledger under single (showcase)', () => {
49-
let prevCwd: string;
5046
let dir: string;
5147
let db: string;
5248
let stack: VerifyStack | undefined;
@@ -68,22 +64,19 @@ describe('[ADR-0131 D3] Setup positions reach the environment ledger under singl
6864
return entry !== undefined && entry.name === name;
6965
};
7066
const start = async () => {
71-
stack = await bootStack(showcaseStack, { databaseFile: db });
67+
stack = await bootShowcase({ databaseFile: db });
7268
token = await stack.signIn();
7369
ql = await stack.kernel.getServiceAsync('objectql');
7470
};
7571

7672
beforeAll(async () => {
77-
prevCwd = process.cwd();
78-
process.chdir(SHOWCASE_DIR);
7973
dir = mkdtempSync(join(tmpdir(), 'dogfood-15196-s7-'));
8074
db = join(dir, 'showcase.db');
8175
await start();
8276
}, 300_000);
8377

8478
afterAll(async () => {
8579
await stack?.stop();
86-
if (prevCwd) process.chdir(prevCwd);
8780
if (dir) rmSync(dir, { recursive: true, force: true });
8881
});
8982

0 commit comments

Comments
 (0)