turbinia
turbinia copied to clipboard
Increase test coverage to >=80%
What tests are you referring to? Unit tests?
Yeah, general unit tests in this case. FWIW, I just checked, and the existing coverage is 26%.
$ coverage run --source turbinia/ run_tests.py
[... snip test output]
$ coverage report -m
Name Stmts Miss Cover Missing
turbinia/init.py 4 0 100% turbinia/config/init.py 40 1 98% 79 turbinia/config/logger.py 32 32 0% 15-73 turbinia/config/turbinia_config.py 18 18 0% 16-66 turbinia/evidence.py 98 34 65% 55-56, 107, 125-128, 139, 148, 192-196, 216-220, 223, 226, 243-244, 247-249, 252-253, 265-267, 275-276, 284-286 turbinia/jobs/init.py 20 20 0% 17-66 turbinia/jobs/be.py 17 17 0% 15-60 turbinia/jobs/plaso.py 15 15 0% 15-45 turbinia/jobs/psort.py 12 12 0% 15-42 turbinia/jobs/worker_stat.py 13 13 0% 15-43 turbinia/lib/init.py 0 0 100% turbinia/lib/google_cloud.py 118 78 34% 54-55, 67-68, 86-103, 111, 124, 132-143, 158-165, 184-185, 193, 210-233, 253-256, 267-271, 279, 293, 301-303, 314, 324-343, 351-358, 372, 380-382 turbinia/output_manager.py 77 31 60% 43-54, 85, 96, 118-123, 154-164, 169, 172-178 turbinia/processors/init.py 0 0 100% turbinia/processors/google_cloud.py 68 50 26% 46-49, 58-68, 77-103, 112-137 turbinia/processors/mount_local.py 42 32 24% 33-63, 73-88 turbinia/pubsub.py 78 9 88% 64-68, 114-119, 184 turbinia/state_manager.py 60 60 0% 15-145 turbinia/task_manager.py 139 139 0% 15-324 turbinia/workers/init.py 155 155 0% 15-396 turbinia/workers/be.py 51 51 0% 15-123 turbinia/workers/plaso.py 17 17 0% 15-56 turbinia/workers/psort.py 16 16 0% 15-52 turbinia/workers/worker_stat.py 14 14 0% 15-49
TOTAL 1104 814 26%
Coverage has gotten better over time, but should still be higher (not sure what a good target number is). Currently have 54% coverage.
Name Stmts Miss Cover
---------------------------------------------------------
turbinia/__init__.py 4 0 100%
turbinia/celery.py 55 20 64%
turbinia/client.py 144 71 51%
turbinia/config/__init__.py 40 0 100%
turbinia/config/logger.py 32 5 84%
turbinia/evidence.py 109 18 83%
turbinia/jobs/__init__.py 16 1 94%
turbinia/jobs/grep.py 15 2 87%
turbinia/jobs/plaso.py 15 1 93%
turbinia/jobs/psort.py 12 1 92%
turbinia/jobs/strings.py 17 3 82%
turbinia/jobs/worker_stat.py 13 1 92%
turbinia/lib/__init__.py 0 0 100%
turbinia/lib/google_cloud.py 117 74 37%
turbinia/lib/libcloudforensics.py 210 161 23%
turbinia/message.py 49 6 88%
turbinia/output_manager.py 136 72 47%
turbinia/processors/__init__.py 0 0 100%
turbinia/processors/google_cloud.py 66 50 24%
turbinia/processors/mount_local.py 42 32 24%
turbinia/pubsub.py 65 27 58%
turbinia/state_manager.py 125 61 51%
turbinia/task_manager.py 192 135 30%
turbinia/workers/__init__.py 201 15 93%
turbinia/workers/grep.py 23 15 35%
turbinia/workers/plaso.py 21 13 38%
turbinia/workers/psort.py 20 12 40%
turbinia/workers/strings.py 25 16 36%
turbinia/workers/worker_stat.py 14 8 43%
---------------------------------------------------------
TOTAL 1778 820 54%
----------------------------------------------------------------------
Ran 42 tests in 0.653s
Please add celery to the dependencies for testing (see https://github.com/google/turbinia/issues/236)
FWIW, coverage is now a little over 60%, but I'd like it to be at 80% before closing this.
Currently at 69% coverage...