MiniSync icon indicating copy to clipboard operation
MiniSync copied to clipboard

How to test?

Open jlhonora opened this issue 10 years ago • 1 comments

Hi Blake,

I've always wondered what's the best approach for testing SyncAdapters. Do you have any ideas on this? Since this project is mostly educational I thought it would be a not-so-bad place to ask.

No one seems to have a clue:

https://groups.google.com/forum/#!topic/android-developers/KsLyp9ryK4A http://stackoverflow.com/questions/19926360/android-testing-syncadapter http://stackoverflow.com/questions/24748536/how-to-test-sync-adapter-running

And considering the last issue we discussed, I began considering testing alternatives such as:

  1. Moving the SyncAdapter's logic to a separate library and test the methods with unit tests. Problem: doesn't test the SyncAdapter's lifecycle
  2. Fire up a test runner, make it wait and then check if things change, such as DB entries, etc. Problem: too much stuff happening behind the curtains, probably flaky

It would be great to have your input on this. Sorry if it's beyond the scope of the repo. Thanks in advance!

jlhonora avatar Jan 21 '16 14:01 jlhonora

Great topic. Ping me at Blake dot Meike on Google's mail system. Happy to discuss. On Jan 21, 2016 6:45 AM, "Jose Luis Honorato" [email protected] wrote:

Hi Blake,

I've always wondered what's the best approach for testing SyncAdapters. Do you have any ideas on this? Since this project is mostly educational I thought it would be a not-so-bad place to ask.

No one seems to have a clue:

https://groups.google.com/forum/#!topic/android-developers/KsLyp9ryK4A http://stackoverflow.com/questions/19926360/android-testing-syncadapter

http://stackoverflow.com/questions/24748536/how-to-test-sync-adapter-running

And considering the last issue we discussed, I began considering testing alternatives such as:

  1. Moving the SyncAdapter's logic to a separate library and test the methods with unit tests. Problem: doesn't test the SyncAdapter's lifecycle
  2. Fire up a test runner, make it wait and then check if things change, such as DB entries, etc. Problem: too much stuff happening behind the curtains, probably flaky

It would be great to have your input on this. Sorry if it's beyond the scope of the repo. Thanks in advance!

— Reply to this email directly or view it on GitHub https://github.com/bmeike/MiniSync/issues/2.

bmeike avatar Jan 21 '16 14:01 bmeike