summaryrefslogtreecommitdiffstats
path: root/controller/libexec/dtf-result-stats.in
diff options
context:
space:
mode:
Diffstat (limited to 'controller/libexec/dtf-result-stats.in')
-rw-r--r--controller/libexec/dtf-result-stats.in21
1 files changed, 13 insertions, 8 deletions
diff --git a/controller/libexec/dtf-result-stats.in b/controller/libexec/dtf-result-stats.in
index d4db46f..92fd45f 100644
--- a/controller/libexec/dtf-result-stats.in
+++ b/controller/libexec/dtf-result-stats.in
@@ -44,17 +44,26 @@ my $task_ids = {};
# go through *each* result directory
my $olddir = getcwd;
-for (`find "$workdir" -maxdepth 1 -type d`) {
+for (`find "$workdir" -mindepth 1 -maxdepth 1 -type d | sort`) {
chomp;
chdir $_;
my $run_results = {};
$run_results->{dirname} = basename($_);
$run_results->{tasks} = {};
- $run_results->{exit_status} = 0;
+
+ my $glob_result;
+ my $fdg;
+ if (not open $fdg, '<', "dtf/result.yml") {
+ $run_results->{exit_status} = 2;
+ }
+ else {
+ $run_results->{glob} = YAML::Syck::LoadFile($fdg);
+ $run_results->{exit_status} = $run_results->{glob}->{exit_status};
+ }
# go through each task
- for (`find -maxdepth 1 -type f -name '*.result'`) {
+ for (`find dtf/tasks -type f -name '*.result'`) {
chomp;
(my $task_id = $_) =~ s/\.result$//;
@@ -65,11 +74,7 @@ for (`find "$workdir" -maxdepth 1 -type d`) {
open my $fd, '<', $yaml_file
or die "can't open yaml file '$yaml_file'";
- my $config = YAML::Syck::LoadFile($fd);
- if ($config->{exit_status} != 0) {
- $run_results->{exit_status} = 1;
- }
- $run_results->{tasks}->{$task_id} = $config;
+ $run_results->{tasks}->{$task_id} = YAML::Syck::LoadFile($fd);
}
push @{$data}, $run_results;