From e5e786cf4b87ab4438cb7e42160ce6ad323ab93b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Garcia?= Date: Wed, 22 Dec 2021 17:56:51 -0300 Subject: [PATCH] Simplify TestMain --- main_test.go | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/main_test.go b/main_test.go index 85cef01..2d2a06a 100644 --- a/main_test.go +++ b/main_test.go @@ -18,20 +18,19 @@ import ( _ "github.com/mattn/go-sqlite3" ) -var connectionString = map[string]string{ - "postgres": "host=localhost port=5432 user=postgres password=postgres dbname=ksql sslmode=disable", - "sqlite3": "/tmp/ksql.db", - "mysql": "root:mysql@(127.0.0.1:3306)/ksql?timeout=30s", - "sqlserver": "sqlserver://sa:Sqls3rv3r@127.0.0.1:1433?databaseName=ksql", -} +var connectionString map[string]string func TestMain(m *testing.M) { postgresURL, closePostgres := startPostgresDB("ksql") - connectionString["postgres"] = postgresURL mysqlURL, closeMySQL := startMySQLDB("ksql") - connectionString["mysql"] = mysqlURL sqlServerURL, closeSQLServer := startSQLServerDB("ksql") - connectionString["sqlserver"] = sqlServerURL + + connectionString = map[string]string{ + "postgres": postgresURL, + "sqlite3": "/tmp/ksql.db", + "mysql": mysqlURL, + "sqlserver": sqlServerURL, + } exitCode := m.Run()