Skip to content

Commit 82b7eb2

Browse files
avargitster
authored andcommitted
perf-lib.sh: forbid the use of GIT_TEST_INSTALLED
As noted in preceding commits setting GIT_TEST_INSTALLED has never been supported or documented, and as noted in an earlier t/perf/README change to the extent that it's been documented nobody's notices that the example hasn't worked since 3c8f12c ("test-lib: reorder and include GIT-BUILD-OPTIONS a lot earlier", 2012-06-24). We could directly support GIT_TEST_INSTALLED for invocations without the "run" script, such as: GIT_TEST_INSTALLED=../../ ./p0000-perf-lib-sanity.sh GIT_TEST_INSTALLED=/home/avar/g/git ./p0000-perf-lib-sanity.sh But while not having this "error" will "work", it won't write the the resulting "test-results/*" files to the right place, and thus a subsequent call to aggregate.perl won't work as expected. Let's just tell the user that they need to use the "run" script, which'll correctly deal with this and set the right PERF_RESULTS_PREFIX. If someone's in desperate need of bypassing "run" for whatever reason they can trivially do so by setting "PERF_SET_GIT_TEST_INSTALLED", but not we won't have people who expect GIT_TEST_INSTALLED to just work wondering why their aggregation doesn't work, even though they're running the right "git". Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]>
1 parent fab80ee commit 82b7eb2

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

t/perf/perf-lib.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,17 @@ TEST_NO_MALLOC_CHECK=t
2727

2828
. ../test-lib.sh
2929

30+
if test -n "$GIT_TEST_INSTALLED" -a -z "$PERF_SET_GIT_TEST_INSTALLED"
31+
then
32+
error "Do not use GIT_TEST_INSTALLED with the perf tests.
33+
34+
Instead use:
35+
36+
./run <path-to-git> -- <tests>
37+
38+
See t/perf/README for details."
39+
fi
40+
3041
# Variables from test-lib that are normally internal to the tests; we
3142
# need to export them for test_perf subshells
3243
export TEST_DIRECTORY TRASH_DIRECTORY GIT_BUILD_DIR GIT_TEST_CMP

t/perf/run

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ set_git_test_installed () {
8484
GIT_TEST_INSTALLED=$mydir_abs
8585
fi
8686
export GIT_TEST_INSTALLED
87+
PERF_SET_GIT_TEST_INSTALLED=true
88+
export PERF_SET_GIT_TEST_INSTALLED
8789
}
8890

8991
run_dirs_helper () {

0 commit comments

Comments
 (0)