1
0
mirror of https://github.com/go-kratos/kratos.git synced 2025-01-26 03:52:12 +02:00
kratos/pkg/net/trace/config_test.go
2019-02-01 15:57:43 +08:00

34 lines
563 B
Go

package trace
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestParseDSN(t *testing.T) {
_, err := parseDSN(_traceDSN)
if err != nil {
t.Error(err)
}
}
func TestTraceFromEnvFlag(t *testing.T) {
_, err := TracerFromEnvFlag()
if err != nil {
t.Error(err)
}
}
func TestInit(t *testing.T) {
Init(nil)
_, ok := _tracer.(nooptracer)
assert.False(t, ok)
_tracer = nooptracer{}
Init(&Config{Network: "unixgram", Addr: "unixgram:///var/run/dapper-collect/dapper-collect.sock"})
_, ok = _tracer.(nooptracer)
assert.False(t, ok)
}