Skip to content

Commit

Permalink
fix: proper init for log test
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaspoignant committed Nov 4, 2024
1 parent e6db682 commit a2ba621
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion cmd/relayproxy/api/opentelemetry/otel_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,12 @@ func TestInit(t *testing.T) {

expectedErr := errors.New("test error")

err := svc.Init(context.Background(), testLogger, config.Config{})
t.Setenv("OTEL_EXPORTER_OTLP_ENDPOINT", "https://example.com:4318")
f := pflag.NewFlagSet("config", pflag.ContinueOnError)
c, errC := config.New(f, zap.L(), "1.X.X")
require.NoError(t, errC)
c.OpenTelemetryOtlpEndpoint = "https://bogus.com:4317"
err := svc.Init(context.Background(), testLogger, *c)
require.NoError(t, err)
defer func() { _ = svc.Stop(context.Background()) }()
otel.GetErrorHandler().Handle(expectedErr)
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ require (
github.com/aws/aws-sdk-go v1.55.5
github.com/aws/aws-sdk-go-v2 v1.32.2
github.com/aws/aws-sdk-go-v2/config v1.28.0
github.com/aws/aws-sdk-go-v2/credentials v1.17.41
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.34
github.com/aws/aws-sdk-go-v2/service/kinesis v1.32.2
github.com/aws/aws-sdk-go-v2/service/s3 v1.66.1
Expand Down Expand Up @@ -88,7 +89,6 @@ require (
github.com/apache/arrow/go/arrow v0.0.0-20200730104253-651201b0f516 // indirect
github.com/apache/thrift v0.14.2 // indirect
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.6 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.17.41 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.17 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.21 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.21 // indirect
Expand Down

0 comments on commit a2ba621

Please sign in to comment.