You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @gnarea, another task that landed on my lap :)
So before I start I wanted to check with you, if I understand what you want ... solutions to better test the reasons collectParcels might/is failing... correct?
Assuming that I understood correctly, you started suggesting
"log" exceptions and test said log data
I would like to give a couple of other suggestions that I think might work as well, might be simpler to implement and more useful in the future:
Delegate and move the collectParcles to another class and make that class internal, having better access to test potential scenarios.
Optional callback system that we can use to intercept exceptions
So before I start I wanted to check with you, if I understand what you want ... solutions to better test the reasons collectParcels might/is failing... correct?
Yes. The current assertions are insufficient to tell the tests are passing for the right reasons.
BTW, I recently integrated log captor, a library to capture logs in tests.
Fixes#49@gnarea Notice the failing test. Feels weird that deleting the ThirdPartyEndpoint is not enough, since it triggers another error. Are we forgetting to delete something inside the `delete()` method?
I think we should improve the tests for the following because it's far too easy to write tests that fail for the wrong reason:
https://github.com/relaycorp/relaynet-endpoint-android/blob/95a47a627f31fc4d5715b029ea7e342839b7e6d3/lib/src/main/java/tech/relaycorp/relaydroid/messaging/ReceiveMessages.kt#L68-L91
Maybe we should inspect the logs?
For example, the current implementation has a bug which the tests aren't uncovering: There are two catch blocks for the same exception:
https://github.com/relaycorp/relaynet-endpoint-android/blob/95a47a627f31fc4d5715b029ea7e342839b7e6d3/lib/src/main/java/tech/relaycorp/relaydroid/messaging/ReceiveMessages.kt#L82-L86
I came across this whilst implementing #48, because my tests were passing before I changed the unit under test.
The text was updated successfully, but these errors were encountered: