mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Chore: Validate batch query refIds (#63018)
This commit is contained in:
committed by
GitHub
parent
2a34293689
commit
00b692c0f9
@@ -235,6 +235,25 @@ func TestParseMetricRequest(t *testing.T) {
|
||||
_, err = tc.queryService.parseMetricRequest(httpreq.Context(), tc.signedInUser, true, mr)
|
||||
require.NoError(t, err)
|
||||
})
|
||||
|
||||
t.Run("Test a duplicated refId", func(t *testing.T) {
|
||||
tc := setup(t)
|
||||
mr := metricRequestWithQueries(t, `{
|
||||
"refId": "A",
|
||||
"datasource": {
|
||||
"uid": "gIEkMvIVz",
|
||||
"type": "postgres"
|
||||
}
|
||||
}`, `{
|
||||
"refId": "A",
|
||||
"datasource": {
|
||||
"uid": "gIEkMvIVz",
|
||||
"type": "postgres"
|
||||
}
|
||||
}`)
|
||||
_, err := tc.queryService.parseMetricRequest(context.Background(), tc.signedInUser, true, mr)
|
||||
require.Error(t, err)
|
||||
})
|
||||
}
|
||||
|
||||
func TestQueryDataMultipleSources(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user