Skip to content

Commit

Permalink
Merge pull request #1 from rplessl/opentsdb_output_plugin_telnet_unit…
Browse files Browse the repository at this point in the history
…test

added docker image unit test with OpenTSDB
  • Loading branch information
rplessl committed Sep 11, 2015
2 parents fa037ad + 58a2e5e commit 33281ed
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 11 deletions.
31 changes: 20 additions & 11 deletions outputs/opentsdb/opentsdb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,11 @@ package opentsdb
import (
"reflect"
"testing"
)

var (
fakeHost = "metrics.example.com"
fakePort = 4242
"github.com/influxdb/telegraf/testutil"
"github.com/stretchr/testify/require"
)

func fakeOpenTSDB() *OpenTSDB {
var o OpenTSDB
o.Host = fakeHost
o.Port = fakePort
return &o
}

func TestBuildTagsTelnet(t *testing.T) {
var tagtests = []struct {
bpIn map[string]string
Expand Down Expand Up @@ -51,3 +42,21 @@ func TestBuildTagsTelnet(t *testing.T) {
}
}
}
func TestWrite(t *testing.T) {
if testing.Short() {
t.Skip("Skipping integration test in short mode")
}

o := &OpenTSDB{
Host: testutil.GetLocalHost() ,
Port: 24242,
}

// Verify that we can connect to the OpenTSDB instance
err := o.Connect()
require.NoError(t, err)

// Verify that we can successfully write data to OpenTSDB
err = o.Write(testutil.MockBatchPoints())
require.NoError(t, err)
}
6 changes: 6 additions & 0 deletions scripts/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,9 @@ kafka:
environment:
ADVERTISED_HOST:
ADVERTISED_PORT: 9092

opentsdb:
image: lancope/opentsdb
ports:
- "24242:4242"

0 comments on commit 33281ed

Please sign in to comment.