You've already forked opentelemetry-go
mirror of
https://github.com/open-telemetry/opentelemetry-go.git
synced 2025-11-27 22:49:15 +02:00
Fixes https://github.com/open-telemetry/opentelemetry-go/issues/6487 Fixes https://github.com/open-telemetry/opentelemetry-go/issues/6488 Towards https://github.com/open-telemetry/opentelemetry-go/issues/6341 Prior-art: https://github.com/open-telemetry/opentelemetry-go/pull/6464 Replace `AssertRecordEqual` with `AssertEqual` which accepts options and can work not only with `Record` but most importantly, whole `Recording`. The changes between the previous approach are inspired by the design of https://pkg.go.dev/go.opentelemetry.io/otel/sdk/metric/metricdata/metricdatatest. Thanks to it we continue to use the "assert" pattern, but are not impacted by downsides of `testify`. The main issue is that with `testify` we cannot force `[]log.KeyValue` to sort slices before comparing (unordered collection equality). This can make the tests too much "white-boxed" and can easy break during refactoring. Moreover, empty and nil slices are seen not equal which in this case is not relevant. Here is an example of how the current tests of log bridges can be improved: - https://github.com/open-telemetry/opentelemetry-go-contrib/pull/6953