Files
gstack/test/claude-overlay-setup-lifecycle.test.ts
T
Garry Tanandcapy-ai[bot] 83ae96e086 v1.92.30.0 test(free): split files over the 60 s seed ceiling and the Windows doctor file, then reseed (GSTA-151 A) (#3585)
* test(free): split files over the 60 s seed ceiling and the Windows doctor file

Eight free test files the fresh recordings put over the seed ratchet's 60 s ceiling, and test/gstack-doctor.test.ts (343 s on Windows), are split by describe block or test with shared helpers moved to test/helpers/. Test bodies are unchanged.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* docs(todos): note the GSTA-151 seed-ceiling splits

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* test(free): reseed both duration seeds at this head

Recorded by free-durations-record.yml (open_pr=false) run 40818261447 at ec6faf1:
1,416 Linux files on ubicloud-standard-8 and the 795 curated Windows files on
windows-latest. test/setup-codex-scope.test.ts fell to 49 s and leaves the
seed allowlist.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* chore: changelog entry for the GSTA-151 seed-ceiling splits (unreleased)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* test(free): split test/ubicloud-runner.test.ts over the 60 s seed ceiling; keep setup-codex-scope allowlisted

The reseed at the main merge (free-durations-record run 41226501374, 221320e) put
test/ubicloud-runner.test.ts, which main added after this branch's first reseed,
at 127 s and test/setup-codex-scope.test.ts back at 66 s. The fake-API cases move
into four parts by describe topic with their shared fake VM in
test/helpers/ubi-runner-fake-vm.ts (46 tests before and after). The allowlist
keeps main's setup-codex-scope entry.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* test(free): reseed both duration seeds at the main merge; changelog fragment

Recorded by free-durations-record.yml (open_pr=false) run 41229924108 at 4f5bd2d:
1,470 Linux files on ubicloud-standard-8 and 822 curated Windows files. The
Windows recorder was red on browse/test/cookie-import-native-job.test.ts (known
Edge leak) and test/hook-scripts.test.ts, plus test/free-seed-ratchet.test.ts on
both OSes against the pre-reseed seed; their durations are kept. The CHANGELOG
entry moves to changelog.d/ now that main runs on fragments.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* docs: correct the seed-ceiling TODO and the ubicloud-runner test paths after the split

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

---------

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
2026-11-01 14:23:49 +00:00

60 lines
2.9 KiB
TypeScript

/**
* W7 Claude overlay opt-in (`./setup --claude-model <id>`): the overlay render lifecycle with gbrain and failures.
* Shared fixture and overlay helpers: test/helpers/claude-overlay-fixture.ts.
*/
import { afterAll, afterEach, describe, expect, test } from 'bun:test';
import { existsSync } from 'node:fs';
import { join } from 'node:path';
import { MARKER, fakeDetect, setup, config, defaultRender, record, served } from './helpers/claude-overlay-fixture';
import { cleanupFixtures, cleanupSeed, makeFixture, makeSource, put } from './helpers/install-fixture';
import { readSkillStartup } from './helpers/skill-startup';
afterEach(cleanupFixtures);
afterAll(cleanupSeed);
describe.skipIf(process.platform === 'win32')('overlay render lifecycle with gbrain and failures', () => {
test('gbrain present → absent keeps a pinned overlay; a failed detector still renders it', () => {
const f = makeFixture();
const src = makeSource(f, join(f.home, '.claude/skills/gstack'));
fakeDetect(src);
const skills = join(f.home, '.claude/skills');
put(join(f.home, 'gbrain-mode'), 'ok');
expect(setup(f, src, ['--claude-model', 'claude-opus-4-8']).status).toBe(0);
expect(record(defaultRender(f))).toMatchObject({ overlay: 'opus-4-8', gbrain: 'ok' });
expect(served(skills)).toContain(MARKER);
put(join(f.home, 'gbrain-mode'), 'absent');
const refresh = config(f, src, 'gbrain-refresh');
expect(refresh.status, refresh.stdout + refresh.stderr).toBe(0);
expect(refresh.stdout).toContain('gbrain not detected');
expect(record(defaultRender(f))).toMatchObject({ overlay: 'opus-4-8', gbrain: 'absent' });
expect(served(skills)).toContain(MARKER);
put(join(f.home, 'gbrain-mode'), 'fail');
const failed = setup(f, src);
expect(failed.status, failed.out).toBe(0);
expect(failed.out).toContain('gstack-gbrain-detect failed');
expect(record(defaultRender(f))).toMatchObject({ overlay: 'opus-4-8', gbrain: 'unknown' });
expect(served(skills)).toContain(MARKER);
}, 240_000);
test('gbrain present → absent with the default overlay drops the brain render', () => {
const f = makeFixture();
const src = makeSource(f, join(f.home, '.claude/skills/gstack'));
fakeDetect(src);
expect(setup(f, src).status).toBe(0);
put(join(f.home, 'gbrain-mode'), 'ok');
expect(config(f, src, 'gbrain-refresh').status).toBe(0);
expect(existsSync(join(defaultRender(f), 'autoplan/SKILL.md'))).toBe(true);
expect(record(defaultRender(f))).toMatchObject({ overlay: 'claude', source: 'default', gbrain: 'ok' });
put(join(f.home, 'gbrain-mode'), 'absent');
const r = config(f, src, 'gbrain-refresh');
expect(r.status, r.stdout + r.stderr).toBe(0);
expect(existsSync(defaultRender(f))).toBe(false);
expect(existsSync(`${defaultRender(f)}.overlay`)).toBe(false);
expect(served(join(f.home, '.claude/skills'))).toBe(readSkillStartup(join(src, 'autoplan/SKILL.md')));
}, 180_000);
});