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>
This commit is contained in:
garrytanandcapy-ai[bot] committed 2026-10-28 11:52:56 +00:00
1 parent 0e2e112182
commit 655fa0cdab
1 file changed
+6 -1
+6 -1
View File
@@ -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');
});
});