From a37f6e6da30f0f21cf07718237169d47d9ce41e0 Mon Sep 17 00:00:00 2001 From: alfred-mk Date: Wed, 8 Jan 2025 10:57:58 +0300 Subject: [PATCH] pass the dbschema in the context --- internal/testutil/TestEngine.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/testutil/TestEngine.go b/internal/testutil/TestEngine.go index 40a744f..25a1c15 100644 --- a/internal/testutil/TestEngine.go +++ b/internal/testutil/TestEngine.go @@ -24,6 +24,7 @@ var ( logg = logging.NewVanilla() scriptDir = path.Join(baseDir, "services", "registration") selectedDatabase = "" + selectedDbSchema = "" ) func init() { @@ -31,14 +32,17 @@ func init() { } // SetDatabase updates the database used by TestEngine -func SetDatabase(dbType string) { +func SetDatabase(dbType string, dbSchema string) { selectedDatabase = dbType + selectedDbSchema = dbSchema } func TestEngine(sessionId string) (engine.Engine, func(), chan bool) { ctx := context.Background() ctx = context.WithValue(ctx, "SessionId", sessionId) ctx = context.WithValue(ctx, "Database", selectedDatabase) + ctx = context.WithValue(ctx, "Schema", selectedDbSchema) + pfp := path.Join(scriptDir, "pp.csv") var eventChannel = make(chan bool)