summaryrefslogtreecommitdiff
path: root/t/perf/run
diff options
context:
space:
mode:
authorChristian Couder <christian.couder@gmail.com>2018-01-05 09:12:25 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-01-05 20:31:08 (GMT)
commitfccec20f0baf9a801fb0f5a53285256a002b42cd (patch)
tree8c59b75e10fb0689df3368176fe332e14237a928 /t/perf/run
parent5d6bb930903be48cc3c90adfb88e12461082737d (diff)
downloadgit-fccec20f0baf9a801fb0f5a53285256a002b42cd.zip
git-fccec20f0baf9a801fb0f5a53285256a002b42cd.tar.gz
git-fccec20f0baf9a801fb0f5a53285256a002b42cd.tar.bz2
perf/run: learn to send output to codespeed server
Let's make it possible to set in a config file the URL of a codespeed server. And then let's make the `run` script send the perf test results to this URL at the end of the tests. This should make is possible to easily automate the process of running perf tests and having their results available in Codespeed. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/perf/run')
-rwxr-xr-xt/perf/run12
1 files changed, 11 insertions, 1 deletions
diff --git a/t/perf/run b/t/perf/run
index 4e62d6b..ef56396 100755
--- a/t/perf/run
+++ b/t/perf/run
@@ -148,10 +148,20 @@ run_subsection () {
test "$GIT_PERF_CODESPEED_OUTPUT" = "true" && codespeed_opt="--codespeed"
run_dirs "$@"
- ./aggregate.perl $codespeed_opt "$@"
+
+ if test -z "$GIT_PERF_SEND_TO_CODESPEED"
+ then
+ ./aggregate.perl $codespeed_opt "$@"
+ else
+ json_res_file="test-results/$GIT_PERF_SUBSECTION/aggregate.json"
+ ./aggregate.perl --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
}
get_var_from_env_or_config "GIT_PERF_CODESPEED_OUTPUT" "perf" "codespeedOutput" "--bool"
+get_var_from_env_or_config "GIT_PERF_SEND_TO_CODESPEED" "perf" "sendToCodespeed"
cd "$(dirname $0)"
. ../../GIT-BUILD-OPTIONS