CloudWatch: Refactor to extract DataQuery grouping by region out of request parsing (#57392)
* CloudWatch: Extract request parsing grouping by region from ParseQueries * Rename ParseQueries to ParseMetricDataQueries
This commit is contained in:
@@ -17,6 +17,7 @@ import (
|
||||
"github.com/grafana/grafana-aws-sdk/pkg/awsds"
|
||||
"github.com/grafana/grafana-plugin-sdk-go/backend"
|
||||
"github.com/grafana/grafana/pkg/setting"
|
||||
"github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
type fakeCWLogsClient struct {
|
||||
@@ -190,6 +191,15 @@ func newTestConfig() *setting.Cfg {
|
||||
return &setting.Cfg{AWSAllowedAuthProviders: []string{"default"}, AWSAssumeRoleEnabled: true, AWSListMetricsPageLimit: 1000}
|
||||
}
|
||||
|
||||
type mockSessionCache struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
func (c *mockSessionCache) GetSession(config awsds.SessionConfig) (*session.Session, error) {
|
||||
args := c.Called(config)
|
||||
return args.Get(0).(*session.Session), args.Error(1)
|
||||
}
|
||||
|
||||
type fakeSessionCache struct {
|
||||
getSession func(c awsds.SessionConfig) (*session.Session, error)
|
||||
calledRegions []string
|
||||
|
||||
Reference in New Issue
Block a user