android-library icon indicating copy to clipboard operation
android-library copied to clipboard

Should tests succeed if connection times out?

Open LukeOwlclaw opened this issue 9 years ago • 3 comments

I just tried CreateFolderTest. It succeeded. I noticed that several connection times outs occurred before I noticed that my connection was blocked.

I looks like timeouts are "accept" on purpose:

https://github.com/owncloud/android-library/blob/develop/test_client/tests/src/com/owncloud/android/lib/test_project/test/RemoteTest.java#L54

https://github.com/owncloud/android-library/blob/develop/test_client/tests/src/com/owncloud/android/lib/test_project/test/CreateFolderTest.java#L71

I do not understand the reasoning here. IMO, the tests require a working connection to the server, otherwise functionality cannot be tested. So if the connection breaks, the test should fail.

LukeOwlclaw avatar Jun 23 '15 14:06 LukeOwlclaw

That was done that way to avoid blocking merges due to problems in server side, since the tests should test the client library. But yes, it was cheating.

Even better would be that the tests did not use a real server, but some kind of network mock-up. But that's so out of our scope right now...

Feel free to update the tests as you suggest.

davivel avatar Jun 24 '15 07:06 davivel

Are tests performed automatically before merging? And is merging prevented if tests fail? That sounds like a good idea, but also quite complex!

LukeOwlclaw avatar Jun 24 '15 12:06 LukeOwlclaw

Yes, they are done before merging. The prevention is manual - Github reports in the bottom of the PRs if Travis tests was passed. In the case of the library, the Travis tests iinclude the tests in test_project/test

davivel avatar Jun 25 '15 14:06 davivel

Outdated, closing here 🚀

JuancaG05 avatar May 30 '23 15:05 JuancaG05