Dashboards: dependency cleanup (#111572)

This commit is contained in:
Ryan McKinley
2025-09-25 00:38:27 +03:00
committed by GitHub
parent 0c0554da5e
commit a51d1b76b4
7 changed files with 25 additions and 50 deletions
@@ -647,12 +647,9 @@ func runDashboardValidationTests(t *testing.T, ctx TestContext) {
})
t.Run("Dashboard refresh interval validations", func(t *testing.T) {
// Store original settings to restore after test
origCfg := ctx.Helper.GetEnv().Cfg
origMinRefreshInterval := origCfg.MinRefreshInterval
// Set a fixed min_refresh_interval for all tests to make them predictable
ctx.Helper.GetEnv().Cfg.MinRefreshInterval = "10s"
// Test infrastructure is configured with
// [dashboards]
// min_refresh_interval = 10s
testCases := []struct {
name string
@@ -720,9 +717,6 @@ func runDashboardValidationTests(t *testing.T, ctx TestContext) {
}
})
}
// Restore original settings
ctx.Helper.GetEnv().Cfg.MinRefreshInterval = origMinRefreshInterval
})
t.Run("Dashboard size limit validations", func(t *testing.T) {
+5
View File
@@ -545,6 +545,11 @@ func CreateGrafDir(t *testing.T, opts GrafanaOpts) (string, string) {
require.NoError(t, err)
}
dashboardsSection, err := getOrCreateSection("dashboards")
require.NoError(t, err)
_, err = dashboardsSection.NewKey("min_refresh_interval", "10s")
require.NoError(t, err)
if opts.APIServerRuntimeConfig != "" {
section, err := getOrCreateSection("grafana-apiserver")
require.NoError(t, err)