Merged in feature/import (pull request #157)
Feature/import * importstart * pp * tests * importtests * 100GB * lint * passtests * utc * awsprofile * doublequotes * host
This commit is contained in:
+21
-15
@@ -7,19 +7,13 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
queryapi "queryorchestration/api/queryAPI"
|
||||
"queryorchestration/internal/client"
|
||||
clientupdate "queryorchestration/internal/client/update"
|
||||
"queryorchestration/internal/collector"
|
||||
collectorset "queryorchestration/internal/collector/set"
|
||||
"queryorchestration/internal/database/repository"
|
||||
"queryorchestration/internal/document"
|
||||
"queryorchestration/internal/export"
|
||||
"queryorchestration/internal/query"
|
||||
"queryorchestration/internal/query/result"
|
||||
resultprocessor "queryorchestration/internal/query/result/processor"
|
||||
querytest "queryorchestration/internal/query/test"
|
||||
queryupdate "queryorchestration/internal/query/update"
|
||||
"queryorchestration/internal/serviceconfig"
|
||||
"queryorchestration/internal/serviceconfig/objectstore"
|
||||
"queryorchestration/internal/serviceconfig/queue"
|
||||
@@ -27,6 +21,18 @@ import (
|
||||
"queryorchestration/internal/serviceconfig/queue/queryversionsync"
|
||||
"queryorchestration/internal/test"
|
||||
|
||||
queryapi "queryorchestration/api/queryAPI"
|
||||
|
||||
clientupdate "queryorchestration/internal/client/update"
|
||||
|
||||
collectorset "queryorchestration/internal/collector/set"
|
||||
|
||||
documentupload "queryorchestration/internal/document/upload"
|
||||
|
||||
resultprocessor "queryorchestration/internal/query/result/processor"
|
||||
querytest "queryorchestration/internal/query/test"
|
||||
queryupdate "queryorchestration/internal/query/update"
|
||||
|
||||
"github.com/jackc/pgx/v5/pgtype"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
@@ -36,17 +42,16 @@ import (
|
||||
|
||||
func TestCreateQuery(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := &serviceconfig.BaseConfig{}
|
||||
cfg := &ControllerConfig{}
|
||||
test.CreateDB(t, cfg)
|
||||
|
||||
cons := queryapi.NewControllers(&queryapi.Services{
|
||||
Query: query.New(cfg),
|
||||
})
|
||||
svc := createControllerServices(cfg)
|
||||
cons := queryapi.NewControllers(svc)
|
||||
|
||||
body := queryapi.QueryCreate{
|
||||
Type: queryapi.CONTEXTFULL,
|
||||
}
|
||||
ctx, rec := createContextWithBody(t, body)
|
||||
ctx, rec := createContextWithJSONBody(t, body)
|
||||
|
||||
err := cons.CreateQuery(ctx)
|
||||
require.NoError(t, err)
|
||||
@@ -128,7 +133,7 @@ func TestUpdateQuery(t *testing.T) {
|
||||
ActiveVersion: &av,
|
||||
Config: &c,
|
||||
}
|
||||
ctx, rec := createContextWithBody(t, body)
|
||||
ctx, rec := createContextWithJSONBody(t, body)
|
||||
|
||||
err = cons.UpdateQuery(ctx, id)
|
||||
require.NoError(t, err)
|
||||
@@ -172,7 +177,8 @@ func createControllerServices(cfg *ControllerConfig) *queryapi.Services {
|
||||
ClientUpdate: clientupdate.New(cfg, &clientupdate.Services{
|
||||
Client: cli,
|
||||
}),
|
||||
Document: docsvc,
|
||||
Document: docsvc,
|
||||
DocumentUpload: documentupload.New(cfg),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -269,7 +275,7 @@ func TestTestQuery(t *testing.T) {
|
||||
DocumentId: docId,
|
||||
QueryVersion: 1,
|
||||
}
|
||||
ctx, rec := createContextWithBody(t, body)
|
||||
ctx, rec := createContextWithJSONBody(t, body)
|
||||
|
||||
err = cons.TestQuery(ctx, queryId)
|
||||
require.NoError(t, err)
|
||||
@@ -282,7 +288,7 @@ func TestTestQuery(t *testing.T) {
|
||||
DocumentId: docId,
|
||||
QueryVersion: 2,
|
||||
}
|
||||
ctx, rec = createContextWithBody(t, body)
|
||||
ctx, rec = createContextWithJSONBody(t, body)
|
||||
|
||||
err = cons.TestQuery(ctx, queryId)
|
||||
require.NoError(t, err)
|
||||
|
||||
Reference in New Issue
Block a user