|
|
@@ -63,6 +63,10 @@ All mandatory options not passed with the above switches, or in your ~/.testrail
|
|
|
|
|
|
-g --grep : Restrict results printed to those matching the provided pattern. Great for looking for specific failure conditions.
|
|
|
|
|
|
+-v --version : Restrict results printed to those tested on the provided version(s). May be passed multiple times.
|
|
|
+
|
|
|
+-d --defect : Restrict results printed to those related to the provided defect(s). May be passed multiple times.
|
|
|
+
|
|
|
-c --cachefile : Load the provided file as a place to pick up your search from.
|
|
|
|
|
|
--json : Print results as a JSON serialization.
|
|
|
@@ -127,6 +131,7 @@ sub run {
|
|
|
'e|encoding=s' => \$opts->{'encoding'},
|
|
|
'g|grep=s' => \$opts->{'pattern'},
|
|
|
'd|defect=s@' => \$opts->{'defects'},
|
|
|
+ 'v|version=s@' => \$opts->{'versions'},
|
|
|
'c|cachefile=s' => \$opts->{'cachefile'},
|
|
|
'json' => \$opts->{'json'},
|
|
|
'h|help' => \$opts->{'help'},
|
|
|
@@ -174,6 +179,7 @@ sub run {
|
|
|
$out .= "#############################\n";
|
|
|
my $num_runs = 0;
|
|
|
my $casetotals = {};
|
|
|
+ my $versions_by_status = {};
|
|
|
my $defects = [];
|
|
|
my $total_elapsed = 0;
|
|
|
my $avg_elapsed = 0;
|
|
|
@@ -187,12 +193,17 @@ sub run {
|
|
|
#$out .= "Found case '$case' in run $casedef->{run_id}\n";
|
|
|
foreach my $result (@{$casedef->{results}}) {
|
|
|
$casetotals->{$result->{status_id}}++;
|
|
|
+ $versions_by_status->{$result->{status_id}} //= [];
|
|
|
+ push(@{$versions_by_status->{$result->{status_id}}},$result->{version}) if $result->{version};
|
|
|
push(@$defects, @{$result->{defects}}) if $result->{defects};
|
|
|
push(@$elapsetotals,_elapsed2secs($result->{'elapsed'}));
|
|
|
}
|
|
|
}
|
|
|
@$seen_runs = uniq(@$seen_runs);
|
|
|
@$defects = uniq(@$defects);
|
|
|
+ foreach my $st (keys(%$versions_by_status)) {
|
|
|
+ @{$versions_by_status->{$st}} = uniq(@{$versions_by_status->{$st}});
|
|
|
+ }
|
|
|
|
|
|
my $pattern_output = '';
|
|
|
$out_json->{$case}->{search_string} = $opts->{'pattern'};
|
|
|
@@ -227,7 +238,13 @@ sub run {
|
|
|
$out_json->{$case}->{$status_map{$status}} = $casetotals->{$status};
|
|
|
}
|
|
|
|
|
|
+ foreach my $status (keys(%$versions_by_status)) {
|
|
|
+ $out .= "Versions $status_map{$status} in:\n".join(',',@{$versions_by_status->{$status}})."\n";
|
|
|
+ }
|
|
|
+ $out_json->{$case}->{versions_by_status} = $versions_by_status;
|
|
|
+
|
|
|
$out .= "\nDefects related to case:\n".join(',',@$defects)."\n" if @$defects;
|
|
|
+ $out_json->{$case}->{defects} = $defects;
|
|
|
|
|
|
}
|
|
|
|