@@ -28,7 +28,7 @@ def parse_cobertura(xml_path, send_all_coverage):
2828 mcdcpair_coverage = line .attrib .get ('mcdcpair-coverage' , '' )
2929
3030 summary = ""
31- publishAnnotation = send_all_coverage
31+ publishAnnotation = True # send_all_coverage
3232
3333 if hits == 0 :
3434 summary = FAIL + " No coverage on line."
@@ -63,15 +63,23 @@ def parse_cobertura(xml_path, send_all_coverage):
6363
6464 if publishAnnotation :
6565 annotations .append ({
66- "title" : "Coverage" ,
67- "annotation_type" : "COVERAGE" ,
68- "summary" : summary ,
69- "severity" : "LOW" ,
7066 "path" : file_path ,
7167 "line" : num ,
7268 "external_id" : "{}#{}" .format (file_path ,num )
69+ 'message' : summary
70+ }
71+ )
7372
74- })
73+ # annotations.append({
74+ # "title": "Coverage",
75+ # "annotation_type": "COVERAGE",
76+ # "summary": summary,
77+ # "severity": "LOW",
78+ # "path": file_path,
79+ # "line": num,
80+ # "external_id": "{}#{}".format(file_path,num)
81+ # }
82+ # )
7583 return annotations
7684
7785def get_summary_string (type_str , rate ):
@@ -113,11 +121,11 @@ def get_summary_resuts(xml_path, minimum_passing_coverage, verbose):
113121 # If you ever have more coverage types, you can refactor like this:
114122
115123 metrics = [
116- ("Statement Coverage % " , statement_rate ),
117- ("Branch Coverage % " , branch_rate ),
118- ("MCDC Pair Coverage % " , mcdcpair_coverage_rate ),
119- ("Function Call Coverage % " , function_coverage_rate ),
120- ("Function Coverage % " , functioncall_coverage_rate ),
124+ ("Statement" , statement_rate ),
125+ ("Branch" , branch_rate ),
126+ ("MCDC Pair" , mcdcpair_coverage_rate ),
127+ ("Function Call" , functioncall_coverage_rate ),
128+ ("Function " , function_coverage_rate ),
121129 ]
122130
123131 data = [
@@ -141,7 +149,7 @@ def create_code_coverage_report_in_bitbucket(filename, workspace, repo_slug, com
141149
142150 report_payload = {
143151 "title" : "Coverage Report" ,
144- "details" : "VectorCAST coverage results ." ,
152+ "details" : "VectorCAST Code Coverage Summary ." ,
145153 "report_type" : "COVERAGE" ,
146154 "reporter" : version ,
147155 "data" : data
0 commit comments