Changeset 86953 in vbox for trunk/src/VBox/ValidationKit/testmanager/cgi
- Timestamp:
- Nov 23, 2020 10:31:51 AM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 141473
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/testmanager/cgi/status.py
r86951 r86953 34 34 import os 35 35 import sys 36 import datetime37 36 38 37 # Only the main script needs to modify the path. … … 92 91 93 92 94 def find_test_duration(created): 95 now = datetime.datetime.utcnow().replace(tzinfo=datetime.timezone.utc) 96 diff = now - created 97 days, seconds = diff.days, diff.seconds 98 hours = days * 24 + seconds // 3600 99 return hours 93 def timeDeltaToHours(oTimeDelta): 94 return oTimeDelta.days * 24 + oTimeDelta.seconds // 3600 100 95 101 96 … … 108 103 testbox_name = line[0] 109 104 test_result = line[1] 110 test_created = line[2]105 oTimeDeltaSinceStarted = line[2] 111 106 test_box_os = line[3] 112 107 test_sched_group = line[4] … … 122 117 123 118 if test_result == "running": 124 testboxes_dict[testbox_name].update({"hours_running": find_test_duration(test_created)})119 testboxes_dict[testbox_name].update({"hours_running": timeDeltaToHours(oTimeDeltaSinceStarted)}) 125 120 126 121 return testboxes_dict; … … 136 131 elif testbox_os == "solaris": 137 132 dict_update(vb_dict, test_name + " / solaris", test_result) 138 #else:139 #dict_update(vb_dict, test_name + " / other", test_result)133 else: 134 dict_update(vb_dict, test_name + " / other", test_result) 140 135 141 136 … … 330 325 #SELECT TestBoxesWithStrings.sName, 331 326 # TestSets.enmStatus, 332 # TestSets.tsCreated,327 # CURRENT_TIME - TestSets.tsCreated, 333 328 # TestBoxesWithStrings.sOS, 334 329 # SchedGroupNames.sSchedGroupNames … … 353 348 ( SELECT TestBoxesWithStrings.sName, 354 349 TestSets.enmStatus, 355 TestSets.tsCreated,350 CURRENT_TIME - TestSets.tsCreated, 356 351 TestBoxesWithStrings.sOS, 357 352 SchedGroupNames.sSchedGroupNames … … 376 371 SELECT TestBoxesWithStrings.sName, 377 372 TestSets.enmStatus, 378 TestSets.tsCreated,373 CURRENT_TIME - TestSets.tsCreated, 379 374 TestBoxesWithStrings.sOS, 380 375 SchedGroupNames.sSchedGroupNames
Note:
See TracChangeset
for help on using the changeset viewer.