Dashboard Migrations: V28 singlestat panel and deprecated variable properties (#108416)

Co-authored-by: Ivan Ortega <ivanortegaalba@gmail.com>
This commit is contained in:
Haris Rozajac
2025-08-06 17:51:55 +02:00
committed by GitHub
co-authored by Ivan Ortega
parent 3dcda77462
commit 5ad751ea28
22 changed files with 3067 additions and 134 deletions
@@ -57,9 +57,10 @@ func TestGetSchemaVersion(t *testing.T) {
}
type migrationTestCase struct {
name string
input map[string]interface{}
expected map[string]interface{}
name string
input map[string]interface{}
expected map[string]interface{}
expectedError string
}
func runMigrationTests(t *testing.T, testCases []migrationTestCase, migrationFunc schemaversion.SchemaVersionMigrationFunc) {
@@ -68,8 +69,13 @@ func runMigrationTests(t *testing.T, testCases []migrationTestCase, migrationFun
for _, tt := range testCases {
t.Run(tt.name, func(t *testing.T) {
err := migrationFunc(tt.input)
require.NoError(t, err)
require.Equal(t, tt.expected, tt.input)
if tt.expectedError != "" {
require.Error(t, err)
require.Equal(t, tt.expectedError, err.Error())
} else {
require.NoError(t, err)
require.Equal(t, tt.expected, tt.input)
}
})
}
}