dd-sdk-android icon indicating copy to clipboard operation
dd-sdk-android copied to clipboard

Some tests always pass due to wrong assertion

Open hamorillo opened this issue 2 months ago • 1 comments

Some test files have an assertion like:

Assertions.assertThat(result).isEqualTo(result)

This will always be true, so all the tests will pass.

It's easy to find them; search for the previous line of code, but here they are.

Test Files

https://github.com/DataDog/dd-sdk-android/blob/4e9b85d3eb758039992241d677d49f848973b1fb/features/dd-sdk-android-rum/src/test/kotlin/com/datadog/android/rum/model/ActionEventTest.kt#L39

https://github.com/DataDog/dd-sdk-android/blob/4e9b85d3eb758039992241d677d49f848973b1fb/features/dd-sdk-android-rum/src/test/kotlin/com/datadog/android/rum/model/ErrorEventTest.kt#L39

https://github.com/DataDog/dd-sdk-android/blob/4e9b85d3eb758039992241d677d49f848973b1fb/features/dd-sdk-android-rum/src/test/kotlin/com/datadog/android/rum/model/LongTaskEventTest.kt#L39

https://github.com/DataDog/dd-sdk-android/blob/4e9b85d3eb758039992241d677d49f848973b1fb/features/dd-sdk-android-rum/src/test/kotlin/com/datadog/android/rum/model/ResourceEventTest.kt#L39

https://github.com/DataDog/dd-sdk-android/blob/4e9b85d3eb758039992241d677d49f848973b1fb/features/dd-sdk-android-rum/src/test/kotlin/com/datadog/android/rum/model/ViewEventTest.kt#L39

https://github.com/DataDog/dd-sdk-android/blob/4e9b85d3eb758039992241d677d49f848973b1fb/dd-sdk-android-core/src/test/kotlin/com/datadog/android/api/context/NetworkInfoTest.kt#L39

https://github.com/DataDog/dd-sdk-android/blob/4e9b85d3eb758039992241d677d49f848973b1fb/dd-sdk-android-core/src/test/kotlin/com/datadog/android/api/context/UserInfoTest.kt#L39

https://github.com/DataDog/dd-sdk-android/blob/4e9b85d3eb758039992241d677d49f848973b1fb/features/dd-sdk-android-rum/src/test/kotlin/com/datadog/android/telemetry/model/TelemetryDebugEventTest.kt#L39

https://github.com/DataDog/dd-sdk-android/blob/4e9b85d3eb758039992241d677d49f848973b1fb/features/dd-sdk-android-rum/src/test/kotlin/com/datadog/android/telemetry/model/TelemetryErrorEventTest.kt#L39

I've tried to fix the assertion so:

Assertions.assertThat(result).isEqualTo(event)

However, all the tests fail (except NetworkInfoTest). Although I didn't have much time, I think it's likely due to the serialization of map variables, such as Map<String, Any?> = emptyMap().

hamorillo avatar Nov 04 '25 20:11 hamorillo

hi @hamorillo, thank you for bringing this to our attention. We'll look into it and see what can be done

jonathanmos avatar Nov 05 '25 12:11 jonathanmos