mirror of https://github.com/grafana/grafana.git
Merge branch 'haris/migrate-to-v9' into haris/migrate-to-v8
CodeQL checks / Detect whether code changed (push) Waiting to run
Details
CodeQL checks / Analyze (actions) (push) Blocked by required conditions
Details
CodeQL checks / Analyze (go) (push) Blocked by required conditions
Details
CodeQL checks / Analyze (javascript) (push) Blocked by required conditions
Details
CodeQL checks / Detect whether code changed (push) Waiting to run
Details
CodeQL checks / Analyze (actions) (push) Blocked by required conditions
Details
CodeQL checks / Analyze (go) (push) Blocked by required conditions
Details
CodeQL checks / Analyze (javascript) (push) Blocked by required conditions
Details
This commit is contained in:
commit
ceb82bad1b
|
@ -89,6 +89,7 @@ func TestV12(t *testing.T) {
|
||||||
map[string]interface{}{
|
map[string]interface{}{
|
||||||
"type": "query",
|
"type": "query",
|
||||||
"name": "hide_variable_var",
|
"name": "hide_variable_var",
|
||||||
|
"hideVariable": true,
|
||||||
"hide": 2,
|
"hide": 2,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -118,6 +119,7 @@ func TestV12(t *testing.T) {
|
||||||
map[string]interface{}{
|
map[string]interface{}{
|
||||||
"type": "query",
|
"type": "query",
|
||||||
"name": "hide_label_var",
|
"name": "hide_label_var",
|
||||||
|
"hideLabel": true,
|
||||||
"hide": 1,
|
"hide": 1,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -148,6 +150,8 @@ func TestV12(t *testing.T) {
|
||||||
map[string]interface{}{
|
map[string]interface{}{
|
||||||
"type": "query",
|
"type": "query",
|
||||||
"name": "priority_var",
|
"name": "priority_var",
|
||||||
|
"hideVariable": true,
|
||||||
|
"hideLabel": true,
|
||||||
"hide": 2,
|
"hide": 2,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -209,6 +213,103 @@ func TestV12(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "variables with hideVariable=false and hideLabel=false do not get hide property",
|
||||||
|
input: map[string]interface{}{
|
||||||
|
"title": "V12 False Hide Properties Test",
|
||||||
|
"schemaVersion": 11,
|
||||||
|
"templating": map[string]interface{}{
|
||||||
|
"list": []interface{}{
|
||||||
|
map[string]interface{}{
|
||||||
|
"type": "query",
|
||||||
|
"name": "false_hide_var",
|
||||||
|
"hideVariable": false,
|
||||||
|
"hideLabel": false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
expected: map[string]interface{}{
|
||||||
|
"title": "V12 False Hide Properties Test",
|
||||||
|
"schemaVersion": 12,
|
||||||
|
"templating": map[string]interface{}{
|
||||||
|
"list": []interface{}{
|
||||||
|
map[string]interface{}{
|
||||||
|
"type": "query",
|
||||||
|
"name": "false_hide_var",
|
||||||
|
"hideVariable": false,
|
||||||
|
"hideLabel": false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "variable with hideVariable=false but hideLabel=true gets hide=1",
|
||||||
|
input: map[string]interface{}{
|
||||||
|
"title": "V12 Mixed Hide Properties Test",
|
||||||
|
"schemaVersion": 11,
|
||||||
|
"templating": map[string]interface{}{
|
||||||
|
"list": []interface{}{
|
||||||
|
map[string]interface{}{
|
||||||
|
"type": "query",
|
||||||
|
"name": "mixed_hide_var",
|
||||||
|
"hideVariable": false,
|
||||||
|
"hideLabel": true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
expected: map[string]interface{}{
|
||||||
|
"title": "V12 Mixed Hide Properties Test",
|
||||||
|
"schemaVersion": 12,
|
||||||
|
"templating": map[string]interface{}{
|
||||||
|
"list": []interface{}{
|
||||||
|
map[string]interface{}{
|
||||||
|
"type": "query",
|
||||||
|
"name": "mixed_hide_var",
|
||||||
|
"hideVariable": false,
|
||||||
|
"hideLabel": true,
|
||||||
|
"hide": 1,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "variable with all properties gets all migrations applied",
|
||||||
|
input: map[string]interface{}{
|
||||||
|
"title": "V12 All Properties Test",
|
||||||
|
"schemaVersion": 11,
|
||||||
|
"templating": map[string]interface{}{
|
||||||
|
"list": []interface{}{
|
||||||
|
map[string]interface{}{
|
||||||
|
"type": "query",
|
||||||
|
"name": "all_properties_var",
|
||||||
|
"refresh": true,
|
||||||
|
"hideVariable": true,
|
||||||
|
"hideLabel": false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
expected: map[string]interface{}{
|
||||||
|
"title": "V12 All Properties Test",
|
||||||
|
"schemaVersion": 12,
|
||||||
|
"templating": map[string]interface{}{
|
||||||
|
"list": []interface{}{
|
||||||
|
map[string]interface{}{
|
||||||
|
"type": "query",
|
||||||
|
"name": "all_properties_var",
|
||||||
|
"refresh": 1,
|
||||||
|
"hideVariable": true,
|
||||||
|
"hideLabel": false,
|
||||||
|
"hide": 2,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
runMigrationTests(t, tests, schemaversion.V12)
|
runMigrationTests(t, tests, schemaversion.V12)
|
||||||
|
|
Loading…
Reference in New Issue