Skip to content

Commit

Permalink
Fix builds and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
veqryn committed Dec 19, 2024
1 parent 73507e1 commit f7b9da0
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 54 deletions.
17 changes: 9 additions & 8 deletions examples/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@ go 1.21

require (
github.com/veqryn/slog-context v0.7.0
github.com/veqryn/slog-context/otel v0.6.0
go.opentelemetry.io/otel v1.24.0
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.24.0
go.opentelemetry.io/otel/sdk v1.24.0
go.opentelemetry.io/otel/trace v1.24.0
github.com/veqryn/slog-context/otel v0.7.0
go.opentelemetry.io/otel v1.29.0
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.29.0
go.opentelemetry.io/otel/sdk v1.29.0
go.opentelemetry.io/otel/trace v1.29.0
)

require (
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
go.opentelemetry.io/otel/metric v1.24.0 // indirect
golang.org/x/sys v0.18.0 // indirect
github.com/google/uuid v1.6.0 // indirect
go.opentelemetry.io/otel/metric v1.29.0 // indirect
golang.org/x/sys v0.24.0 // indirect
)
38 changes: 20 additions & 18 deletions examples/go.sum
Original file line number Diff line number Diff line change
@@ -1,31 +1,33 @@
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ=
github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/veqryn/slog-context v0.7.0 h1:Ne7ajlR6Mjs2rQQtpg8k0eO6krR5wzpareh5VpV+V2s=
github.com/veqryn/slog-context v0.7.0/go.mod h1:E+qpdyiQs2YKRxFnX1JjpdFE1z3Ka94Kem2q9ZG6Jjo=
github.com/veqryn/slog-context/otel v0.6.0 h1:LwVMzfKMFhVpIKPASwa4IkzgL8+/bmyrFWJYrBIkpf0=
github.com/veqryn/slog-context/otel v0.6.0/go.mod h1:0l6vQ7IqZHKq1MH7pyhNlbdUutBcuiGYJluAPLQ33Nk=
go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo=
go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo=
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.24.0 h1:s0PHtIkN+3xrbDOpt2M8OTG92cWqUESvzh2MxiR5xY8=
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.24.0/go.mod h1:hZlFbDbRt++MMPCCfSJfmhkGIWnX1h3XjkfxZUjLrIA=
go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI=
go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco=
go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw=
go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg=
go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI=
go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU=
golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
github.com/veqryn/slog-context/otel v0.7.0 h1:7JptnwF5XyEVSygzilp/LqRmjSymqGBgFcKG5MZLvnU=
github.com/veqryn/slog-context/otel v0.7.0/go.mod h1:Zqag1kf9g8K5ZPIJjgLYwqtWCaEPzXXZEzgguvxPCws=
go.opentelemetry.io/otel v1.29.0 h1:PdomN/Al4q/lN6iBJEN3AwPvUiHPMlt93c8bqTG5Llw=
go.opentelemetry.io/otel v1.29.0/go.mod h1:N/WtXPs1CNCUEx+Agz5uouwCba+i+bJGFicT8SR4NP8=
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.29.0 h1:X3ZjNp36/WlkSYx0ul2jw4PtbNEDDeLskw3VPsrpYM0=
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.29.0/go.mod h1:2uL/xnOXh0CHOBFCWXz5u1A4GXLiW+0IQIzVbeOEQ0U=
go.opentelemetry.io/otel/metric v1.29.0 h1:vPf/HFWTNkPu1aYeIsc98l4ktOQaL6LeSoeV2g+8YLc=
go.opentelemetry.io/otel/metric v1.29.0/go.mod h1:auu/QWieFVWx+DmQOUMgj0F8LHWdgalxXqvp7BII/W8=
go.opentelemetry.io/otel/sdk v1.29.0 h1:vkqKjk7gwhS8VaWb0POZKmIEDimRCMsopNYnriHyryo=
go.opentelemetry.io/otel/sdk v1.29.0/go.mod h1:pM8Dx5WKnvxLCb+8lG1PRNIDxu9g9b9g59Qr7hfAAok=
go.opentelemetry.io/otel/trace v1.29.0 h1:J/8ZNK4XgR7a21DZUAsbF8pZ5Jcw1VhACmnYt39JTi4=
go.opentelemetry.io/otel/trace v1.29.0/go.mod h1:eHl3w0sp3paPkYstJOmAimxhiFXPg+MMTlEh3nsQgWQ=
golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg=
golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
34 changes: 17 additions & 17 deletions grpc/interceptor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,13 +189,13 @@ func TestClientStreaming(t *testing.T) {
if err != nil {
t.Fatal(err)
}
time.Sleep(10*time.Millisecond) // GRPC buffers under the hood, so let the server catch up
time.Sleep(10 * time.Millisecond) // GRPC buffers under the hood, so let the server catch up

err = stream.Send(&protogen.TestReq{Name: "clientRequest2"})
if err != nil {
t.Fatal(err)
}
time.Sleep(10*time.Millisecond) // GRPC buffers under the hood, so let the server catch up
time.Sleep(10 * time.Millisecond) // GRPC buffers under the hood, so let the server catch up

_, err = stream.CloseAndRecv()
if err != nil {
Expand Down Expand Up @@ -251,13 +251,13 @@ func TestClientStreaming(t *testing.T) {
if err != nil {
t.Fatal(err)
}
time.Sleep(10*time.Millisecond) // GRPC buffers under the hood, so let the server catch up
time.Sleep(10 * time.Millisecond) // GRPC buffers under the hood, so let the server catch up

err = stream.Send(&protogen.TestReq{})
if err != nil {
t.Fatal(err)
}
time.Sleep(10*time.Millisecond) // GRPC buffers under the hood, so let the server catch up
time.Sleep(10 * time.Millisecond) // GRPC buffers under the hood, so let the server catch up

_, err = stream.CloseAndRecv()
if err == nil {
Expand Down Expand Up @@ -313,13 +313,13 @@ func TestClientStreaming(t *testing.T) {
if err != nil {
t.Fatal(err)
}
time.Sleep(10*time.Millisecond) // GRPC buffers under the hood, so let the server catch up
time.Sleep(10 * time.Millisecond) // GRPC buffers under the hood, so let the server catch up

err = stream.Send(&protogen.TestReq{Name: "clientRequest2"})
if err != io.EOF {
t.Fatal("expected EOF")
}
time.Sleep(10*time.Millisecond) // GRPC buffers under the hood, so let the server catch up
time.Sleep(10 * time.Millisecond) // GRPC buffers under the hood, so let the server catch up

_, err = stream.CloseAndRecv()
if err == nil {
Expand Down Expand Up @@ -613,7 +613,7 @@ func TestBidirectionalStreaming(t *testing.T) {
if err != nil {
t.Fatal(err)
}
time.Sleep(10*time.Millisecond) // GRPC buffers under the hood, so let the server catch up
time.Sleep(10 * time.Millisecond) // GRPC buffers under the hood, so let the server catch up

_, err = stream.Recv()
if err != nil {
Expand All @@ -624,7 +624,7 @@ func TestBidirectionalStreaming(t *testing.T) {
if err != nil {
t.Fatal(err)
}
time.Sleep(10*time.Millisecond) // GRPC buffers under the hood, so let the server catch up
time.Sleep(10 * time.Millisecond) // GRPC buffers under the hood, so let the server catch up

// streams should always be closed after last send
err = stream.CloseSend()
Expand Down Expand Up @@ -698,7 +698,7 @@ func TestBidirectionalStreaming(t *testing.T) {
if err != nil {
t.Fatal(err)
}
time.Sleep(10*time.Millisecond) // GRPC buffers under the hood, so let the server catch up
time.Sleep(10 * time.Millisecond) // GRPC buffers under the hood, so let the server catch up

_, err = stream.Recv()
if err != nil {
Expand All @@ -709,7 +709,7 @@ func TestBidirectionalStreaming(t *testing.T) {
if err != nil {
t.Fatal(err)
}
time.Sleep(10*time.Millisecond) // GRPC buffers under the hood, so let the server catch up
time.Sleep(10 * time.Millisecond) // GRPC buffers under the hood, so let the server catch up

_, err = stream.Recv()
if err == nil {
Expand Down Expand Up @@ -777,7 +777,7 @@ func TestBidirectionalStreaming(t *testing.T) {
if err != nil {
t.Fatal(err)
}
time.Sleep(10*time.Millisecond) // GRPC buffers under the hood, so let the server catch up
time.Sleep(10 * time.Millisecond) // GRPC buffers under the hood, so let the server catch up

_, err = stream.Recv()
if err != nil {
Expand All @@ -788,14 +788,14 @@ func TestBidirectionalStreaming(t *testing.T) {
if err != nil {
t.Fatal(err)
}
time.Sleep(10*time.Millisecond) // GRPC buffers under the hood, so let the server catch up
time.Sleep(10 * time.Millisecond) // GRPC buffers under the hood, so let the server catch up

_, err = stream.Recv()
if err != nil {
t.Fatal(err)
}

time.Sleep(100*time.Millisecond) // Let the server catch up
time.Sleep(100 * time.Millisecond) // Let the server catch up

err = stream.Send(&protogen.TestReq{Name: "clientRequest3"})
if err != io.EOF {
Expand All @@ -811,7 +811,7 @@ func TestBidirectionalStreaming(t *testing.T) {
// Should always keep receiving until error
for {
_, err = stream.Recv()
if err != nil {
if err != nil {
break
}
}
Expand Down Expand Up @@ -975,7 +975,7 @@ func (s *server) ServerStream(req *protogen.TestReq, stream grpc.ServerStreaming
// fmt.Println(err)
return err
}
time.Sleep(10*time.Millisecond) // GRPC buffers under the hood, so let the client catch up
time.Sleep(10 * time.Millisecond) // GRPC buffers under the hood, so let the client catch up
}
if rerr != nil {
return rerr
Expand Down Expand Up @@ -1004,7 +1004,7 @@ func (s *server) BidirectionalStream(stream grpc.BidiStreamingServer[protogen.Te
// fmt.Println(err)
return err
}
time.Sleep(10*time.Millisecond) // GRPC buffers under the hood, so let the client catch up
time.Sleep(10 * time.Millisecond) // GRPC buffers under the hood, so let the client catch up
}
if rerr != nil {
return rerr
Expand All @@ -1019,7 +1019,7 @@ func (s *server) BidirectionalStream(stream grpc.BidiStreamingServer[protogen.Te
// fmt.Println(err)
return err
}
time.Sleep(10*time.Millisecond) // GRPC buffers under the hood, so let the client catch up
time.Sleep(10 * time.Millisecond) // GRPC buffers under the hood, so let the client catch up
}
if rerr != nil {
return rerr
Expand Down
6 changes: 3 additions & 3 deletions otel/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ go 1.21

require (
github.com/veqryn/slog-context v0.7.0
go.opentelemetry.io/otel v1.24.0
go.opentelemetry.io/otel/trace v1.24.0
go.opentelemetry.io/otel v1.29.0
go.opentelemetry.io/otel/trace v1.29.0
)

require github.com/go-logr/logr v1.4.1 // indirect
require github.com/go-logr/logr v1.4.2 // indirect
16 changes: 8 additions & 8 deletions otel/go.sum
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ=
github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/veqryn/slog-context v0.7.0 h1:Ne7ajlR6Mjs2rQQtpg8k0eO6krR5wzpareh5VpV+V2s=
github.com/veqryn/slog-context v0.7.0/go.mod h1:E+qpdyiQs2YKRxFnX1JjpdFE1z3Ka94Kem2q9ZG6Jjo=
go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo=
go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo=
go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI=
go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU=
go.opentelemetry.io/otel v1.29.0 h1:PdomN/Al4q/lN6iBJEN3AwPvUiHPMlt93c8bqTG5Llw=
go.opentelemetry.io/otel v1.29.0/go.mod h1:N/WtXPs1CNCUEx+Agz5uouwCba+i+bJGFicT8SR4NP8=
go.opentelemetry.io/otel/trace v1.29.0 h1:J/8ZNK4XgR7a21DZUAsbF8pZ5Jcw1VhACmnYt39JTi4=
go.opentelemetry.io/otel/trace v1.29.0/go.mod h1:eHl3w0sp3paPkYstJOmAimxhiFXPg+MMTlEh3nsQgWQ=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
2 changes: 2 additions & 0 deletions otel/otel_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,5 @@ func (*recorderSpan) SetName(string) {}

// TracerProvider returns nil.
func (*recorderSpan) TracerProvider() trace.TracerProvider { return nil }

func (r *recorderSpan) AddLink(link trace.Link) {}

0 comments on commit f7b9da0

Please sign in to comment.