Merged in feature/serviceconfig-integration (pull request #38)

DRAFT PR : WIP working through ideas for integration

* movearound

* attempttwo

* openapi

* further sanding

* fix

* start on tests

* runthroughsingleconfig

* somechanges

* reflectissue

* removeerrs

* mostlyremovepanic

* removeenv

* noncfgtests

* go

* repo

* fix service config test

* add PWD to all

* test fix

* fix lint

* todo for later

* passingunittests

* alltests

* testlogger

* testloggername

* clean
This commit is contained in:
Jay Brown
2025-01-31 13:43:55 +00:00
parent 058f8dba7f
commit 15adaebfcd
138 changed files with 1864 additions and 1695 deletions
+17 -24
View File
@@ -5,6 +5,7 @@ import (
"queryorchestration/internal/database"
"queryorchestration/internal/database/repository"
resultprocessor "queryorchestration/internal/query/result/processor"
"queryorchestration/internal/serviceconfig"
"testing"
"github.com/google/uuid"
@@ -18,12 +19,10 @@ func TestGetCreator(t *testing.T) {
if err != nil {
t.Fatalf("failed to open pgxmock database: %v", err)
}
queries := repository.New(pool)
db := &database.Connection{
Queries: queries,
Pool: pool,
}
svc := New(db, &Services{})
cfg := &serviceconfig.BaseConfig{}
cfg.DBPool = pool
cfg.DBQueries = repository.New(pool)
svc := New(cfg, &Services{})
queryType := resultprocessor.Type(resultprocessor.TypeContextFull)
creator, err := svc.getCreator(queryType)
@@ -82,12 +81,10 @@ func TestSubmitCreate(t *testing.T) {
if err != nil {
t.Fatalf("failed to open pgxmock database: %v", err)
}
queries := repository.New(pool)
db := &database.Connection{
Queries: queries,
Pool: pool,
}
svc := New(db, &Services{})
cfg := &serviceconfig.BaseConfig{}
cfg.DBPool = pool
cfg.DBQueries = repository.New(pool)
svc := New(cfg, &Services{})
config := "{\"path\":\"example_path\"}"
q := Query{
@@ -132,12 +129,10 @@ func TestSubmitCreateNoReqsOrConfig(t *testing.T) {
if err != nil {
t.Fatalf("failed to open pgxmock database: %v", err)
}
queries := repository.New(pool)
db := &database.Connection{
Queries: queries,
Pool: pool,
}
svc := New(db, &Services{})
cfg := &serviceconfig.BaseConfig{}
cfg.DBPool = pool
cfg.DBQueries = repository.New(pool)
svc := New(cfg, &Services{})
q := Query{
ID: uuid.New(),
@@ -169,12 +164,10 @@ func TestNormalizeCreate(t *testing.T) {
if err != nil {
t.Fatalf("failed to open pgxmock database: %v", err)
}
queries := repository.New(pool)
db := &database.Connection{
Queries: queries,
Pool: pool,
}
svc := New(db, &Services{})
cfg := &serviceconfig.BaseConfig{}
cfg.DBPool = pool
cfg.DBQueries = repository.New(pool)
svc := New(cfg, &Services{})
create := &resultprocessor.Create{
Type: resultprocessor.TypeJsonExtractor,