mirror of
https://github.com/grafana/grafana.git
synced 2025-07-31 15:52:23 +08:00
Plugins: Set grafana config, plugin version and user agent on plugin requests (#75171)
* first pass * fixup * remove test line * fix tests * use new fields * fix imports + formatting * fix tests * rollback changes * undo whitespace * apply pr feedback
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
package elasticsearch
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"testing"
|
||||
|
||||
@ -30,7 +31,7 @@ func TestNewInstanceSettings(t *testing.T) {
|
||||
JSONData: json.RawMessage(settingsJSON),
|
||||
}
|
||||
|
||||
_, err = newInstanceSettings(httpclient.NewProvider())(dsSettings)
|
||||
_, err = newInstanceSettings(httpclient.NewProvider())(context.Background(), dsSettings)
|
||||
require.NoError(t, err)
|
||||
})
|
||||
|
||||
@ -49,7 +50,7 @@ func TestNewInstanceSettings(t *testing.T) {
|
||||
JSONData: json.RawMessage(settingsJSON),
|
||||
}
|
||||
|
||||
_, err = newInstanceSettings(httpclient.NewProvider())(dsSettings)
|
||||
_, err = newInstanceSettings(httpclient.NewProvider())(context.Background(), dsSettings)
|
||||
require.EqualError(t, err, "timeField cannot be cast to string")
|
||||
})
|
||||
|
||||
@ -68,7 +69,7 @@ func TestNewInstanceSettings(t *testing.T) {
|
||||
JSONData: json.RawMessage(settingsJSON),
|
||||
}
|
||||
|
||||
_, err = newInstanceSettings(httpclient.NewProvider())(dsSettings)
|
||||
_, err = newInstanceSettings(httpclient.NewProvider())(context.Background(), dsSettings)
|
||||
require.EqualError(t, err, "elasticsearch time field name is required")
|
||||
})
|
||||
})
|
||||
|
Reference in New Issue
Block a user