From 3296e36f8ec42e33d92927b6554aaf8a1a68d8b7 Mon Sep 17 00:00:00 2001 From: Noah Hilverling Date: Mon, 4 Mar 2019 13:59:40 +0100 Subject: [PATCH] Change tests to be compatible with icingadb-connection --- ha_test.go | 2 +- heartbeat_test.go | 13 ++++--------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/ha_test.go b/ha_test.go index ad5053ed..5924a1c2 100644 --- a/ha_test.go +++ b/ha_test.go @@ -74,7 +74,7 @@ func TestHA_handleResponsibility(t *testing.T) { func Test_cleanUpInstances(t *testing.T) { var dbw, err = icingadb_connection.NewDBWrapper( "mysql", - "root:foo@tcp(127.0.0.1:3306)/icingadb?" + + "module-dev:icinga0815!@tcp(127.0.0.1:3306)/icingadb?" + "innodb_strict_mode=1&sql_mode='STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,NO_ENGINE_SUBSTITUTION,PIPES_AS_CONCAT,ANSI_QUOTES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER'") assert.NoError(t, err, "SQL error") diff --git a/heartbeat_test.go b/heartbeat_test.go index 3ab4a93b..190e1dad 100644 --- a/heartbeat_test.go +++ b/heartbeat_test.go @@ -3,7 +3,6 @@ package icingadb_ha import ( "encoding/json" "git.icinga.com/icingadb/icingadb-connection-lib" - "github.com/go-redis/redis" "github.com/stretchr/testify/assert" "testing" "time" @@ -17,14 +16,10 @@ var icingastate = "{\"IcingaApplication\":" + "}}}}}" func TestIcingaEventsBroker(t *testing.T) { - rd := redis.NewClient(&redis.Options{ - Addr: "127.0.0.1:6379", - DialTimeout: time.Minute / 2, - ReadTimeout: time.Minute, - WriteTimeout: time.Minute, - }) - - rdb := icingadb_connection.NewRDBWrapper(rd) + rdb, err := icingadb_connection.NewRDBWrapper("127.0.0.1:6379") + if err != nil { + t.Fatal("This test needs a working Redis connection") + } chEnv := make(chan *icingadb_connection.Environment)