Add DOCKER_HOST support for tests
This allows to run tests in environments where DOCKER_HOST is used. This is extremely helpful when using boot2docker to run docker
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package mysql
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
@@ -11,7 +12,7 @@ import (
|
||||
|
||||
func TestMysqlGeneratesMetrics(t *testing.T) {
|
||||
m := &Mysql{
|
||||
Servers: []string{"root@tcp(localhost:3306)/"},
|
||||
Servers: []string{fmt.Sprintf("root@tcp(%s:3306)/", testutil.GetLocalHost())},
|
||||
}
|
||||
|
||||
var acc testutil.Accumulator
|
||||
@@ -54,7 +55,7 @@ func TestMysqlGeneratesMetrics(t *testing.T) {
|
||||
|
||||
func TestMysqlDefaultsToLocal(t *testing.T) {
|
||||
m := &Mysql{
|
||||
Servers: []string{"root@tcp(localhost:3306)/"},
|
||||
Servers: []string{fmt.Sprintf("root@tcp(%s:3306)/", testutil.GetLocalHost())},
|
||||
}
|
||||
|
||||
var acc testutil.Accumulator
|
||||
|
||||
Reference in New Issue
Block a user