Commit Graph

462 Commits

Author SHA1 Message Date
Thor77 7acae1e45b Catch KeyError from pickle.load
and log exception as warning instead of debug.
KeyError seems to occur in Python2 instead of an UnpicklingError
2018-03-31 20:59:45 +02:00
Thor77 c32ed0360f Catch UnpicklingError in Cache.read 2018-03-31 20:49:10 +02:00
Thor77 c6a8bea31e Add test for broken/invalid cachefile 2018-03-31 20:49:10 +02:00
Thor77 7e8f3b31bb Test parsing results are consistent
independent from using cache or not
2018-03-31 20:49:10 +02:00
Thor77 97425aa08d Sort imports 2018-03-31 20:49:10 +02:00
Thor77 9d9a7cf2b5 Add cached_files-property to Cache
to easily access store-keys without unwanted 'version'-key
2018-03-31 20:49:10 +02:00
Thor77 f6e3f9566b Fix parse_logs-run not returning server with cache
because the filter-object will get evaluated (and is empty afterwards)
when caching it.
To fix this, it's now evaluated onece (converting it into a list) and
the resulting list can be accessed multiple times without "destroying"
it.
2018-03-31 20:49:10 +02:00
Thor77 af608f175f Make sure each test gets its own cache
by appending testfunction-name to cache_path
2018-03-31 20:49:10 +02:00
Thor77 ab99c5f64c Rewrite test integration test
to assert two runs with the same cache_path return the same servers
(after writing and reading from cache).
2018-03-31 20:49:10 +02:00
Thor77 9c2daf630c Remove unused mocker-fixture argument 2018-03-31 20:49:10 +02:00
Thor77 0f0386f14a Rewrite needs_parsing-test
it now copies the testlog to a tmpfile first and adds a line
to check if Cache.needs_parsing is working correctly
2018-03-31 20:49:10 +02:00
Thor77 ff22ed86f2 Exclude version-key from iter and len 2018-03-31 20:49:10 +02:00
Thor77 7b3ecb039b Add funcdocs to Cache-class and methods 2018-03-31 20:49:10 +02:00
Thor77 74444edd55 Add cache cli- and config-option
* --disablecache (config: cache, True by default)
* --cachepath (config: cachepath, $XDG_CACHE_HOME or $HOME|/tmp
by default)
2018-03-31 20:49:10 +02:00
Thor77 662a359c4f Add version to Cache to avoid unneeded writes
as calls to Pickle.dump are rather expensive
2018-03-31 20:49:10 +02:00
Thor77 4c2a51bc5a Fix cache not written without data 2018-03-31 20:49:10 +02:00
Thor77 40d851e9d7 Add tests for tsstats.cache.Cache 2018-03-31 20:49:10 +02:00
Thor77 189b122844 Add (pytest-)mock requirement for cache-tests 2018-03-31 20:49:10 +02:00
Thor77 534eeae53b Add cache-functionality to tsstats.log.parse_logs 2018-03-31 20:49:10 +02:00
Thor77 a10a93c7db Add tsstats.cache.Cache 2018-03-31 20:49:10 +02:00
Thor77 77fb3128a9 Add Client.__eq__ required for cache-tests 2018-03-31 20:49:10 +02:00
Thor77 5d9507deb0 Add Pipfile 2018-03-02 23:59:21 +01:00
Thor77 ae13390b7b Use pylama for stylechecks 2018-02-01 21:49:02 +01:00
Thor77 5ea2f6ab3d Remove extra lines after encoding header 2018-02-01 20:49:23 +01:00
Thor77 489d609807 Add pytests .cache to .gitignore 2018-02-01 17:02:56 +01:00
Thor77 56471137c0 Limit build status on AppVeyor to master-branch 2018-01-30 19:14:51 +01:00
Thor77 4310f93adc Bump version to 2.0.0 2018-01-19 22:28:28 +01:00
Thor77 ab68f57f83 Use timestamp for relative timestamp human test 2018-01-10 20:33:52 +01:00
Thor77 7fd4297c4d Adapt tests to Clients.__iter__ returning keys 2017-09-25 23:21:12 +02:00
Thor77 8d1c19a734 Adapt log.parse_logs and utils.sort_clients
to Clients.__iter__ return keys instead of values
2017-09-25 23:21:06 +02:00
Thor77 2ebd445349 Clients.__iter__ return keys instead of values
as desired by MutableMapping.__iter__
2017-09-25 23:14:26 +02:00
Thor77 c9ab6f6b97 Add encoding-header to missing files 2017-09-16 22:31:15 +02:00
Thor77 c8092018f2 Revert "Sort imports"
because the sorting-order is dependent on installed packages

This reverts commit 51191672c6.
2017-09-16 22:03:55 +02:00
Thor77 51191672c6 Sort imports 2017-09-16 21:59:44 +02:00
Thor77 871210dde4 Add test for tsstats.log._parse_line 2017-09-15 11:35:21 +02:00
Thor77 1e1f112867 Add funcdoc to tsstats.log._parse_line 2017-09-15 10:51:29 +02:00
Thor77 a9e8cd0b6e Revert "Add test for Clients.__str__"
This reverts commit b9f798d04d.
2017-09-14 23:37:10 +02:00
Thor77 8558d731d4 Add test for render_servers.lastseen_relative 2017-09-14 23:09:50 +02:00
Thor77 f786c87dfb Add test for Client.__repr__ 2017-09-14 22:39:12 +02:00
Thor77 52f5cc3ac1 Add test for invalid log line 2017-09-14 22:37:56 +02:00
Thor77 b9f798d04d Add test for Clients.__str__ 2017-09-14 22:37:32 +02:00
Thor77 6345c3f1f5 Remove test for serverstop with connected clients
because it is non-trivial to implement with the new architecture and
probably not worth the effort, because it basically can't happen.
A warning/exception should be added instead.
2017-09-10 00:15:21 +02:00
Thor77 b1b80f657a Use parse_logs instead of _parse_details 2017-09-10 00:04:11 +02:00
Thor77 cbc76b5541 Add missing identmap-lookup for new clients 2017-09-09 18:44:41 +02:00
Thor77 1c224fa0ee Use parse_logs instead of _parse_details 2017-09-09 18:36:43 +02:00
Thor77 c79dd08bc0 Don't accept infinite arguments
leftover from old parse_logs-func
2017-09-09 18:04:56 +02:00
Thor77 147c41ffce Use parse_logs instead of _parse_details
because _parse_details is not available anymore
2017-09-09 17:35:55 +02:00
Thor77 df268f1c2a Add return and rtype to parse_logs-funcdoc 2017-09-08 15:39:39 +02:00
Thor77 602e6c4d51 Log start/end of parsing logfile 2017-09-08 15:39:39 +02:00
Thor77 91a9b8e4c7 Implement online_dc again 2017-09-08 15:39:39 +02:00