(t *testing.T)
| 195 | } |
| 196 | |
| 197 | func TestRunDedicatedInferenceUpdate(t *testing.T) { |
| 198 | withTestClient(t, func(config *CmdConfig, tm *tcMocks) { |
| 199 | specJSON := `{ |
| 200 | "version": 0, |
| 201 | "name": "test-dedicated-inference", |
| 202 | "region": "nyc2", |
| 203 | "vpc": {"uuid": "00000000-0000-4000-8000-000000000001"}, |
| 204 | "enable_public_endpoint": true, |
| 205 | "model_deployments": [ |
| 206 | { |
| 207 | "model_slug": "mistral/mistral-7b-instruct-v3", |
| 208 | "provider_model_id": "mistralai/Mistral-7B-Instruct-v0.3", |
| 209 | "model_provider": "hugging_face", |
| 210 | "accelerators": [ |
| 211 | {"scale": 2, "type": "prefill", "accelerator_slug": "gpu-mi300x1-192gb"}, |
| 212 | {"scale": 4, "type": "decode", "accelerator_slug": "gpu-mi300x1-192gb"} |
| 213 | ] |
| 214 | } |
| 215 | ] |
| 216 | }` |
| 217 | tmpFile := t.TempDir() + "/spec.json" |
| 218 | err := os.WriteFile(tmpFile, []byte(specJSON), 0644) |
| 219 | assert.NoError(t, err) |
| 220 | |
| 221 | config.Doit.Set(config.NS, doctl.ArgDedicatedInferenceSpec, tmpFile) |
| 222 | config.Args = append(config.Args, "00000000-0000-4000-8000-000000000000") |
| 223 | |
| 224 | expectedReq := &godo.DedicatedInferenceUpdateRequest{ |
| 225 | Spec: testDedicatedInferenceSpecRequest, |
| 226 | } |
| 227 | |
| 228 | tm.dedicatedInferences.EXPECT().Update("00000000-0000-4000-8000-000000000000", expectedReq).Return(&testDedicatedInference, nil) |
| 229 | |
| 230 | err = RunDedicatedInferenceUpdate(config) |
| 231 | assert.NoError(t, err) |
| 232 | }) |
| 233 | } |
| 234 | |
| 235 | func TestRunDedicatedInferenceUpdate_WithHuggingFaceToken(t *testing.T) { |
| 236 | withTestClient(t, func(config *CmdConfig, tm *tcMocks) { |
nothing calls this directly
no test coverage detected