Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions scoreboard.pl
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ ($$)
print "Generating index page\n" if ($verbose);

unless ($indexhtml->open (">$filename")) {
warn 'Could not create file: '.$filename." ".$_;
warn "Could not create index page file $filename: $!";
return;
}

Expand Down Expand Up @@ -858,6 +858,7 @@ ($)
foreach my $file (@existing) {
print " Removing $file files\n" if ($verbose);
unlink $file . ".txt";
unlink $file . ".build.json";
unlink $file . "_Full.html";
unlink $file . "_Brief.html";
unlink $file . "_Totals.html";
Expand Down Expand Up @@ -1837,7 +1838,6 @@ sub write_builds_json

if (defined $opt_i){
$index = $opt_i;
load_build_list ($inp_file);
print 'Running Index Page Update at ' . get_time_str() . "\n" if ($verbose);
build_index_page ($dir, $index);
exit (0);
Expand Down
1 change: 1 addition & 0 deletions testmatrix/HTMLScoreboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ def write_simple(cls, page, title, cols, rows):


def get_build_details_path(build, basename):
build.dir.mkdir(parents=True, exist_ok=True)
return build.dir / f'{basename}-build-details.html'


Expand Down
1 change: 0 additions & 1 deletion testmatrix/matrix.css
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ table.test_results td[test] a {
td.test_name {
font-family: monospace;
text-align: left;
overflow-x: scroll;
white-space: nowrap;
}
td.txt {text-align: left;}
Expand Down
26 changes: 22 additions & 4 deletions testmatrix/matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import enum
from datetime import timedelta
from pathlib import Path
from urllib.request import urlopen


use_ansi = os.name != 'nt' and sys.stdout.isatty()
Expand All @@ -30,6 +31,9 @@ def text(self):
def timedelta_str(td):
# str(td) would work, but it returns a string that's longer than it
# needs to be.
if td is None:
return 'N/A'

days, rem_hours = divmod(round(td.total_seconds()), 24 * 60 * 60)
hours, rem_mins = divmod(rem_hours, 60 * 60)
mins, secs = divmod(rem_mins, 60)
Expand Down Expand Up @@ -166,9 +170,19 @@ def __init__(self, name, builds_dir, misc=None):
self.basename = misc['basename']
self.props = misc.get('props', {})

build_json = self.dir / (self.basename + '.build.json')
with build_json.open('r') as f:
data = json.load(f)
# Get build.json. It should either exist locally or can be downloaded.
build_json_name = self.basename + '.build.json'
build_json = self.dir / build_json_name
if build_json.is_file():
with build_json.open('r') as f:
data = json.load(f)
elif 'url' in misc:
url = misc['url'] + '/' + build_json_name
print(f'{build_json} not found, downloading {url}...')
with urlopen(url) as f:
data = json.load(f)
else:
raise ValueError(f'Can not get {build_json_name} for {name}')

self.tests = {}
for t in data['tests']:
Expand Down Expand Up @@ -228,7 +242,11 @@ def __init__(self, builds_dir: Path):
self.builds = {}
for b in data['builds']:
name = b['name']
build = Build(name, builds_dir, b)
try:
build = Build(name, builds_dir, b)
except BaseException as e:
e.add_note(f'The build that caused an error was {name}')
raise
self.builds[name] = build

# Collect all the tests
Expand Down
Loading