Skip to content

Commit 88faa4c

Browse files
committed
updates
1 parent 07c1feb commit 88faa4c

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

send_cobertura_to_bitbucket.py

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,38 +28,37 @@ def parse_cobertura(xml_path, send_all_coverage):
2828
mcdcpair_coverage = line.attrib.get('mcdcpair-coverage', '')
2929

3030
summary = ""
31-
3231
publishAnnotation = send_all_coverage
3332

3433
if hits == 0:
3534
summary = FAIL + " No coverage on line."
3635
publishAnnotation = True
3736

3837
else:
39-
summary = "ST: " + PASS
38+
summary = PASS + " ST"
4039
if branch == 'true':
4140
if condition_coverage.startswith("100.0%"):
42-
summary += " BR: {} {}".format (PASS,condition_coverage)
41+
summary += " | {} BR: {}".format (PASS,condition_coverage)
4342
elif condition_coverage.startswith("0.0%"):
44-
summary += " BR: {} {}".format (FAIL,condition_coverage)
43+
summary += " | {} BR: {}".format (FAIL,condition_coverage)
4544
publishAnnotation = True
4645
else:
47-
summary += " BR: {} {}".format (PARTIAL,condition_coverage)
46+
summary += " | {} BR: {}".format (PARTIAL,condition_coverage)
4847
publishAnnotation = True
4948

5049
if functioncall_coverage.startswith("100.0%"):
51-
summary += " FC: {}".format (PASS)
50+
summary += " | {} FC".format (PASS)
5251
elif functioncall_coverage != '':
53-
summary += " FC: {}".format (FAIL)
52+
summary += " | {} FC".format (FAIL)
5453
publishAnnotation = True
5554

5655
if mcdcpair_coverage.startswith("100.0%"):
57-
summary += " MCDC: {} {}".format (PASS, mcdcpair_coverage)
56+
summary += " | {} MCDC: {}".format (PASS, mcdcpair_coverage)
5857
elif mcdcpair_coverage.startswith("0.0%"):
59-
summary += " MCDC: {} {}".format (FAIL, mcdcpair_coverage)
58+
summary += " | {} MCDC: {}".format (FAIL, mcdcpair_coverage)
6059
publishAnnotation = True
6160
elif mcdcpair_coverage != '':
62-
summary += " MCDC: {} {}".format (PARTIAL, mcdcpair_coverage)
61+
summary += " | {} MCDC: {}".format (PARTIAL, mcdcpair_coverage)
6362
publishAnnotation = True
6463

6564
if publishAnnotation:
@@ -223,7 +222,7 @@ def run(filename, minimum_passing_coverage, send_all_coverage, verbose):
223222

224223

225224
with open("coverage_results.json", "wb") as fd:
226-
fd.write(json.dumps(annotations).encode(encFmt,'replace'))
225+
fd.write(json.dumps(annotations, indent=2).encode(encFmt,'replace'))
227226

228227
send_code_coverage_annoations(
229228
annotations,

0 commit comments

Comments
 (0)