Files
grafana/apps/dashboard/pkg/migration/schemaversion/v25_test.go
Haris Rozajac 6ca8c6c6da Dashboard Migrations: v25 & v24; migrate angular table (#108826)
* Dashboard Migrations: V31 LabelsToFields-Merge Migration

* Dashboard Migrations: V32 No-op migration

* simplify

* Refactor to reduce nesting

* Dashboard Migrations: V30 value mappings and tooltip options

* Do not automigrate since graph is migrated in v27

* Refactor to reduce nesting

* Add test case for invalid mapping

* migrate to v29

* wip

* Fix tests

* fix output

* wip

* fix min version issue

* fix wire

* ignore gauge logic as it never get's executed

* add panel migration to test

* improvements

* update

* cleanup

* address mappings inconsistencies

* cleanup

* fix lint issues

* add cfg when initializing

* v27 migration

* migrate to v26

* preallocate array

* remove logic for grafana-singlestat because it's shared with stat logic; improve error handling and testing

* fix go lint

* don't preallocate; cleanup comments

* cleanup

* wip

* run internal provider function when getting a single panel

* clean up; add tests

* add tests for panel plugin service

* remove obsolete mock for getting panel plugin

* add tests for the whole pipeline

* fix test and lint

* fix test

* Fix missing scenarios

---------

Co-authored-by: Ivan Ortega <ivanortegaalba@gmail.com>
2025-08-07 14:14:39 -06:00

39 lines
883 B
Go

package schemaversion_test
import (
"testing"
"github.com/grafana/grafana/apps/dashboard/pkg/migration/schemaversion"
)
func TestV25(t *testing.T) {
tests := []migrationTestCase{
{
name: "v25 no-op migration, updates schema version only",
input: map[string]interface{}{
"title": "V25 No-Op Migration Test Dashboard",
"schemaVersion": 24,
"panels": []interface{}{
map[string]interface{}{
"type": "timeseries",
"title": "Panel remains unchanged",
"id": 1,
},
},
},
expected: map[string]interface{}{
"title": "V25 No-Op Migration Test Dashboard",
"schemaVersion": 25,
"panels": []interface{}{
map[string]interface{}{
"type": "timeseries",
"title": "Panel remains unchanged",
"id": 1,
},
},
},
},
}
runMigrationTests(t, tests, schemaversion.V25)
}