mirror of
https://github.com/garrytan/gstack.git
synced 2026-07-18 21:47:20 +02:00
Merge pull request #2222 from time-attack/fix-brain-trust-policy-reject
fix(gstack-config): accept @local endpoint ids for brain_trust_policy
This commit is contained in:
@@ -108,6 +108,13 @@ describe('gstack-config', () => {
|
||||
expect(existsSync(join(nestedDir, 'config.yaml'))).toBe(true);
|
||||
});
|
||||
|
||||
test('brain trust policy accepts local endpoint suffix', () => {
|
||||
const { exitCode, stderr } = run(['set', 'brain_trust_policy@local', 'personal']);
|
||||
expect(exitCode).toBe(0);
|
||||
expect(stderr).toBe('');
|
||||
expect(run(['get', 'brain_trust_policy@local']).stdout).toBe('personal');
|
||||
});
|
||||
|
||||
// ─── list ─────────────────────────────────────────────────
|
||||
test('list shows all keys', () => {
|
||||
writeFileSync(join(stateDir, 'config.yaml'), 'auto_upgrade: true\nupdate_check: false\n');
|
||||
@@ -139,6 +146,12 @@ describe('gstack-config', () => {
|
||||
expect(stderr).toContain('alphanumeric');
|
||||
});
|
||||
|
||||
test('set rejects endpoint suffix with punctuation', () => {
|
||||
const { exitCode, stderr } = run(['set', 'brain_trust_policy@local-dev', 'personal']);
|
||||
expect(exitCode).toBe(1);
|
||||
expect(stderr).toContain('endpoint-id');
|
||||
});
|
||||
|
||||
test('set preserves value with sed special chars', () => {
|
||||
run(['set', 'test_special', 'a/b&c\\d']);
|
||||
const { stdout } = run(['get', 'test_special']);
|
||||
|
||||
Reference in New Issue
Block a user