Rehabilitate tests

This commit is contained in:
lash
2025-01-08 22:27:19 +00:00
parent ddefdd7fb3
commit df8c9aab0c
9 changed files with 16 additions and 43 deletions

View File

@@ -55,14 +55,6 @@ func (ms *MenuStorageService) getOrCreateDb(ctx context.Context, existingDb db.D
connStr := ms.conn.String()
dbTyp := ms.conn.DbType()
if dbTyp == DBTYPE_POSTGRES {
// // Ensure the schema exists
// err = ensureSchemaExists(ctx, connStr, schema)
// if err != nil {
// return nil, fmt.Errorf("failed to ensure schema exists: %w", err)
// }
//
// newDb = postgres.NewPgDb().WithSchema(schema)
newDb = postgres.NewPgDb()
} else if dbTyp == DBTYPE_GDBM {
err = ms.ensureDbDir()

View File

@@ -17,17 +17,19 @@ import (
"git.grassecon.net/urdt/ussd/internal/testutil/testservice"
"git.grassecon.net/urdt/ussd/internal/testutil/testtag"
"git.grassecon.net/urdt/ussd/remote"
testdataloader "github.com/peteole/testdata-loader"
)
var (
logg = logging.NewVanilla()
baseDir = testdataloader.GetBasePath()
scriptDir = path.Join(baseDir, "services", "registration")
selectedDatabase = ""
selectedDbSchema = ""
)
func init() {
initializers.LoadEnvVariables()
initializers.LoadEnvVariablesPath(baseDir)
}
// SetDatabase updates the database used by TestEngine