Skip to content

Commit

Permalink
reporting failed test execution in replay pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
TheAmg committed Aug 9, 2024
1 parent 1b28dac commit d500619
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/test/python/Target.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ def check_replay(self):
result_map['passing'] = str(total-len(replay_fail))
result_map['case_result'] = test_case_results

result_map['run_state'] = True
return result_map

def format_report_name(self,repo_name):
Expand Down
6 changes: 6 additions & 0 deletions src/test/python/markup_report_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,16 @@ def generate_and_write_report(self):
total = summary['tot']
passing_count = summary['passing']
case_results = summary['case_result']
run_state = summary['run_state']

report_content += "*Java version* : "+java_version+"\n\n"
report_content += "*Passing Count* : "+passing_count+"/"+total+"\n\n"
report_content += "*Status* : "+self.get_status_string(status)+"\n\n"

if run_state == False:
report_content += "*Test Execution Failed : No tests were run for this project*\n\n"
continue

report_content += "| Test ID | Status |\n"
report_content += "|---------|--------|\n"

Expand Down Expand Up @@ -76,6 +81,7 @@ def add_replay_result_status_entry(self, target, result_map):

new_entry = dict()
new_entry['java_version'] = target.target_run_properties.java_version
new_entry['run_state'] = result_map['run_state']
new_entry['status'] = result_map['status']
new_entry['tot'] = result_map['tot']
new_entry['passing'] = result_map['passing']
Expand Down
10 changes: 9 additions & 1 deletion src/test/python/replay_target.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,15 @@ def replay_target(target):
if (response_code == 0):
print("Test for target executed successfully: " + target.test_repo_name)
else:
raise Exception("Test for target failed execution: " + target.test_repo_name)
print("Test for target failed execution: " + target.test_repo_name)
result_map = dict()
result_map['java_version'] = target.target_run_properties.java_version
result_map['status'] = TestResult.FAIL
result_map['tot'] = "0"
result_map['passing'] = "0"
result_map['case_result'] = []
result_map['run_state'] = False
return result_map

# assert and clean repo
result_map = target.check_replay()
Expand Down

0 comments on commit d500619

Please sign in to comment.