Skip to content

Commit 5d445f3

Browse files
chriscoolgitster
authored andcommitted
perf: store subsection results in "test-results/$GIT_PERF_SUBSECTION/"
When tests are run for a subsection defined in a config file, it is better if the results for the current subsection are not overwritting the results of a previous subsection. So let's store the results for a subsection in a subdirectory of "test-results/" with the subsection name. The aggregate.perl, when it is run for a subsection, should then aggregate the results found in "test-results/$GIT_PERF_SUBSECTION/". Signed-off-by: Christian Couder <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent ffdd010 commit 5d445f3

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

t/perf/aggregate.perl

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,17 @@ sub format_times {
6969
@tests = glob "p????-*.sh";
7070
}
7171

72+
my $resultsdir = "test-results";
73+
if ($ENV{GIT_PERF_SUBSECTION} ne "") {
74+
$resultsdir .= "/" . $ENV{GIT_PERF_SUBSECTION};
75+
}
76+
7277
my @subtests;
7378
my %shorttests;
7479
for my $t (@tests) {
7580
$t =~ s{(?:.*/)?(p(\d+)-[^/]+)\.sh$}{$1} or die "bad test name: $t";
7681
my $n = $2;
77-
my $fname = "test-results/$t.subtests";
82+
my $fname = "$resultsdir/$t.subtests";
7883
open my $fp, "<", $fname or die "cannot open $fname: $!";
7984
for (<$fp>) {
8085
chomp;
@@ -98,7 +103,7 @@ sub read_descr {
98103
my %descrs;
99104
my $descrlen = 4; # "Test"
100105
for my $t (@subtests) {
101-
$descrs{$t} = $shorttests{$t}.": ".read_descr("test-results/$t.descr");
106+
$descrs{$t} = $shorttests{$t}.": ".read_descr("$resultsdir/$t.descr");
102107
$descrlen = length $descrs{$t} if length $descrs{$t}>$descrlen;
103108
}
104109

@@ -138,7 +143,7 @@ sub have_slash {
138143
my $firstr;
139144
for my $i (0..$#dirs) {
140145
my $d = $dirs[$i];
141-
$times{$prefixes{$d}.$t} = [get_times("test-results/$prefixes{$d}$t.times")];
146+
$times{$prefixes{$d}.$t} = [get_times("$resultsdir/$prefixes{$d}$t.times")];
142147
my ($r,$u,$s) = @{$times{$prefixes{$d}.$t}};
143148
my $w = length format_times($r,$u,$s,$firstr);
144149
$colwidth[$i] = $w if $w > $colwidth[$i];

t/perf/perf-lib.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ MODERN_GIT=$GIT_BUILD_DIR/bin-wrappers/git
5656
export MODERN_GIT
5757

5858
perf_results_dir=$TEST_OUTPUT_DIRECTORY/test-results
59+
test -n "$GIT_PERF_SUBSECTION" && perf_results_dir="$perf_results_dir/$GIT_PERF_SUBSECTION"
5960
mkdir -p "$perf_results_dir"
6061
rm -f "$perf_results_dir"/$(basename "$0" .sh).subtests
6162

0 commit comments

Comments
 (0)