Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v2] Remove temporary SkipBinaryAttrs flag from e2e tests #5436

Merged
merged 1 commit into from
May 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion cmd/jaeger/internal/integration/badger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ func TestBadgerStorage(t *testing.T) {
s := &E2EStorageIntegration{
ConfigFile: "../../config-badger.yaml",
StorageIntegration: integration.StorageIntegration{
SkipBinaryAttrs: true,
SkipArchiveTest: true,
CleanUp: purge,

Expand Down
1 change: 0 additions & 1 deletion cmd/jaeger/internal/integration/cassandra_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ func TestCassandraStorage(t *testing.T) {
CleanUp: purge,
GetDependenciesReturnsSource: true,
SkipArchiveTest: true,
SkipBinaryAttrs: true,

SkipList: integration.CassandraSkippedTests,
},
Expand Down
1 change: 0 additions & 1 deletion cmd/jaeger/internal/integration/es_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ func TestESStorage(t *testing.T) {
StorageIntegration: integration.StorageIntegration{
CleanUp: purge,
Fixtures: integration.LoadAndParseQueryTestCases(t, "fixtures/queries_es.json"),
SkipBinaryAttrs: true,
GetOperationsMissingSpanKind: true,
},
}
Expand Down
3 changes: 0 additions & 3 deletions cmd/jaeger/internal/integration/grpc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ func TestGRPCStorage(t *testing.T) {
s := &GRPCStorageIntegration{
E2EStorageIntegration: E2EStorageIntegration{
ConfigFile: "../../config-remote-storage.yaml",
StorageIntegration: integration.StorageIntegration{
SkipBinaryAttrs: true,
},
},
}
s.CleanUp = s.cleanUp
Expand Down
1 change: 0 additions & 1 deletion cmd/jaeger/internal/integration/os_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ func TestOSStorage(t *testing.T) {
StorageIntegration: integration.StorageIntegration{
CleanUp: purge,
Fixtures: integration.LoadAndParseQueryTestCases(t, "fixtures/queries_es.json"),
SkipBinaryAttrs: true,
GetOperationsMissingSpanKind: true,
},
}
Expand Down
38 changes: 1 addition & 37 deletions plugin/storage/integration/integration.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,6 @@ type StorageIntegration struct {
// Skip Archive Test if not supported by the storage backend
SkipArchiveTest bool

// TODO: remove this after upstream issue in OTEL jaeger translator is fixed
// Skip testing trace binary tags, logs, and process
SkipBinaryAttrs bool

// List of tests which has to be skipped, it can be regex too.
SkipList []string

Expand Down Expand Up @@ -369,39 +365,7 @@ func (s *StorageIntegration) loadParseAndWriteLargeTrace(t *testing.T) *model.Tr

func (s *StorageIntegration) getTraceFixture(t *testing.T, fixture string) *model.Trace {
fileName := fmt.Sprintf("fixtures/traces/%s.json", fixture)
trace := getTraceFixtureExact(t, fileName)

if s.SkipBinaryAttrs {
t.Logf("Dropped binary type attributes from trace ID: %s", trace.Spans[0].TraceID.String())
trace = s.dropBinaryAttrs(t, trace)
}

return trace
}

func (s *StorageIntegration) dropBinaryAttrs(t *testing.T, trace *model.Trace) *model.Trace {
for _, span := range trace.Spans {
span.Tags = s.dropBinaryTags(t, span.Tags)
span.Process.Tags = s.dropBinaryTags(t, span.Process.Tags)

for i := range span.Logs {
span.Logs[i].Fields = s.dropBinaryTags(t, span.Logs[i].Fields)
}
}

return trace
}

func (s *StorageIntegration) dropBinaryTags(_ *testing.T, tags []model.KeyValue) []model.KeyValue {
newTags := make([]model.KeyValue, 0)
for _, tag := range tags {
if tag.VType == model.ValueType_BINARY {
continue
}
newTags = append(newTags, tag)
}

return newTags
return getTraceFixtureExact(t, fileName)
}

func getTraceFixtureExact(t *testing.T, fileName string) *model.Trace {
Expand Down
Loading