Skip to content

Commit eb7bb98

Browse files
committed
Stabilize provider catalog tests
1 parent e173c20 commit eb7bb98

3 files changed

Lines changed: 11 additions & 15 deletions

File tree

internal/config/catalog_gateways_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ import (
1111

1212
func TestAllSetupGateways_RegistryOnly(t *testing.T) {
1313
gws := AllSetupGateways()
14-
if len(gws) != 12 {
15-
t.Fatalf("expected 12 setup gateways, got %d: %v", len(gws), gws)
14+
if len(gws) != 15 {
15+
t.Fatalf("expected 15 setup gateways, got %d: %v", len(gws), gws)
1616
}
1717
for _, id := range gws {
1818
if id == "ai21" || id == "alibaba" {
1919
t.Fatalf("owner slug %q should not be a gateway", id)
2020
}
2121
}
22-
want := map[string]bool{"gemini": true, "grok": true, "openrouter": true, "kimi": true, "xiaomi_mimo_payg": true, "xiaomi_mimo_token_plan": true}
22+
want := map[string]bool{"azure": true, "bedrock": true, "gemini": true, "grok": true, "openrouter": true, "kimi": true, "vertex": true, "xiaomi_mimo_payg": true, "xiaomi_mimo_token_plan": true}
2323
for id := range want {
2424
found := false
2525
for _, gw := range gws {

internal/config/catalog_health.go

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -76,18 +76,13 @@ func catalogHealthReportUncached(ctx context.Context) CatalogHealth {
7676
h.Error = "cache missing — hawk will discover automatically on start"
7777
return h
7878
}
79-
var compiled *catalog.CompiledCatalogV1
80-
if c, ok := cachedCompiledCatalog(); ok && c != nil {
81-
compiled = c
82-
} else {
83-
compiled, err = catalog.LoadCatalogV1(ctx, catalog.LoadCatalogV1Options{
84-
CachePath: path,
85-
RequireCache: true,
86-
})
87-
if err != nil {
88-
h.Error = err.Error()
89-
return h
90-
}
79+
compiled, err := catalog.LoadCatalogV1(ctx, catalog.LoadCatalogV1Options{
80+
CachePath: path,
81+
RequireCache: true,
82+
})
83+
if err != nil {
84+
h.Error = err.Error()
85+
return h
9186
}
9287
h.Models = len(compiled.ModelsByID)
9388
h.Deployments = len(compiled.DeploymentsByID)

internal/config/security_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ func TestMergeSettings_AllowedToolsAppend(t *testing.T) {
6262

6363
func TestValidateSettings_ValidConfig(t *testing.T) {
6464
// This test uses the global catalog test setup from main_test.go
65+
t.Setenv("HAWK_CONFIG_DIR", t.TempDir())
6566
s := Settings{
6667
MaxBudgetUSD: 10.0,
6768
}

0 commit comments

Comments
 (0)