Merge branch 'ab/perf-installed-fix'

Performance test framework has been broken and measured the version
of Git that happens to be on $PATH, not the specified one to
measure, for a while, which has been corrected.

* ab/perf-installed-fix:
  perf-lib.sh: forbid the use of GIT_TEST_INSTALLED
  perf tests: add "bindir" prefix to git tree test results
  perf-lib.sh: remove GIT_TEST_INSTALLED from perf-lib.sh
  perf-lib.sh: make "./run <revisions>" use the correct gits
  perf aggregate: remove GIT_TEST_INSTALLED from --codespeed
  perf README: correct docs for 3c8f12c96c regression
This commit is contained in:
Junio C Hamano
2019-05-19 16:45:28 +09:00
4 changed files with 53 additions and 27 deletions

View File

@ -5,6 +5,7 @@ use strict;
use warnings;
use Getopt::Long;
use Git;
use Cwd qw(realpath);
sub get_times {
my $name = shift;
@ -98,18 +99,21 @@ usage() unless $rc;
while (scalar @ARGV) {
my $arg = $ARGV[0];
my $dir;
my $prefix = '';
last if -f $arg or $arg eq "--";
if (! -d $arg) {
my $rev = Git::command_oneline(qw(rev-parse --verify), $arg);
$dir = "build/".$rev;
} elsif ($arg eq '.') {
$dir = '.';
} else {
$arg =~ s{/*$}{};
$dir = $arg;
$dirabbrevs{$dir} = $dir;
$dir = realpath($arg);
$dirnames{$dir} = $dir;
$prefix .= 'bindir';
}
push @dirs, $dir;
$dirnames{$dir} = $arg;
my $prefix = $dir;
$dirnames{$dir} ||= $arg;
$prefix .= $dir;
$prefix =~ tr/^a-zA-Z0-9/_/c;
$prefixes{$dir} = $prefix . '.';
shift @ARGV;
@ -311,9 +315,6 @@ sub print_codespeed_results {
$environment = $reponame;
} elsif (exists $ENV{GIT_PERF_REPO_NAME} and $ENV{GIT_PERF_REPO_NAME} ne "") {
$environment = $ENV{GIT_PERF_REPO_NAME};
} elsif (exists $ENV{GIT_TEST_INSTALLED} and $ENV{GIT_TEST_INSTALLED} ne "") {
$environment = $ENV{GIT_TEST_INSTALLED};
$environment =~ s|/bin-wrappers$||;
} else {
$environment = `uname -r`;
chomp $environment;