Snapshots: Add snapshot enable config (#61587)
* Add config to remove Snapshot functionality (frontend is hidden and validation in the backend) * Add test cases * Remove unused mock on the test * Moving Snapshot config from globar variables to settings.Cfg * Removing warnings on code
This commit is contained in:
@@ -23,7 +23,7 @@ func TestIntegrationDashboardSnapshotDBAccess(t *testing.T) {
|
||||
t.Skip("skipping integration test")
|
||||
}
|
||||
sqlstore := db.InitTestDB(t)
|
||||
dashStore := ProvideStore(sqlstore)
|
||||
dashStore := ProvideStore(sqlstore, setting.NewCfg())
|
||||
|
||||
origSecret := setting.SecretKey
|
||||
setting.SecretKey = "dashboard_snapshot_testing"
|
||||
@@ -154,10 +154,10 @@ func TestIntegrationDeleteExpiredSnapshots(t *testing.T) {
|
||||
t.Skip("skipping integration test")
|
||||
}
|
||||
sqlstore := db.InitTestDB(t)
|
||||
dashStore := ProvideStore(sqlstore)
|
||||
dashStore := ProvideStore(sqlstore, setting.NewCfg())
|
||||
|
||||
t.Run("Testing dashboard snapshots clean up", func(t *testing.T) {
|
||||
setting.SnapShotRemoveExpired = true
|
||||
dashStore.cfg.SnapShotRemoveExpired = true
|
||||
|
||||
nonExpiredSnapshot := createTestSnapshot(t, dashStore, "key1", 48000)
|
||||
createTestSnapshot(t, dashStore, "key2", -1200)
|
||||
|
||||
Reference in New Issue
Block a user