Skip to content

Commit

Permalink
test: remove comments in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Jesse0Michael committed Oct 29, 2024
1 parent b71bae1 commit 60688fb
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions processors/baggagecopy/log_processor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,12 @@ func TestLogProcessorAppendsAllBaggageAttributes(t *testing.T) {
b = addEntryToBaggage(t, b, "baggage.test", "baggage value")
ctx := baggage.ContextWithBaggage(context.Background(), b)

// create log provider with the baggage log processor and a log processor used to capture emitted record
wrapped := &processor{}
lp := log.NewLoggerProvider(
log.WithProcessor(NewLogProcessor(AllowAllMembers)),
log.WithProcessor(wrapped),
)

// log a test record
lp.Logger("test").Emit(ctx, api.Record{})

require.Len(t, wrapped.records, 1)
Expand All @@ -73,14 +71,12 @@ func TestLogProcessorAppendsBaggageAttributesWithHasPrefixPredicate(t *testing.T
return strings.HasPrefix(m.Key(), "baggage.")
}

// create log provider with the baggage log processor and a log processor used to capture emitted record
wrapped := &processor{}
lp := log.NewLoggerProvider(
log.WithProcessor(NewLogProcessor(baggageKeyPredicate)),
log.WithProcessor(wrapped),
)

// log a test record
lp.Logger("test").Emit(ctx, api.Record{})

require.Len(t, wrapped.records, 1)
Expand All @@ -106,14 +102,12 @@ func TestLogProcessorAppendsBaggageAttributesWithRegexPredicate(t *testing.T) {
return expr.MatchString(m.Key())
}

// create log provider with the baggage log processor and a log processor used to capture emitted record
wrapped := &processor{}
lp := log.NewLoggerProvider(
log.WithProcessor(NewLogProcessor(baggageKeyPredicate)),
log.WithProcessor(wrapped),
)

// log a test record
lp.Logger("test").Emit(ctx, api.Record{})

require.Len(t, wrapped.records, 1)
Expand All @@ -139,14 +133,12 @@ func TestLogProcessorOnlyAddsBaggageEntriesThatMatchPredicate(t *testing.T) {
return m.Key() == "baggage.test"
}

// create log provider with the baggage log processor and a log processor used to capture emitted record
wrapped := &processor{}
lp := log.NewLoggerProvider(
log.WithProcessor(NewLogProcessor(baggageKeyPredicate)),
log.WithProcessor(wrapped),
)

// log a test record
lp.Logger("test").Emit(ctx, api.Record{})

require.Len(t, wrapped.records, 1)
Expand Down

0 comments on commit 60688fb

Please sign in to comment.