fix(smoke): use json output for llm apiKeyRef assertion
Some checks failed
CI/CD / lint (push) Successful in 51s
CI/CD / typecheck (push) Successful in 1m42s
CI/CD / test (push) Successful in 1m5s
CI/CD / smoke (push) Has started running
CI/CD / publish (push) Has been cancelled
CI/CD / build (push) Has been cancelled

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:
Michal
2026-04-19 22:55:39 +01:00
parent 860033d3de
commit d5236171cc

View File

@@ -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', () => {