Dashboard: replace datasource name with a reference object (#33817)
Co-authored-by: Torkel Ödegaard <torkel@grafana.com> Co-authored-by: Elfo404 <me@giordanoricci.com>
This commit is contained in:
co-authored by
Torkel Ödegaard
Elfo404
parent
61fbdb60ff
commit
7319efe077
@@ -195,6 +195,33 @@ func TestServicebuildPipeLine(t *testing.T) {
|
||||
},
|
||||
expectErrContains: "classic conditions may not be the input for other expressions",
|
||||
},
|
||||
{
|
||||
name: "Queries with new datasource ref object",
|
||||
req: &Request{
|
||||
Queries: []Query{
|
||||
{
|
||||
RefID: "A",
|
||||
JSON: json.RawMessage(`{
|
||||
"datasource": {
|
||||
"uid": "MyDS"
|
||||
}
|
||||
}`),
|
||||
},
|
||||
{
|
||||
RefID: "B",
|
||||
JSON: json.RawMessage(`{
|
||||
"datasource": {
|
||||
"uid": "MyDS"
|
||||
},
|
||||
"expression": "A",
|
||||
"reducer": "mean",
|
||||
"type": "reduce"
|
||||
}`),
|
||||
},
|
||||
},
|
||||
},
|
||||
expectedOrder: []string{"B", "A"},
|
||||
},
|
||||
}
|
||||
s := Service{}
|
||||
for _, tt := range tests {
|
||||
|
||||
Reference in New Issue
Block a user