summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Eichmann <EichmannD@gmail.com>2019-02-25 16:21:33 +0000
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-03-05 03:15:47 -0500
commit6c4e45b043b0577d64e5addf5eaf6503e4a10b23 (patch)
tree117d73e37d949acdda1ca6df2d1f329a3966a209
parent80dfcee61e3bfb67f131cd674f96467e16c0f9d8 (diff)
downloadhaskell-6c4e45b043b0577d64e5addf5eaf6503e4a10b23.tar.gz
Test Runner: don't show missing baseline warning for performance tests with expected changes on the current commit.
Trac #16359
-rw-r--r--testsuite/driver/perf_notes.py33
1 files changed, 18 insertions, 15 deletions
diff --git a/testsuite/driver/perf_notes.py b/testsuite/driver/perf_notes.py
index 9362e46471..0aa2fa962e 100644
--- a/testsuite/driver/perf_notes.py
+++ b/testsuite/driver/perf_notes.py
@@ -308,9 +308,11 @@ def baseline_commit_log(commit):
# (bool , str ) -> (str , str , str , str) -> float
_commit_metric_cache = {}
-# Get the baseline (expected value) of a test at a given commit. This searches
-# git notes from older commits for recorded metrics (locally and from ci). More
-# recent commits are favoured, then local results over ci results are favoured.
+# Get the baseline of a test at a given commit. This is the expected value
+# *before* the commit is applied (i.e. on the parent commit).
+# This searches git notes from older commits for recorded metrics (locally and
+# from ci). More recent commits are favoured, then local results over ci results
+# are favoured.
#
# commit: str - must be a commit hash (see commit_has())
# name: str - test name
@@ -319,7 +321,8 @@ _commit_metric_cache = {}
# metric: str - test metric
# way: str - test way
# returns: the Baseline named tuple or None if no metric was found within
-# BaselineSearchDepth commits and since the last expected change.
+# BaselineSearchDepth commits and since the last expected change
+# (ignoring any expected change in the given commit).
def baseline_metric(commit, name, test_env, metric, way):
# For performance reasons (in order to avoid calling commit_hash), we assert
# commit is already a commit hash.
@@ -393,14 +396,8 @@ def baseline_metric(commit, name, test_env, metric, way):
# Searches through previous commits trying local then ci for each commit in.
def search(useCiNamespace, depth):
- # Stop if reached the max search depth, or if
- # there is an expected change at the child commit (depth-1). This is a
- # subtlety: Metrics recorded on commit x incorporate the expected
- # changes for commit x. Hence metrics from x are still a valid baseline,
- # while older commits are not. This is why we check for expected changes
- # on depth-1 rather than depth.
- if depth >= BaselineSearchDepth or has_expected_change( \
- depth_to_commit(depth - 1)):
+ # Stop if reached the max search depth.
+ if depth >= BaselineSearchDepth:
return None
# Check for a metric on this commit.
@@ -409,11 +406,17 @@ def baseline_metric(commit, name, test_env, metric, way):
return current_metric
# Metric is not available.
- # If tried local, now try CI. Else move to the parent commit.
+ # If tried local, now try CI.
if not useCiNamespace:
return search(True, depth)
- else:
- return search(False, depth + 1)
+
+ # Stop if there is an expected change at this commit. In that case
+ # metrics on ancestor commits will not be a valid baseline.
+ if has_expected_change(depth_to_commit(depth)):
+ return None
+
+ # Move to the parent commit.
+ return search(False, depth + 1)
# Start search from parent commit using local name space.
return search(False, 1)