Correlations: Add GetCorrelation(s) HTTP APIs (#52517)

* Correlations: Get Single correlations

* Correlations: Get all correlations for given source ds

* Correlations: Get all correlations

* add tests

* add DB indices

* fix lint errors

* remove skip from tests

* use DatasourceService in test
This commit is contained in:
Giordano Ricci
2022-08-11 16:58:11 +01:00
committed by GitHub
parent 8813cbfb62
commit c1b30c56c9
10 changed files with 917 additions and 3 deletions
+15 -1
View File
@@ -43,6 +43,20 @@ type User struct {
password string
}
type GetParams struct {
url string
user User
}
func (c TestContext) Get(params GetParams) *http.Response {
c.t.Helper()
resp, err := http.Get(c.getURL(params.url, params.user))
require.NoError(c.t, err)
return resp
}
type PostParams struct {
url string
body string
@@ -127,7 +141,7 @@ func (c TestContext) createUser(cmd user.CreateUserCommand) {
func (c TestContext) createDs(cmd *datasources.AddDataSourceCommand) {
c.t.Helper()
err := c.env.SQLStore.AddDataSource(context.Background(), cmd)
err := c.env.Server.HTTPServer.DataSourcesService.AddDataSource(context.Background(), cmd)
require.NoError(c.t, err)
}