summaryrefslogtreecommitdiff
path: root/t/perf/run
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2021-08-02 21:06:41 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-08-02 21:06:41 (GMT)
commite163f73b7bab509a22cee233cfb4f90c781c98cb (patch)
tree8b321e2615e42f5531bf47d0026ebd5a581b2ce5 /t/perf/run
parent8a49dfacd630acb1fc7948fabf1f2fa08b18fb22 (diff)
parent3663e5904d7c0060f3b51ffe7c7469caeefb51e5 (diff)
downloadgit-e163f73b7bab509a22cee233cfb4f90c781c98cb.zip
git-e163f73b7bab509a22cee233cfb4f90c781c98cb.tar.gz
git-e163f73b7bab509a22cee233cfb4f90c781c98cb.tar.bz2
Merge branch 'ps/perf-with-separate-output-directory'
Test update. * ps/perf-with-separate-output-directory: perf: fix when running with TEST_OUTPUT_DIRECTORY
Diffstat (limited to 't/perf/run')
-rwxr-xr-xt/perf/run25
1 files changed, 16 insertions, 9 deletions
diff --git a/t/perf/run b/t/perf/run
index c7b8610..d19dec2 100755
--- a/t/perf/run
+++ b/t/perf/run
@@ -188,10 +188,10 @@ run_subsection () {
if test -z "$GIT_PERF_SEND_TO_CODESPEED"
then
- ./aggregate.perl $codespeed_opt "$@"
+ ./aggregate.perl --results-dir="$TEST_RESULTS_DIR" $codespeed_opt "$@"
else
- json_res_file="test-results/$GIT_PERF_SUBSECTION/aggregate.json"
- ./aggregate.perl --codespeed "$@" | tee "$json_res_file"
+ json_res_file=""$TEST_RESULTS_DIR"/$GIT_PERF_SUBSECTION/aggregate.json"
+ ./aggregate.perl --results-dir="$TEST_RESULTS_DIR" --codespeed "$@" | tee "$json_res_file"
send_data_url="$GIT_PERF_SEND_TO_CODESPEED/result/add/json/"
curl -v --request POST --data-urlencode "json=$(cat "$json_res_file")" "$send_data_url"
fi
@@ -203,10 +203,17 @@ get_var_from_env_or_config "GIT_PERF_SEND_TO_CODESPEED" "perf" "sendToCodespeed"
cd "$(dirname $0)"
. ../../GIT-BUILD-OPTIONS
-mkdir -p test-results
-get_subsections "perf" >test-results/run_subsections.names
+if test -n "$TEST_OUTPUT_DIRECTORY"
+then
+ TEST_RESULTS_DIR="$TEST_OUTPUT_DIRECTORY/test-results"
+else
+ TEST_RESULTS_DIR=test-results
+fi
+
+mkdir -p "$TEST_RESULTS_DIR"
+get_subsections "perf" >"$TEST_RESULTS_DIR"/run_subsections.names
-if test $(wc -l <test-results/run_subsections.names) -eq 0
+if test $(wc -l <"$TEST_RESULTS_DIR"/run_subsections.names) -eq 0
then
if test -n "$GIT_PERF_SUBSECTION"
then
@@ -222,10 +229,10 @@ then
)
elif test -n "$GIT_PERF_SUBSECTION"
then
- egrep "^$GIT_PERF_SUBSECTION\$" test-results/run_subsections.names >/dev/null ||
+ egrep "^$GIT_PERF_SUBSECTION\$" "$TEST_RESULTS_DIR"/run_subsections.names >/dev/null ||
die "subsection '$GIT_PERF_SUBSECTION' not found in '$GIT_PERF_CONFIG_FILE'"
- egrep "^$GIT_PERF_SUBSECTION\$" test-results/run_subsections.names | while read -r subsec
+ egrep "^$GIT_PERF_SUBSECTION\$" "$TEST_RESULTS_DIR"/run_subsections.names | while read -r subsec
do
(
GIT_PERF_SUBSECTION="$subsec"
@@ -243,5 +250,5 @@ else
echo "======== Run for subsection '$GIT_PERF_SUBSECTION' ========"
run_subsection "$@"
)
- done <test-results/run_subsections.names
+ done <"$TEST_RESULTS_DIR"/run_subsections.names
fi