@@ -35,4 +35,39 @@ if ! grep -q "^ccvm:" <<<"$compat_info_output"; then
3535 exit 1
3636fi
3737
38+ # Test InferenceProvider jq queries resolve correctly for all three provider keys
39+ tmp_oc=$( mktemp)
40+ trap ' rm -f "$tmp_oc"' EXIT
41+
42+ # confai key (new, highest priority)
43+ printf ' {"models":{"providers":{"confai":{"baseUrl":"https://confai.example.com","apiKey":"tok-confai"}}}}' > " $tmp_oc "
44+ got_endpoint=$( jq -r ' .models.providers.confai.baseUrl // .models.providers.confidential.baseUrl // .models.providers.lunal.baseUrl // "not configured"' " $tmp_oc " )
45+ got_apikey=$( jq -r ' .models.providers.confai.apiKey // .models.providers.confidential.apiKey // .models.providers.lunal.apiKey // empty' " $tmp_oc " )
46+ if [ " $got_endpoint " != " https://confai.example.com" ] || [ " $got_apikey " != " tok-confai" ]; then
47+ echo " FAIL: confai provider key not resolved (endpoint=$got_endpoint apikey=$got_apikey )" >&2 ; exit 1
48+ fi
49+
50+ # confidential key (legacy fallback #1)
51+ printf ' {"models":{"providers":{"confidential":{"baseUrl":"https://conf.example.com","apiKey":"tok-conf"}}}}' > " $tmp_oc "
52+ got_endpoint=$( jq -r ' .models.providers.confai.baseUrl // .models.providers.confidential.baseUrl // .models.providers.lunal.baseUrl // "not configured"' " $tmp_oc " )
53+ got_apikey=$( jq -r ' .models.providers.confai.apiKey // .models.providers.confidential.apiKey // .models.providers.lunal.apiKey // empty' " $tmp_oc " )
54+ if [ " $got_endpoint " != " https://conf.example.com" ] || [ " $got_apikey " != " tok-conf" ]; then
55+ echo " FAIL: confidential provider key not resolved (endpoint=$got_endpoint apikey=$got_apikey )" >&2 ; exit 1
56+ fi
57+
58+ # lunal key (legacy fallback #2)
59+ printf ' {"models":{"providers":{"lunal":{"baseUrl":"https://lunal.example.com","apiKey":"tok-lunal"}}}}' > " $tmp_oc "
60+ got_endpoint=$( jq -r ' .models.providers.confai.baseUrl // .models.providers.confidential.baseUrl // .models.providers.lunal.baseUrl // "not configured"' " $tmp_oc " )
61+ got_apikey=$( jq -r ' .models.providers.confai.apiKey // .models.providers.confidential.apiKey // .models.providers.lunal.apiKey // empty' " $tmp_oc " )
62+ if [ " $got_endpoint " != " https://lunal.example.com" ] || [ " $got_apikey " != " tok-lunal" ]; then
63+ echo " FAIL: lunal provider key not resolved (endpoint=$got_endpoint apikey=$got_apikey )" >&2 ; exit 1
64+ fi
65+
66+ # no matching key → "not configured"
67+ printf ' {"models":{"providers":{}}}' > " $tmp_oc "
68+ got_endpoint=$( jq -r ' .models.providers.confai.baseUrl // .models.providers.confidential.baseUrl // .models.providers.lunal.baseUrl // "not configured"' " $tmp_oc " )
69+ if [ " $got_endpoint " != " not configured" ]; then
70+ echo " FAIL: missing provider key should return 'not configured' (got: $got_endpoint )" >&2 ; exit 1
71+ fi
72+
3873echo " smoke tests passed"
0 commit comments