Skip to content

Commit

Permalink
Merge 8d1d253 into 8b0e2e9
Browse files Browse the repository at this point in the history
  • Loading branch information
coolo committed Mar 10, 2015
2 parents 8b0e2e9 + 8d1d253 commit fb07388
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions lib/OpenQA/Worker/Jobs.pm
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,13 @@ sub upload_status(;$) {
}
$current_running = $os_status->{running};
}
$status->{result} = read_result_file($upload_result) if $upload_result;
if ($upload_result) {
$status->{result} = read_result_file($upload_result);
if ($os_status->{running}) {
$status->{result}->{$os_status->{running}} //= {};
$status->{result}->{$os_status->{running}}->{result} = 'running';
}
}
$status->{'log'} = log_snippet;

my $screen = read_last_screen;
Expand Down Expand Up @@ -302,7 +308,10 @@ sub read_json_file {
my $fn = "$pooldir/testresults/$name";
my $ret;
local $/;
open(my $fh, '<', $fn) or return undef;
if (!open(my $fh, '<', $fn)) {
warn "can't open $fn: $!";
return undef;
}
my $json = {};
eval {$json = decode_json(<$fh>);};
warn "os-autoinst didn't write proper $fn" if $@;
Expand Down Expand Up @@ -330,12 +339,9 @@ sub read_result_file($) {
};
}
$ret->{$test} = $result;

last if ($test eq $name);
}
if (@$test_order) {
# set the next to running
$ret->{$test_order->[0]->{name}} = { result => 'running' };
}
return $ret;
}

Expand Down

0 comments on commit fb07388

Please sign in to comment.