@@ -312,6 +312,25 @@ def cluster_creation_error_analysis(spylink):
312
312
except requests .RequestException :
313
313
return "Error while sending request to url"
314
314
315
+ #This is a temporary fix to check node details for older jobs.
316
+ def check_if_gather_libvirt_dir_exists (spy_link ,job_type ):
317
+
318
+ base_artifacts_dir_url = PROW_VIEW_URL + spy_link [8 :] + "/artifacts/" + job_type
319
+
320
+ try :
321
+ response = requests .get (base_artifacts_dir_url , verify = False , timeout = 15 )
322
+ gather_libvirt_dir_re = re .compile ('gather-libvirt' )
323
+ gather_libvirt_dir_re_match = gather_libvirt_dir_re .search (response .text , re .MULTILINE | re .DOTALL )
324
+
325
+ if gather_libvirt_dir_re_match is not None :
326
+ return True
327
+ else :
328
+ return False
329
+ except requests .Timeout :
330
+ return "Request timed out"
331
+ except requests .RequestException :
332
+ return "Error while sending request to url"
333
+
315
334
def get_node_status (spy_link ):
316
335
317
336
'''
@@ -325,7 +344,13 @@ def get_node_status(spy_link):
325
344
'''
326
345
327
346
job_type ,job_platform = job_classifier (spy_link )
328
- job_type += "/gather-extra"
347
+
348
+ check_for_gather_libvirt_dir = check_if_gather_libvirt_dir_exists (spy_link ,job_type )
349
+
350
+ if check_for_gather_libvirt_dir == True :
351
+ job_type += "/gather-libvirt"
352
+ else :
353
+ job_type += "/gather-extra"
329
354
330
355
node_log_url = PROW_VIEW_URL + spy_link [8 :] + \
331
356
"/artifacts/" + job_type + "/artifacts/oc_cmds/nodes"
@@ -717,7 +742,12 @@ def get_junit_symptom_detection_testcase_failures(spy_link,job_type):
717
742
718
743
symptom_detection_failed_testcase = []
719
744
720
- job_type = job_type + "/gather-extra"
745
+ check_for_gather_libvirt_dir = check_if_gather_libvirt_dir_exists (spy_link ,job_type )
746
+
747
+ if check_for_gather_libvirt_dir == True :
748
+ job_type += "/gather-libvirt"
749
+ else :
750
+ job_type += "/gather-extra"
721
751
722
752
test_log_junit_dir_url = PROW_VIEW_URL + spy_link [8 :] + "/artifacts/" + job_type + "/artifacts/junit/"
723
753
symptom_detection_failed_testcase = []
@@ -1079,23 +1109,27 @@ def get_brief_job_info(prow_ci_name,prow_ci_link,start_date=None,end_date=None,z
1079
1109
lease , _ = get_quota_and_nightly (job )
1080
1110
if zone is not None and lease not in zone :
1081
1111
continue
1112
+ job_status = check_job_status (job )
1082
1113
cluster_status = cluster_deploy_status (job )
1083
1114
i = i + 1
1084
1115
job_dict = {}
1085
1116
job_dict ["Build" ] = prow_ci_name
1086
1117
job_dict ["Prow Job ID" ] = job_id
1087
1118
job_dict ["Install Status" ] = cluster_status
1088
1119
job_dict ["Lease" ]= lease
1089
- if cluster_status == 'SUCCESS' and "sno" not in prow_ci_link :
1090
- job_type ,_ = job_classifier (job )
1091
- _ , e2e_fail_test_count , error_object = get_all_failed_tc (job ,job_type )
1092
- if all (value == None for value in error_object .values ()):
1093
- if e2e_fail_test_count == 0 :
1094
- job_dict ["Test result" ] = "PASS"
1095
- elif e2e_fail_test_count > 0 :
1096
- job_dict ["Test result" ] = str (e2e_fail_test_count ) + " testcases failed"
1097
- else :
1098
- job_dict ["Test result" ] = "Failed to get Test summary"
1120
+ if job_status == 'SUCCESS' and "sno" not in prow_ci_link :
1121
+ job_dict ["Test result" ] = "PASS"
1122
+ elif job_status == 'FAILURE' and "sno" not in prow_ci_link :
1123
+ if cluster_status == 'SUCCESS' :
1124
+ job_type ,_ = job_classifier (job )
1125
+ _ , e2e_fail_test_count , error_object = get_all_failed_tc (job ,job_type )
1126
+ if all (value == None for value in error_object .values ()):
1127
+ if e2e_fail_test_count == 0 :
1128
+ job_dict ["Test result" ] = "PASS"
1129
+ elif e2e_fail_test_count > 0 :
1130
+ job_dict ["Test result" ] = str (e2e_fail_test_count ) + " testcases failed"
1131
+ else :
1132
+ job_dict ["Test result" ] = "Failed to get Test summary"
1099
1133
summary_list .append (job_dict )
1100
1134
return summary_list
1101
1135
0 commit comments