mirror of https://github.com/grafana/grafana.git
				
				
				
			Merge branch 'haris/migrate-to-v12' into haris/migrate-to-v11
	
		
			
	
		
	
	
		
			
				
	
				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
						6361ea0023
					
				|  | @ -87,9 +87,10 @@ func TestV12(t *testing.T) { | |||
| 				"templating": map[string]interface{}{ | ||||
| 					"list": []interface{}{ | ||||
| 						map[string]interface{}{ | ||||
| 							"type": "query", | ||||
| 							"name": "hide_variable_var", | ||||
| 							"hide": 2, | ||||
| 							"type":         "query", | ||||
| 							"name":         "hide_variable_var", | ||||
| 							"hideVariable": true, | ||||
| 							"hide":         2, | ||||
| 						}, | ||||
| 					}, | ||||
| 				}, | ||||
|  | @ -116,9 +117,10 @@ func TestV12(t *testing.T) { | |||
| 				"templating": map[string]interface{}{ | ||||
| 					"list": []interface{}{ | ||||
| 						map[string]interface{}{ | ||||
| 							"type": "query", | ||||
| 							"name": "hide_label_var", | ||||
| 							"hide": 1, | ||||
| 							"type":      "query", | ||||
| 							"name":      "hide_label_var", | ||||
| 							"hideLabel": true, | ||||
| 							"hide":      1, | ||||
| 						}, | ||||
| 					}, | ||||
| 				}, | ||||
|  | @ -146,9 +148,11 @@ func TestV12(t *testing.T) { | |||
| 				"templating": map[string]interface{}{ | ||||
| 					"list": []interface{}{ | ||||
| 						map[string]interface{}{ | ||||
| 							"type": "query", | ||||
| 							"name": "priority_var", | ||||
| 							"hide": 2, | ||||
| 							"type":         "query", | ||||
| 							"name":         "priority_var", | ||||
| 							"hideVariable": true, | ||||
| 							"hideLabel":    true, | ||||
| 							"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) | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue