mirror of
https://github.com/tiennm99/ccs.git
synced 2026-09-02 18:18:43 +00:00
test(cliproxy): assert routing persistence via unified config loader
The previous assertion read the generated CLIProxy config.yaml directly via getConfigPathForPort(). On the self-hosted CI runner this produced ENOENT even though applyCliproxyRoutingStrategy returned 'config-only', indicating the read path and write path diverged in the full test-suite context. Verify persistence via loadUnifiedConfig() instead — that's the canonical source mutateUnifiedConfig writes to, independent of regenerateConfig's file-path resolution.
This commit is contained in:
@@ -116,11 +116,9 @@ describe('cliproxy routing strategy service', () => {
|
|||||||
expect(result.applied).toBe('config-only');
|
expect(result.applied).toBe('config-only');
|
||||||
expect(result.strategy).toBe('fill-first');
|
expect(result.strategy).toBe('fill-first');
|
||||||
|
|
||||||
const { getConfigPathForPort } = await import('../../../src/cliproxy/config/path-resolver');
|
const { loadUnifiedConfig } = await import('../../../src/config/unified-config-loader');
|
||||||
const configPath = getConfigPathForPort(routingTarget.port);
|
const persisted = loadUnifiedConfig();
|
||||||
const configContent = fs.readFileSync(configPath, 'utf8');
|
expect(persisted?.cliproxy?.routing?.strategy).toBe('fill-first');
|
||||||
expect(configContent).toContain('routing:');
|
|
||||||
expect(configContent).toContain('strategy: fill-first');
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user