rhtools / vminfo-parser

3 stars 4 forks source link

refactor(main): refactor analyzer environment filtering, os counting, and disk space counting #75

Closed csfreak closed 1 week ago

csfreak commented 2 weeks ago

This is rebased from the original PR, with several major changes pulled out, and already merged to dev.

The three changes in this PR are intricately linked, and splitting them would be a lot of effort.

Environment filtering has been moved to vmdata.

Iterating over unique OSes has been separated to an analyzer method, which also checks and handles os_name filters. This function takes a callable to execute for each function.

diskspace and os counting are refactored to use the above changes

github-actions[bot] commented 2 weeks ago

Coverage

Coverage Report
FileStmtsMissCoverMissing
__init__.py40100% 
__main__.py84495%57–58, 60, 131
_version.py50100% 
analyzer.py1793282%30, 32–33, 35–36, 41–43, 99–100, 103–104, 106, 150, 156, 162, 225–226, 343, 345–347, 365, 382, 391, 394–396, 399, 415–416, 442
clioutput.py89693%45, 59, 72, 151–152, 154
config.py102694%144, 170, 201, 213, 217, 228
const.py110100% 
visualizer.py1181587%54–57, 68–70, 184, 189, 217–220, 222–223
vmdata.py100892%77–78, 138, 149–150, 155–156, 186
TOTAL6927189% 

Tests Skipped Failures Errors Time
207 0 :zzz: 0 :x: 0 :fire: 2m 53s :stopwatch:
github-actions[bot] commented 2 weeks ago

Coverage

Test Report - unit
FileStmtsMissCoverMissing
__init__.py40100% 
__main__.py820100% 
_version.py50100% 
analyzer.py17915413%24–27, 30, 32–33, 35–36, 41–43, 65, 90, 93–96, 99–100, 103–106, 110–118, 120, 122, 148, 150–151, 154–156, 158, 161–167, 169, 173–174, 176, 195–197, 199–201, 203, 205–207, 209, 212–213, 216–218, 220–221, 223, 225–226, 242, 244, 249, 252, 255, 258–259, 262, 264–265, 268–271, 273, 279, 282, 287, 289, 291, 304, 308–309, 311–312, 318–320, 322, 337, 342–348, 360, 364–365, 367, 381–382, 384–385, 387–389, 391, 394–396, 399, 401, 404, 407–408, 412, 414–416, 418–419, 421, 424, 426, 428–431, 433, 436–439, 441–442, 444, 453–454
clioutput.py891385%33–36, 45, 59, 66–68, 72, 151–152, 154
config.py102892%144, 170, 201, 213, 217, 228, 246, 250
const.py110100% 
visualizer.py1181587%54–57, 68–70, 184, 189, 217–220, 222–223
vmdata.py1002278%77–78, 138, 149–150, 155–156, 179–180, 184–185, 187, 190, 203–204, 206–207, 210–213, 215
TOTAL69021269% 

Tests Skipped Failures Errors Time
202 0 :zzz: 0 :x: 0 :fire: 16.182s :stopwatch:
github-actions[bot] commented 2 weeks ago

Coverage

Test Report - e2e
FileStmtsMissCoverMissing
__init__.py40100% 
__main__.py821680%29, 46, 68, 89–90, 92, 109, 135–136, 138, 150–151, 157–158, 165, 171
_version.py50100% 
analyzer.py1793282%30, 32–33, 35–36, 41–43, 99–100, 103–104, 106, 150, 156, 162, 225–226, 343, 345–347, 365, 382, 391, 394–396, 399, 415–416, 442
clioutput.py892967%31, 45, 47, 59, 61, 72, 134–152, 154–155, 176–177
config.py1024258%133–135, 141, 144, 159, 165–167, 170, 179–181, 183–187, 189–190, 192–197, 201, 209–210, 213, 217, 227–234, 236, 239–240
const.py110100% 
visualizer.py1188329%48–52, 54–57, 59–65, 68–70, 90, 92–94, 98–99, 102–104, 106, 120, 122–124, 139, 141, 144–146, 158–159, 165, 179, 181–182, 184, 186–187, 189, 191–194, 196–197, 217–220, 222–223, 238–240, 243, 245–250, 252–255, 257–260, 262–263, 276–278
vmdata.py1002773%41, 45–46, 68, 77–78, 117, 134–135, 137–138, 141–144, 146, 149–151, 154–156, 159–160, 163, 165, 204
TOTAL69022966% 

Tests Skipped Failures Errors Time
13 0 :zzz: 0 :x: 0 :fire: 1m 33s :stopwatch:
csfreak commented 1 week ago

Ideally I think we should have doc strings for functions we touch. I'd like to see that in addition to my other comment about the df being declared and not used

I have added docstrings to most functions I have touched. Functions in analyzer that are getting more TLC and tests in #82 have been left to include in that PR