mirror of
https://github.com/tiennm99/ccs.git
synced 2026-07-16 12:15:57 +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.strategy).toBe('fill-first');
|
||||
|
||||
const { getConfigPathForPort } = await import('../../../src/cliproxy/config/path-resolver');
|
||||
const configPath = getConfigPathForPort(routingTarget.port);
|
||||
const configContent = fs.readFileSync(configPath, 'utf8');
|
||||
expect(configContent).toContain('routing:');
|
||||
expect(configContent).toContain('strategy: fill-first');
|
||||
const { loadUnifiedConfig } = await import('../../../src/config/unified-config-loader');
|
||||
const persisted = loadUnifiedConfig();
|
||||
expect(persisted?.cliproxy?.routing?.strategy).toBe('fill-first');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user