Change tests to be compatible with icingadb-connection

This commit is contained in:
Noah Hilverling 2019-03-04 13:59:40 +01:00
parent 400c9b28c0
commit 3296e36f8e
2 changed files with 5 additions and 10 deletions

View file

@ -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")

View file

@ -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)