Commit Graph

6651 Commits

Author SHA1 Message Date
meejah
e6104cd1a2 Replace _lazy_tail with iterative loop, cleanup tests (#2412)
* uses @inlineCallbacks to turn the _lazy_tail recursion into
   a "real" looking loop;
 * remove the need for "immediate" vs delayed iteration of said loop;
 * make it easier for the unit-tests to control the behavior of the
   uploader/downloader;
 * consolidates (some) setup/teardown code into the setUp and tearDown
   hooks provided by unittest so unit-tests aren't doing that themselves
 * re-factors some of the unit-tests to use an @inlineCallbacks style
   so they're easier to follow and debug

This doesn't tackle the "how to know when our inotify events have arrived"
problem the unit-tests still have, nor does it eliminate the myriad bits
of state that get added to tests via all the MixIns.
2016-07-21 12:35:59 -07:00
Daira Hopwood
e03e243c67 Expand test for Magic Folder statistics. 2016-07-21 12:35:59 -07:00
Daira Hopwood
37d22efaea Improve test for Magic Folder statistics and move it from test_system.py to test_magic_folder.py. 2016-07-21 12:35:59 -07:00
Daira Hopwood
dd0597f869 Work in progress to fix incorrect statistics output for Magic Folder. refs ticket:2709 2016-07-21 12:35:59 -07:00
Daira Hopwood
e3dfc8f3f4 Fix test_magic_folder.py to use absolute unicode paths when calling write_downloaded_file. 2016-07-21 12:35:59 -07:00
David Stainton
d2ae4255c8 Add daira's implementation of make_dirs_with_absolute_mode 2016-07-21 12:35:59 -07:00
David Stainton
2963e9e50c Use os.path.dirname instead of split and rename var to initial_path_u 2016-07-21 12:35:59 -07:00
David Stainton
cd390b90e4 remove superfluous trailing comma from make_dirs_with_absolute_mode def 2016-07-21 12:35:59 -07:00
David Stainton
ba35d7262b Add unit test and make corrections to make_dirs_with_absolute_mode 2016-07-21 12:35:59 -07:00
David Stainton
ee44732d03 Break out our chmod while loop into fielutils.py 2016-07-21 12:35:59 -07:00
David Stainton
51ccec7a33 Use chmod instead of changing umask
Conflicts:
	src/allmydata/frontends/magic_folder.py
2016-07-21 12:35:59 -07:00
David Stainton
3d909682a4 Add comment about FUDGE_SECONDS and refer to our design doc 2016-07-21 12:35:59 -07:00
Daira Hopwood
807cfbf0dc Fix pyflakes warnings.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
meejah
9cfcb1b3aa remove humanize, use internal method, teach internal method to understand timedelta 2016-07-21 12:35:59 -07:00
meejah
573a5481d1 add Bob leaving to smoke-tests 2016-07-21 12:35:59 -07:00
meejah
c217d1f8f3 fix return-valid of leave 2016-07-21 12:35:59 -07:00
meejah
bf3bf70814 add docstrings 2016-07-21 12:35:59 -07:00
meejah
8ba2912ff4 make history longer 2016-07-21 12:35:59 -07:00
meejah
7e84b0cf57 flesh out IQueuedItem 2016-07-21 12:35:59 -07:00
meejah
05ec62c4b1 humanize doesn't report a proper version 2016-07-21 12:35:59 -07:00
meejah
5ed24913d2 add humanize dependency 2016-07-21 12:35:59 -07:00
meejah
658470ba6e Add some magicfolder database tests 2016-07-21 12:35:59 -07:00
meejah
2573cf18ef Add simple auth-token to get JSON data 2016-07-21 12:35:59 -07:00
meejah
86abe56d91 Flesh out "tahoe magic-folder status" command
Adds:

 - a JSON endpoint
 - CLI to display information
 - QueuedItem + IQueuedItem for uploader/downloader
 - IProgress interface + PercentProgress implementation
 - progress= args to many upload/download APIs
2016-07-21 12:35:59 -07:00
David Stainton
3df0a82a38 Add cli stub for magic-folder status command 2016-07-21 12:35:59 -07:00
David Stainton
af10ab43ee Daira's fix during session with David and Meejah. 2016-07-21 12:35:59 -07:00
David Stainton
71e3164e92 Further work in progress refinements to unit tests
wip from pairing with Daira and Meejah
2016-07-21 12:35:59 -07:00
David Stainton
9483d24f67 Fix cleanup after test_periodic_full_scan. 2016-07-21 12:35:59 -07:00
David Stainton
38dd49ee5a Add logging for Downloader.stop. 2016-07-21 12:35:59 -07:00
David Stainton
2dabd8a10b Work in progress on fixing test_periodic_full_scan. 2016-07-21 12:35:59 -07:00
David Stainton
b4153659d3 Minor cleanup and logging fix. 2016-07-21 12:35:59 -07:00
David Stainton
5380ff8f5a Clean up queue loging and add a clock advance in unit test
not yet working
2016-07-21 12:35:59 -07:00
David Stainton
e1822c0518 WIP 2016-07-21 12:35:59 -07:00
David Stainton
96b846f762 Add ignore pending argument to _periodic_full_scan 2016-07-21 12:35:59 -07:00
David Stainton
cf462d8b1f Attempt to test periodic uploader full scan 2016-07-21 12:35:59 -07:00
David Stainton
a5163c32cc Only perform full scan if pending set is empty 2016-07-21 12:35:59 -07:00
David Stainton
e9e74c43e1 Naive periodic full scan 2016-07-21 12:35:59 -07:00
David Stainton
9b4b43cf19 Fix uploader's _process to extend queue after scan and count stats properly 2016-07-21 12:35:59 -07:00
David Stainton
d2971fbabe Daira's excellent fixes to the uploader from our pairing session 2016-07-21 12:35:59 -07:00
David Stainton
70f66677be Teach uploader's _scan to use the deque 2016-07-21 12:35:59 -07:00
Daira Hopwood
072d252245 Add multi-party-conflict-detection.rst.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
David Stainton
6b32841b10 Remove UNIQUE constraint from magicfolder db schema 2016-07-21 12:35:59 -07:00
Daira Hopwood
a7c50b104e Documentation for Magic Folder.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
9c9a4e7aa2 Add get_pathinfo.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
Daira Hopwood
278762200d Teach magic-folder join to use configutil.
Author: David Stainton <david@leastauthority.com>
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
David Stainton
cc721505e7 Add magic-folder test_scan_once_on_startup 2016-07-21 12:35:59 -07:00
Daira Hopwood
cb6291e93c Various test cleanups.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-21 12:35:59 -07:00
David Stainton
3074b687be Teach join twice test to test for proper stdout and stderr values 2016-07-21 12:35:59 -07:00
David Stainton
74ad656e39 More thorough checks to the join leave join test 2016-07-21 12:35:59 -07:00
David Stainton
966c556562 Fix test_join_leave_join 2016-07-21 12:35:59 -07:00