From: Junio C Hamano Date: Sun, 19 May 2019 07:45:28 +0000 (+0900) Subject: Merge branch 'ab/perf-installed-fix' X-Git-Tag: v2.22.0-rc1~29 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/82dca958dd8c3eba22653c605710c3ef6514958f?ds=inline;hp=-c 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 " use the correct gits perf aggregate: remove GIT_TEST_INSTALLED from --codespeed perf README: correct docs for 3c8f12c96c regression --- 82dca958dd8c3eba22653c605710c3ef6514958f diff --combined t/perf/aggregate.perl index 76dd48f890,b951747e08..66554d2161 --- a/t/perf/aggregate.perl +++ b/t/perf/aggregate.perl @@@ -3,8 -3,10 +3,9 @@@ use lib '../../perl/build/lib'; use strict; use warnings; -use JSON; use Getopt::Long; use Git; + use Cwd qw(realpath); sub get_times { my $name = shift; @@@ -98,18 -100,21 +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 -316,6 +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; @@@ -341,8 -343,7 +342,8 @@@ } } - print to_json(\@data, {utf8 => 1, pretty => 1, canonical => 1}), "\n"; + require JSON; + print JSON::to_json(\@data, {utf8 => 1, pretty => 1, canonical => 1}), "\n"; } binmode STDOUT, ":utf8" or die "PANIC on binmode: $!";