2015-10-22 21:50:19 +00:00
|
|
|
package riemann
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
2016-01-20 18:57:35 +00:00
|
|
|
"github.com/influxdata/telegraf/testutil"
|
2015-10-22 21:50:19 +00:00
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestConnectAndWrite(t *testing.T) {
|
|
|
|
if testing.Short() {
|
|
|
|
t.Skip("Skipping integration test in short mode")
|
|
|
|
}
|
|
|
|
|
|
|
|
url := testutil.GetLocalHost() + ":5555"
|
|
|
|
|
|
|
|
r := &Riemann{
|
|
|
|
URL: url,
|
|
|
|
Transport: "tcp",
|
|
|
|
}
|
|
|
|
|
|
|
|
err := r.Connect()
|
|
|
|
require.NoError(t, err)
|
|
|
|
|
2016-01-27 23:15:14 +00:00
|
|
|
err = r.Write(testutil.MockMetrics())
|
2015-10-22 21:50:19 +00:00
|
|
|
require.NoError(t, err)
|
|
|
|
}
|