Tracing for gRPC Server (#619)

* Implements tracing in the native gRPC server

* Undo some unnecessary changes

* Properly revert trace/setup.go this time

* Some very very basic tests

* Remove warning for non-Trace middleware
This commit is contained in:
John Belamaric
2017-04-18 11:10:49 -04:00
committed by GitHub
parent 3b6eab2256
commit 5a60090933
6 changed files with 72 additions and 11 deletions

View File

@@ -0,0 +1,26 @@
package dnsserver
import (
"testing"
)
func makeConfig(transport string) *Config {
return &Config{Zone: "example.com", Transport: transport, ListenHost: "127.0.0.1", Port: "53"}
}
func TestNewServer(t *testing.T) {
_, err := NewServer("127.0.0.1:53", []*Config{makeConfig("dns")})
if err != nil {
t.Errorf("Expected no error for NewServer, got %s.", err)
}
_, err = NewServergRPC("127.0.0.1:53", []*Config{makeConfig("grpc")})
if err != nil {
t.Errorf("Expected no error for NewServergRPC, got %s.", err)
}
_, err = NewServerTLS("127.0.0.1:53", []*Config{makeConfig("tls")})
if err != nil {
t.Errorf("Expected no error for NewServerTLS, got %s.", err)
}
}