Azure Monitor: Implement CallResourceHandler in the backend (#35581)

This commit is contained in:
Andres Martinez Gotor
2021-07-16 12:47:26 +02:00
committed by GitHub
parent a6872deeb9
commit 96efbbaed1
36 changed files with 28057 additions and 29938 deletions
@@ -181,11 +181,8 @@ func TestBuildingAzureLogAnalyticsQueries(t *testing.T) {
func TestLogAnalyticsCreateRequest(t *testing.T) {
ctx := context.Background()
dsInfo := datasourceInfo{
Services: map[string]datasourceService{
azureLogAnalytics: {URL: "http://ds"},
},
}
url := "http://ds"
dsInfo := datasourceInfo{}
tests := []struct {
name string
@@ -204,7 +201,7 @@ func TestLogAnalyticsCreateRequest(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
ds := AzureLogAnalyticsDatasource{}
req, err := ds.createRequest(ctx, dsInfo)
req, err := ds.createRequest(ctx, dsInfo, url)
tt.Err(t, err)
if req.URL.String() != tt.expectedURL {
t.Errorf("Expecting %s, got %s", tt.expectedURL, req.URL.String())
@@ -231,7 +228,7 @@ func Test_executeQueryErrorWithDifferentLogAnalyticsCreds(t *testing.T) {
Params: url.Values{},
TimeRange: backend.TimeRange{},
}
res := ds.executeQuery(ctx, query, dsInfo)
res := ds.executeQuery(ctx, query, dsInfo, &http.Client{}, dsInfo.Services[azureLogAnalytics].URL)
if res.Error == nil {
t.Fatal("expecting an error")
}