Kubernetes logging (#1054)

* wip

* Implementation of Kubernetes Logger

* Missing file

* Skip test in Travis
This commit is contained in:
Jake Sanders
2019-12-20 23:16:05 +00:00
committed by Asim Aslam
parent ae12fd1021
commit ce33e3b072
8 changed files with 224 additions and 15 deletions

View File

@@ -13,7 +13,10 @@ import (
)
func TestKubernetes(t *testing.T) {
k := New()
if os.Getenv("IN_TRAVIS_CI") == "yes" {
t.Skip("In Travis CI")
}
k := New(log.Name("micro-network"))
r, w, err := os.Pipe()
if err != nil {
@@ -39,14 +42,15 @@ func TestKubernetes(t *testing.T) {
}
assert.Equal(t, write, read, "Write was not equal")
_, err = k.Read()
assert.Error(t, err, "Read should be unimplemented")
records, err := k.Read()
assert.Nil(t, err, "Read should not error")
assert.NotNil(t, records, "Read should return records")
stream, err := k.Stream()
if err != nil {
t.Error(err)
}
records := []log.Record{}
records = []log.Record{}
go stream.Stop()
for s := range stream.Chan() {
records = append(records, s)