(t *testing.T)
| 847 | } |
| 848 | |
| 849 | func TestMetrics_DisabledMessage(t *testing.T) { |
| 850 | cfg := testConfig(100, true) |
| 851 | cfg.Telemetry.MetricsEnabled = false |
| 852 | srv := New(cfg) |
| 853 | ts := httptest.NewServer(srv.Routes()) |
| 854 | defer ts.Close() |
| 855 | |
| 856 | resp, err := http.Get(ts.URL + "/metrics") |
| 857 | if err != nil { |
| 858 | t.Fatalf("metrics request failed: %v", err) |
| 859 | } |
| 860 | defer resp.Body.Close() |
| 861 | |
| 862 | raw, _ := io.ReadAll(resp.Body) |
| 863 | if !strings.Contains(string(raw), "metrics disabled") { |
| 864 | t.Fatalf("expected metrics disabled message") |
| 865 | } |
| 866 | } |
| 867 | |
| 868 | func postInfer(t *testing.T, baseURL string, payload map[string]any) (int, []byte) { |
| 869 | t.Helper() |
nothing calls this directly
no test coverage detected