summaryrefslogtreecommitdiff
path: root/t/perf/README
diff options
context:
space:
mode:
authorLibravatar Jeff King <peff@peff.net>2016-06-22 15:40:13 -0400
committerLibravatar Junio C Hamano <gitster@pobox.com>2016-06-22 13:47:16 -0700
commit1a0962dee51addaa44a53f9d9782e8231d27cc96 (patch)
treedd681f2fd5f800cb5147729793bad6bd3b5049ad /t/perf/README
parentperf: make the tests work in worktrees (diff)
downloadtgif-1a0962dee51addaa44a53f9d9782e8231d27cc96.tar.xz
t/perf: fix regression in testing older versions of git
Commit 7501b59 (perf: make the tests work in worktrees, 2016-05-13) introduced the use of "git rev-parse --git-path" in the perf-lib setup code. Because the to-be-tested version of git is at the front of the $PATH when this code runs, this means we cannot use modern versions of t/perf to test versions of git older than v2.5.0 (when that option was introduced). This is a symptom of a more general problem. The t/perf suite is essentially independent of git versions, and ideally we would be able to run the most modern and complete set of tests across many historical versions (to see how they compare). But any setup code they run is therefore required to use the lowest common denominator we expect to test. So let's introduce a new variable, $MODERN_GIT, that we can use both in perf-lib and in the test setup to get a reliable set of git features (we might change git and break some tests, of course, but $MODERN_GIT is tied to the same version of git as the t/perf scripts, so they can be fixed or adjusted together). This commit fixes the "--git-path" case, but does not mass-convert existing setup code to use $MODERN_GIT. Most setup code is fairly vanilla and will work with effectively all versions. But now the tool is there to fix any other issues we find going forward. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/perf/README')
-rw-r--r--t/perf/README12
1 files changed, 10 insertions, 2 deletions
diff --git a/t/perf/README b/t/perf/README
index 8848c14619..49ea4349be 100644
--- a/t/perf/README
+++ b/t/perf/README
@@ -115,8 +115,16 @@ After that you will want to use some of the following:
At least one of the first two is required!
-You can use test_expect_success as usual. For actual performance
-tests, use
+You can use test_expect_success as usual. In both test_expect_success
+and in test_perf, running "git" points to the version that is being
+perf-tested. The $MODERN_GIT variable points to the git wrapper for the
+currently checked-out version (i.e., the one that matches the t/perf
+scripts you are running). This is useful if your setup uses commands
+that only work with newer versions of git than what you might want to
+test (but obviously your new commands must still create a state that can
+be used by the older version of git you are testing).
+
+For actual performance tests, use
test_perf 'descriptive string' '
command1 &&