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:
@@ -2,6 +2,7 @@ package server_test
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
"path"
|
||||
"queryorchestration/internal/server"
|
||||
@@ -17,13 +18,20 @@ func TestNew(t *testing.T) {
|
||||
}
|
||||
ctx := context.Background()
|
||||
|
||||
_, cleanup := test.CreateDB(t, ctx, &test.CreateDatabaseConfig{})
|
||||
t.Setenv("BASE_PATH", path.Join(os.Getenv("PWD"), "../.."))
|
||||
cfg := &server.BaseConfig{}
|
||||
|
||||
_, cleanup := test.CreateDB(t, ctx, &test.CreateDatabaseConfig{
|
||||
Cfg: cfg,
|
||||
})
|
||||
defer cleanup()
|
||||
|
||||
newCfg := &server.NewConfig{
|
||||
BasePath: path.Join(os.Getenv("PWD"), "../.."),
|
||||
}
|
||||
|
||||
cfg := server.New(ctx, newCfg)
|
||||
assert.NotNil(t, cfg)
|
||||
clean, err := server.New(ctx, cfg)
|
||||
assert.NoError(t, err)
|
||||
defer func() {
|
||||
if err := clean(); err != nil {
|
||||
// Log cleanup error but don't panic since we're shutting down
|
||||
fmt.Printf("Error during clean: %v", err)
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user