From 153e17a58088143c20db8ed2baea618cc0b89f4a Mon Sep 17 00:00:00 2001 From: Jared Harper Date: Fri, 3 May 2024 15:21:45 -0700 Subject: [PATCH] re-enable test --- internal/sampler/sampler_test.go | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/internal/sampler/sampler_test.go b/internal/sampler/sampler_test.go index f888dc31..8b7a4542 100644 --- a/internal/sampler/sampler_test.go +++ b/internal/sampler/sampler_test.go @@ -458,21 +458,20 @@ func TestHydrateTraceStateBadSignature(t *testing.T) { } func TestHydrateTraceStateNoSignatureKey(t *testing.T) { - // TODO Fix by properly setting _no_ settings - //oboetestutils.UpdateSetting(oboetestutils.NoSettingST) - //sc := trace.NewSpanContext(trace.SpanContextConfig{ - // TraceID: traceId, - // SpanID: spanId, - //}) - //opts := fmt.Sprintf("trigger-trace;ts=%d", time.Now().Unix()) - //ctx := context.WithValue(context.Background(), xtrace.OptionsKey, opts) - //sig := "0000" - //ctx = context.WithValue(ctx, xtrace.SignatureKey, sig) - //xto := xtrace.GetXTraceOptions(ctx) - //ts := hydrateTraceState(sc, xto, "ok") - //fullResp, err := swotel.GetInternalState(ts, swotel.XTraceOptResp) - //require.NoError(t, err) - //require.Equal(t, "auth=no-signature-key", fullResp) + sc := trace.NewSpanContext(trace.SpanContextConfig{ + TraceID: traceId, + SpanID: spanId, + }) + opts := fmt.Sprintf("trigger-trace;ts=%d", time.Now().Unix()) + ctx := context.WithValue(context.Background(), xtrace.OptionsKey, opts) + sig := "0000" + ctx = context.WithValue(ctx, xtrace.SignatureKey, sig) + o := oboe.NewOboe() + xto := xtrace.GetXTraceOptions(ctx, o) + ts := hydrateTraceState(sc, xto, "ok") + fullResp, err := swotel.GetInternalState(ts, swotel.XTraceOptResp) + require.NoError(t, err) + require.Equal(t, "auth=no-signature-key", fullResp) } func TestHydrateTraceStateValidSignature(t *testing.T) {