diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2021-12-15 10:46:58 +0000 |
---|---|---|
committer | Matthew Pickering <matthewtpickering@gmail.com> | 2021-12-15 11:26:44 +0000 |
commit | 6deeb47cd6ed9e997e1257fd5955eb430403eda8 (patch) | |
tree | d9dd87120e125b36d277edeb76f6f7e641065dc6 | |
parent | 45bd630886157fbe4856594e098202808aedbdd0 (diff) | |
download | haskell-wip/perf-baseline.tar.gz |
ci: Use correct metrics baselinewip/perf-baseline
It turns out there was already a function in the CI script to correctly
set the baseline for performance tests but it was just never called. I
now call it during the initialisation to set the correct baseline.
I also made the make testsuite driver take into account the
PERF_BASELINE_COMMIT environment variable
Fixes #20811
-rwxr-xr-x | .gitlab/ci.sh | 10 | ||||
-rw-r--r-- | testsuite/mk/test.mk | 6 |
2 files changed, 13 insertions, 3 deletions
diff --git a/.gitlab/ci.sh b/.gitlab/ci.sh index 1eef2143fe..ca115af15a 100755 --- a/.gitlab/ci.sh +++ b/.gitlab/ci.sh @@ -449,9 +449,11 @@ function push_perf_notes() { # Figure out which commit should be used by the testsuite driver as a # performance baseline. See Note [The CI Story]. function determine_metric_baseline() { - PERF_BASELINE_COMMIT="$(git merge-base "$CI_MERGE_REQUEST_TARGET_BRANCH_NAME" HEAD)" - export PERF_BASELINE_COMMIT - info "Using $PERF_BASELINE_COMMIT for performance metric baseline..." + if [ -n "${CI_MERGE_REQUEST_DIFF_BASE_SHA}:-}" ]; then + PERF_BASELINE_COMMIT="$CI_MERGE_REQUEST_DIFF_BASE_SHA" + export PERF_BASELINE_COMMIT + info "Using $PERF_BASELINE_COMMIT for performance metric baseline..." + fi } function test_make() { @@ -661,6 +663,8 @@ if [ -n "${IGNORE_PERF_FAILURES:-}" ]; then RUNTEST_ARGS="--ignore-perf-failures=$IGNORE_PERF_FAILURES" fi +determine_metric_baseline + set_toolchain_paths case $1 in diff --git a/testsuite/mk/test.mk b/testsuite/mk/test.mk index 53f86cb9d4..483d17c051 100644 --- a/testsuite/mk/test.mk +++ b/testsuite/mk/test.mk @@ -17,6 +17,7 @@ # PLATFORM -- if accepting a result, accept it for the current platform. # OS -- if accepting a result, accept it for all wordsizes of the # current os. +# PERF_BASELINE_COMMIT - the baseline commit to use for performance tests. # # ----------------------------------------------------------------------------- @@ -303,6 +304,11 @@ RUNTEST_OPTS += \ --no-print-summary endif +ifneq "$(PERF_BASELINE_COMMIT)" "" +RUNTEST_OPTS += \ + --perf-baseline "$(PERF_BASELINE_COMMIT)" +endif + RUNTEST_OPTS += \ $(EXTRA_RUNTEST_OPTS) |