seedProvider seeds a single provider into the SQLite store at storePath by running `cam provider add` via execute().
(t *testing.T, storePath, name, endpoint, client, models, apiKeyEnv string)
| 54 | // seedProvider seeds a single provider into the SQLite store at storePath |
| 55 | // by running `cam provider add` via execute(). |
| 56 | func seedProvider(t *testing.T, storePath, name, endpoint, client, models, apiKeyEnv string) { |
| 57 | t.Helper() |
| 58 | args := []string{"--store", storePath, "provider", "add", name, "--endpoint", endpoint} |
| 59 | if client != "" { |
| 60 | args = append(args, "--client", client) |
| 61 | } |
| 62 | if models != "" { |
| 63 | args = append(args, "--model", models) |
| 64 | } |
| 65 | if apiKeyEnv != "" { |
| 66 | args = append(args, "--api-key-env", apiKeyEnv) |
| 67 | } |
| 68 | stdout, stderr, code := execute(t, args...) |
| 69 | if code != 0 { |
| 70 | t.Fatalf("seed provider %s: exit=%d stderr=%s stdout=%s", name, code, stderr, stdout) |
| 71 | } |
| 72 | } |
no test coverage detected