mirror of
https://github.com/grafana/grafana.git
synced 2026-08-26 21:37:31 -05:00
Plugins: Migrate CloudWatch to backend plugin SDK (#31149)
* first pass * add instance manager * fix tests * remove dead code * unexport fields * cleanup * remove ds instance from executor * cleanup * inline im * remove old func * get error working * unexport field * let fe do its magic * fix channel name * revert some tsdb changes * fix annotations * cleanup
This commit is contained in:
@@ -67,36 +67,36 @@ func TestQueryCloudWatchMetrics(t *testing.T) {
|
||||
}),
|
||||
},
|
||||
}
|
||||
tr := makeCWRequest(t, req, addr)
|
||||
result := makeCWRequest(t, req, addr)
|
||||
|
||||
dataFrames := plugins.NewDecodedDataFrames(data.Frames{
|
||||
&data.Frame{
|
||||
RefID: "A",
|
||||
Fields: []*data.Field{
|
||||
data.NewField("text", nil, []string{"Test_MetricName"}),
|
||||
data.NewField("value", nil, []string{"Test_MetricName"}),
|
||||
},
|
||||
Meta: &data.FrameMeta{
|
||||
Custom: map[string]interface{}{
|
||||
"rowCount": float64(1),
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
// Have to call this so that dataFrames.encoded is non-nil, for the comparison
|
||||
// In the future we should use gocmp instead and ignore this field
|
||||
_, err := dataFrames.Encoded()
|
||||
require.NoError(t, err)
|
||||
|
||||
assert.Equal(t, plugins.DataResponse{
|
||||
Results: map[string]plugins.DataQueryResult{
|
||||
"A": {
|
||||
RefID: "A",
|
||||
Meta: simplejson.NewFromAny(map[string]interface{}{
|
||||
"rowCount": float64(1),
|
||||
}),
|
||||
Tables: []plugins.DataTable{
|
||||
{
|
||||
Columns: []plugins.DataTableColumn{
|
||||
{
|
||||
Text: "text",
|
||||
},
|
||||
{
|
||||
Text: "value",
|
||||
},
|
||||
},
|
||||
Rows: []plugins.DataRowValues{
|
||||
{
|
||||
"Test_MetricName",
|
||||
"Test_MetricName",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
RefID: "A",
|
||||
Dataframes: dataFrames,
|
||||
},
|
||||
},
|
||||
}, tr)
|
||||
}, result)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -132,7 +132,8 @@ func TestQueryCloudWatchLogs(t *testing.T) {
|
||||
|
||||
dataFrames := plugins.NewDecodedDataFrames(data.Frames{
|
||||
&data.Frame{
|
||||
Name: "logGroups",
|
||||
Name: "logGroups",
|
||||
RefID: "A",
|
||||
Fields: []*data.Field{
|
||||
data.NewField("logGroupName", nil, []*string{}),
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user