anki-sync-server icon indicating copy to clipboard operation
anki-sync-server copied to clipboard

Add helper classes for integration tests, refactor user managers and ankiserverctl.py

Open cdpm opened this issue 9 years ago • 7 comments

Add test helper classes for creating and managing temporary files, working with anki collections and sqlite dbs. Add class for managing users so users can be added programmatically without using ankiserverctl.

cdpm avatar Feb 05 '16 22:02 cdpm

This doesn't change any existing code to use these classes. Is that intentional (ie. these are meant to be completely seperate)? Or is that coming as a next step?

It's definitely easier to review if they are meant to be completely seperate, because it doesn't change anything, I can just merge it. :-) But if later code is going to be changed to use these classes, I'd prefer to review the addition of the new classes at the same time as the changes to the existing code.

Thanks!

dsnopek avatar Feb 15 '16 12:02 dsnopek

I wrote some integration tests for SyncApp using WebTest that depend on the new test helpers but don't change existing code. I'll hopefully be able to review and commit them in this pull request in about a week.

cdpm avatar Feb 21 '16 20:02 cdpm

Made a second commit a few weeks ago with the integration test code. In the future It might be useful to refactor ankiserverctl to use UserManager to avoid duplicate logic for managing users, but there are no direct changes to existing code right now.

cdpm avatar May 07 '16 21:05 cdpm

Thanks! I still think it'd be nice to have the changes to the existing code in the same PR, because it would be easier for me to review.

dsnopek avatar May 16 '16 12:05 dsnopek

Committed changes to existing code.

cdpm avatar Jul 05 '16 08:07 cdpm

I've added a Travis CI configuration to the master branch. Please merge from master into your PR, and make any changes necessary to get the tests passing on Travis. Thanks!

dsnopek avatar Aug 05 '16 04:08 dsnopek

Thanks! The tests are failing because the 'sqldiff' command is unavailable, but the tests that don't depend on that appear to be working

dsnopek avatar Aug 08 '16 13:08 dsnopek