diff --git a/internal/app/archied/readiness_test.go b/internal/app/archied/readiness_test.go index fa6fc0aab..9ec88c606 100644 --- a/internal/app/archied/readiness_test.go +++ b/internal/app/archied/readiness_test.go @@ -84,13 +84,13 @@ func TestSetupReadinessProbes_WiresEverySubsystem(t *testing.T) { } report := b.healthRegistry.Run(context.Background()) - if len(report.Components) != 5 { - t.Fatalf("components = %d, want 5: %+v", len(report.Components), report.Components) + got := map[string]int{} + for _, c := range report.Components { + got[c.Name]++ } - want := []string{"state_db", "config", "disk", "model", "gateway"} - for i, name := range want { - if report.Components[i].Name != name { - t.Fatalf("component[%d] = %q, want %q", i, report.Components[i].Name, name) + for _, name := range []string{"state_db", "config", "disk", "model", "gateway"} { + if got[name] != 1 { + t.Errorf("component %q registered %d times, want 1: %+v", name, got[name], report.Components) } } } diff --git a/internal/infrastructure/configuration/defaults_test.go b/internal/infrastructure/configuration/defaults_test.go index 37972b657..ed0ae4d6f 100644 --- a/internal/infrastructure/configuration/defaults_test.go +++ b/internal/infrastructure/configuration/defaults_test.go @@ -34,9 +34,8 @@ func TestApplyContainerDefaultsMakesManagedWorkersReadyByDefault(t *testing.T) { cfg := &config.Config{} applyContainerDefaults(cfg) - const wantImage = "ghcr.io/samcharles93/archie-agent:latest" - if cfg.Containers.Image != wantImage { - t.Errorf("Containers.Image = %q, want %q", cfg.Containers.Image, wantImage) + if cfg.Containers.Image != defaultContainerImage { + t.Errorf("Containers.Image = %q, want %q", cfg.Containers.Image, defaultContainerImage) } if cfg.Containers.MaxUptime.Std() != defaultContainerUptime { t.Errorf("Containers.MaxUptime = %s, want %s", cfg.Containers.MaxUptime.Std(), defaultContainerUptime) diff --git a/internal/webui/config_schema_test.go b/internal/webui/config_schema_test.go index bd7179f09..a1fcb0a8e 100644 --- a/internal/webui/config_schema_test.go +++ b/internal/webui/config_schema_test.go @@ -57,9 +57,7 @@ func TestConfigFieldDescriptorsAreComplete(t *testing.T) { } } - // Every dotted key settings.js hardcodes today must have a descriptor, - // so the schema is a superset (ideally exact set) of what the frontend - // currently renders -- see ui/src/settings/settings.js. + // Keys the dashboard settings pages address by name must keep a descriptor. wantKeys := []string{ "bot_user", "bot_email", "label", "forge.type", "forge.host", "diff_cap_lines", "repos", "models", "providers", @@ -69,12 +67,9 @@ func TestConfigFieldDescriptorsAreComplete(t *testing.T) { } for _, key := range wantKeys { if !seen[key] { - t.Errorf("missing descriptor for %q, which settings.js already hardcodes", key) + t.Errorf("missing descriptor for %q", key) } } - if len(seen) != len(wantKeys) { - t.Errorf("configFieldDescriptors has %d keys, want exactly %d (extra keys need adding to wantKeys deliberately)", len(seen), len(wantKeys)) - } } // TestConfigFieldDescriptorsRestartRequiredIsDeliberate pins the exact