Chore: Remove public vars in setting package (#81018)

Removes the public variable setting.SecretKey plus some other ones. 
Introduces some new functions for creating setting.Cfg.
This commit is contained in:
Marcus Efraimsson
2024-01-23 12:36:22 +01:00
committed by GitHub
parent 147bf01745
commit 6768c6c059
131 changed files with 759 additions and 699 deletions
@@ -36,11 +36,13 @@ func TestDashboardVersionService(t *testing.T) {
func TestDeleteExpiredVersions(t *testing.T) {
versionsToKeep := 5
setting.DashboardVersionsToKeep = versionsToKeep
cfg := setting.NewCfg()
cfg.DashboardVersionsToKeep = versionsToKeep
dashboardVersionStore := newDashboardVersionStoreFake()
dashboardService := dashboards.NewFakeDashboardService(t)
dashboardVersionService := Service{store: dashboardVersionStore, dashSvc: dashboardService}
dashboardVersionService := Service{
cfg: cfg, store: dashboardVersionStore, dashSvc: dashboardService}
t.Run("Don't delete anything if there are no expired versions", func(t *testing.T) {
err := dashboardVersionService.DeleteExpired(context.Background(), &dashver.DeleteExpiredVersionsCommand{DeletedRows: 4})