Jim Paris
83daeb148a
Add fsck scan for any data timestamps outside interval range
3 years ago
Jim Paris
71dc01c9a7
Replace deprecated numpy.fromstring usage
3 years ago
Jim Paris
bcd21b3498
Improve fsck test coverage to 100%
3 years ago
Jim Paris
99ac47cf0d
Start implementing fsck test and porting fsck to Python 3
3 years ago
Jim Paris
4cdaef51c1
Fix flake8-reported issues with fsck
3 years ago
Jim Paris
88466dcafe
Add yappi dependency for "nilmdb-server -y", but don't require ipython
3 years ago
Jim Paris
6cc1f6b7b2
Fix #! at top of shell scripts for py3 and venvs
3 years ago
Jim Paris
8dc36c2d37
Fix stream_insert_context docstring
This was never updated when timestamps were changed from floats to
ints.
3 years ago
Jim Paris
3738430103
Fix flake8 warnings
3 years ago
Jim Paris
a41111b045
Fix some Python 3.8 related issues
3 years ago
Jim Paris
85f822e1c4
Decode non-JSON HTTP responses when possible
This doesn't affect anything in nilmdb, but is needed by nilmrun.
3 years ago
Jim Paris
10400f2b07
rocket: suppress build warnings
3 years ago
Jim Paris
2f2faeeab7
Add pylint config and selectively fix some pylint errors
Some pylint errors are worth fixing; many are not.
4 years ago
Jim Paris
2ed544bd30
Fix flake8-reported code style issues
4 years ago
Jim Paris
b20bb92988
Improve test coverage and remove the last "#pragma: no cover"
We now have full coverage of the main code.
4 years ago
Jim Paris
699de7b11f
Change fast shutdown timeout to 0
This used to have problems with older CherryPy versions, but the
current one seems to handle it just fine.
4 years ago
Jim Paris
ea67e45be9
Clean up how we handle cherrypy's calls of os._exit(70)
With this solution, we can catch it cleanly in the standalone
nilmdb-server, and test the error paths in our normal test suite.
4 years ago
Jim Paris
ca440a42bd
Fix nilmdb-server argument parsing, logging, and profiling
It works again now.
4 years ago
Jim Paris
4ff4b263b4
Fill out code coverage for nilmdb/server/bulkdata.py
4 years ago
Jim Paris
79e544c733
Fix python2->3 conversion of pickle
4 years ago
Jim Paris
9acf99ff25
Fill out coverage for server/nilmdb.py and remove dead code
4 years ago
Jim Paris
4958a5ab2e
Improve test coverage
4 years ago
Jim Paris
1952f245c0
Try to clean up some issues with cherrypy startup and os._exit
This is hard and finicky to test, so there's unfortunately not a clear
way to get 100% test coverage in cherrypy_start. However, that
function is only used in the test suite and the standalone
nilmdb-server script, not in production (which goes through wsgi and
skips all this cherrypy server stuff entirely).
4 years ago
Jim Paris
7cbc0c11c3
Run cherrypy always in "embedded" mode
Non-embedded mode is not used in the test suite or wsgi server;
it was an option in the standalong nilmdb-server script, but it's
really not necessary, and removing it gets rid of some untested
code.
4 years ago
Jim Paris
9f2651c35e
Stop ignoring errors when disabling SIGPIPE
4 years ago
Jim Paris
9126980ed4
Add tests for bash completion; fix Unicode bug that turned up
Note that argcomplete is also now required.
4 years ago
Jim Paris
ea051c85b3
Improve test coverage for CORS_allow
4 years ago
Jim Paris
d8294469cf
Fix diskusage test coverage
4 years ago
Jim Paris
96eadb0577
Add test for WSGI server, and fix a str/bytes bug that it found
4 years ago
Jim Paris
19a34a07a4
Always use pyximport, since we now require cython.
This is optional and helps with development. If we ever need/want to
support systems without Cython, this can be wrapped in a
try/except:pass block (and the .c files can be included in the
MANIFEST.in so that source distributions include them).
4 years ago
Jim Paris
0b631b7dea
Use built-in json module rather than external simplejson
simplejson was there for python <= 2.6 compatibility.
It's not needed now, and installing it with pip can lead to segfaults
because pip is dumb.
(see e.g. https://github.com/simplejson/simplejson/issues/114 )
4 years ago
Jim Paris
f587518adb
Improve test coverage
4 years ago
Jim Paris
efbb2665fe
Improve test coverage
4 years ago
Jim Paris
544413018c
Add some thread safety tests
We don't actually use nilmdb.utils.threadsafety.verify_proxy in the
main NilmDB code, but it's useful for finding errors.
It found an issue with __getattr__ in SerializerProxy which
(1) can't be avoided?
(2) is now commented in the code
(3) shouldn't matter in real use
4 years ago
Jim Paris
322b0ec423
Remove impossible error in serializer and test with a C module
4 years ago
Jim Paris
f3833d9b20
Use pip fallocate package rather than hand-rolling
4 years ago
Jim Paris
caa5604d81
Improve code coverage
4 years ago
Jim Paris
6624e8dab6
Remove another "no cover"
4 years ago
Jim Paris
d907638858
Remove unnecessary check for private members in serializer
__getattr__ is only called for attributes that don't exist; callers
should never purposely see the private __* symbols, so we don't need
to check for them.
4 years ago
Jim Paris
ba915bb290
Use os.replace instead of os.remove; remove a "no cover"
4 years ago
Jim Paris
f93edc469c
Remove dummy lock functions from lock.py
4 years ago
Jim Paris
087fb39475
Add tests for two more "no cover" blocks
4 years ago
Jim Paris
8b4acf41d6
Test previously untested code
4 years ago
Jim Paris
5f9367bdd3
Remove old python 2 code
4 years ago
Jim Paris
cadba9fbba
Fix branch coverage
4 years ago
Jim Paris
640c1bc95e
No need to catch exceptions here; they shouldn't occur
4 years ago
Jim Paris
b574fc86f4
Mark branch as not taken in test suite
4 years ago
Jim Paris
c5c7f638e7
Allow NilmDB.close to be called twice
4 years ago
Jim Paris
a1218fd20b
Remove superfluous conditional
4 years ago
Jim Paris
79b410a85b
Remove conditional as we know these args are always present
4 years ago