Skip to content

Commit e854c74

Browse files
authored
Report bookrunner failures for each stage (rust-lang#2034)
1 parent 2755a04 commit e854c74

File tree

2 files changed

+40
-1
lines changed

2 files changed

+40
-1
lines changed

.github/workflows/kani.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,10 @@ jobs:
9696
- name: Print book runner text results
9797
run: cat build/output/latest/html/bookrunner.txt
9898

99-
- name: Detect unpexpected book runner failures
99+
- name: Print book runner failures grouped by stage
100+
run: python3 scripts/ci/bookrunner_failures_by_stage.py build/output/latest/html/index.html
101+
102+
- name: Detect unexpected book runner failures
100103
run: ./scripts/ci/detect_bookrunner_failures.sh build/output/latest/html/bookrunner.txt
101104

102105
# On one OS only, build the documentation, too.
+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/usr/bin/python3
2+
# Copyright Kani Contributors
3+
# SPDX-License-Identifier: Apache-2.0 OR MIT
4+
5+
import argparse
6+
from bs4 import BeautifulSoup
7+
8+
def main():
9+
parser = argparse.ArgumentParser(
10+
description='Scans an HTML dashboard file and prints'
11+
'the number of failures grouped by stage')
12+
parser.add_argument('input')
13+
args = parser.parse_args()
14+
15+
with open(args.input) as fp:
16+
run = BeautifulSoup(fp, 'html.parser')
17+
18+
failures = [0] * 3
19+
20+
for row in run.find_all('div', attrs={'class': 'pipeline-row'}):
21+
stages = row.find_all('div', attrs={'class': 'pipeline-stage'})
22+
i = 0
23+
for stage in stages:
24+
if stage.a['class'][1] == 'fail':
25+
failures[i] += 1
26+
break
27+
i += 1
28+
29+
print('bookrunner failures grouped by stage:')
30+
print(' * rustc-compilation: ' + str(failures[0]))
31+
print(' * kani-codegen: ' + str(failures[1]))
32+
print(' * cbmc-verification: ' + str(failures[2]))
33+
34+
35+
if __name__ == "__main__":
36+
main()

0 commit comments

Comments
 (0)