Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
cleptric committed Dec 12, 2024
1 parent a42721e commit 7bc7226
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 12 deletions.
3 changes: 0 additions & 3 deletions dynamic_sampling_context_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,6 @@ func TestDynamicSamplingContextFromTransaction(t *testing.T) {
Release: "1.0.0",
Environment: "test",
})
hubFromContext(ctx).ConfigureScope(func(scope *Scope) {
scope.SetUser(User{Segment: "user_segment"})
})
txn := StartTransaction(ctx, "name", WithTransactionSource(SourceCustom))
txn.TraceID = TraceIDFromHex("d49d9bf66f13450b81f65bc51cf49c03")
return txn
Expand Down
4 changes: 0 additions & 4 deletions interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,6 @@ func (u User) IsEmpty() bool {
return false
}

if u.Segment != "" {
return false
}

if len(u.Data) > 0 {
return false
}
Expand Down
3 changes: 1 addition & 2 deletions interfaces_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,8 @@ func TestUserIsEmpty(t *testing.T) {
{input: User{IPAddress: "127.0.0.1"}, want: false},
{input: User{Username: "My Username"}, want: false},
{input: User{Name: "My Name"}, want: false},
{input: User{Segment: "My Segment"}, want: false},
{input: User{Data: map[string]string{"foo": "bar"}}, want: false},
{input: User{ID: "foo", Email: "foo@example.com", IPAddress: "127.0.0.1", Username: "My Username", Name: "My Name", Segment: "My Segment", Data: map[string]string{"foo": "bar"}}, want: false},
{input: User{ID: "foo", Email: "foo@example.com", IPAddress: "127.0.0.1", Username: "My Username", Name: "My Name", Data: map[string]string{"foo": "bar"}}, want: false},
}

for _, test := range tests {
Expand Down
4 changes: 2 additions & 2 deletions scope_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ func fillEventWithData(event *Event) *Event {

func TestScopeSetUser(t *testing.T) {
scope := NewScope()
scope.SetUser(User{ID: "foo", Email: "foo@example.com", IPAddress: "127.0.0.1", Username: "My Username", Name: "My Name", Segment: "My Segment", Data: map[string]string{"foo": "bar"}})
scope.SetUser(User{ID: "foo", Email: "foo@example.com", IPAddress: "127.0.0.1", Username: "My Username", Name: "My Name", Data: map[string]string{"foo": "bar"}})

assertEqual(t, User{ID: "foo", Email: "foo@example.com", IPAddress: "127.0.0.1", Username: "My Username", Name: "My Name", Segment: "My Segment", Data: map[string]string{"foo": "bar"}}, scope.user)
assertEqual(t, User{ID: "foo", Email: "foo@example.com", IPAddress: "127.0.0.1", Username: "My Username", Name: "My Name", Data: map[string]string{"foo": "bar"}}, scope.user)
}

func TestScopeSetUserOverrides(t *testing.T) {
Expand Down
1 change: 0 additions & 1 deletion slog/converter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ func TestAttrToSentryEvent(t *testing.T) {
IPAddress: "user_ip_address",
Username: "user_username",
Name: "user_name",
Segment: "user_segment",
Data: map[string]string{},
},
},
Expand Down

0 comments on commit 7bc7226

Please sign in to comment.