fix(smoke): use json output for llm apiKeyRef assertion
Some checks failed
Some checks failed
The table KEY column truncates at ~34 chars so `secret://<name>/<key>` wasn't appearing verbatim in stdout — the assertion was correct but brittle against presentation choices. Switched to `-o json` where the ref round-trips as a structured object, which is what actually matters. Caught by the live-cluster smoke run right after Phase 0-4 rolled out. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -121,10 +121,16 @@ describe('llm smoke', () => {
|
|||||||
|
|
||||||
it('get llms shows the row with KEY column rendered as "secret://name/key"', () => {
|
it('get llms shows the row with KEY column rendered as "secret://name/key"', () => {
|
||||||
if (!mcpdUp) return;
|
if (!mcpdUp) return;
|
||||||
const result = run('get llms');
|
// Table output truncates the KEY column (≈34 chars), so the full
|
||||||
|
// "secret://<name>/<key>" string won't appear verbatim in the row. Assert
|
||||||
|
// against JSON output where the apiKeyRef round-trips as a structured
|
||||||
|
// object.
|
||||||
|
const result = run('get llms -o json');
|
||||||
expect(result.code).toBe(0);
|
expect(result.code).toBe(0);
|
||||||
expect(result.stdout).toContain(LLM_NAME);
|
const rows = JSON.parse(result.stdout) as Array<{ name: string; apiKeyRef?: { name: string; key: string } }>;
|
||||||
expect(result.stdout).toContain(`secret://${SECRET_NAME}/token`);
|
const row = rows.find((r) => r.name === LLM_NAME);
|
||||||
|
expect(row, `row ${LLM_NAME} must be present`).toBeDefined();
|
||||||
|
expect(row!.apiKeyRef).toEqual({ name: SECRET_NAME, key: 'token' });
|
||||||
});
|
});
|
||||||
|
|
||||||
it('round-trips yaml output → apply -f', () => {
|
it('round-trips yaml output → apply -f', () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user