From 655fa0cdab923783a8850ea0127ba830e3e5998a Mon Sep 17 00:00:00 2001 From: garrytan Date: Wed, 28 Oct 2026 11:52:56 +0000 Subject: [PATCH] test: check the doctor cores row's test_backend by behavior, not the reader's spelling test/owner-brief-contributor-banned.test.ts pinned the literal 'gstack-config" get test_backend' in bin/gstack-doctor-check.sh, which the in-process cfg read removed (CI: quick-bun-default, free-suite 14). It now runs gstack-doctor --check --require cores against a state root holding test_backend: ubicloud and expects test_backend=ubicloud, with an empty state root as the negative control (test_backend=local). The under-8-cores wording pin stays. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> --- test/owner-brief-contributor-banned.test.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/owner-brief-contributor-banned.test.ts b/test/owner-brief-contributor-banned.test.ts index 66b485130..03ca4a558 100644 --- a/test/owner-brief-contributor-banned.test.ts +++ b/test/owner-brief-contributor-banned.test.ts @@ -222,8 +222,13 @@ describe('test_backend config', () => { expect(cfg('set', 'test_backend', 'mars').code).not.toBe(0); expect(cfg('get', 'test_backend').out).toBe('ubicloud'); expect(cfg('defaults').out).toContain('test_backend'); + const coresRow = (root: string) => { + const r = spawnSync('bash', [path.join(ROOT, 'bin', 'gstack-doctor'), '--check', '--require', 'cores'], { encoding: 'utf8', timeout: 30_000, env: { ...process.env, GSTACK_STATE_ROOT: root, GSTACK_HOME: root } }); + return (r.stdout ?? '').split('\n').find(line => line.startsWith('PASS cores ')) ?? `no cores row: ${r.stdout}${r.stderr}`; + }; + expect(coresRow(state)).toContain('test_backend=ubicloud'); + expect(coresRow(tmp('gstack-test-backend-unset-'))).toContain('test_backend=local'); const doctor = fs.readFileSync(path.join(ROOT, 'bin', 'gstack-doctor-check.sh'), 'utf8'); - expect(doctor).toContain('gstack-config" get test_backend'); expect(doctor).toContain('set gstack-config set test_backend ubicloud, scripts/ubicloud/ubi-runner.sh'); }); });