From ac3e8c52d4acb4fc8c52abe7a90d6dfdef642ccd Mon Sep 17 00:00:00 2001 From: Matthew Pickering Date: Tue, 21 Dec 2021 18:42:55 +0000 Subject: perf ci: Start searching form the performance baseline If you specify PERF_BASELINE_COMMIT then this can fail if the specific commit you selected didn't have perf test metrics. (This can happen in CI for example if a build fails on master). Therefore instead of just reporting all tests as new, we start searching downwards from this point to try and find a good commit to report numbers from. --- testsuite/driver/perf_notes.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/testsuite/driver/perf_notes.py b/testsuite/driver/perf_notes.py index a320f22336..b21b0de977 100644 --- a/testsuite/driver/perf_notes.py +++ b/testsuite/driver/perf_notes.py @@ -432,9 +432,9 @@ def baseline_metric(commit: GitHash, assert is_commit_hash(commit) # Get all recent commit hashes. - commit_hashes = baseline_commit_log(commit) + commit_hashes = baseline_commit_log(commit_hash(baseline_ref) if baseline_ref else commit) - baseline_commit = commit_hash(baseline_ref) if baseline_ref else None + baseline_commit = None def has_expected_change(commit: GitHash) -> bool: return get_allowed_perf_changes(commit).get(name) is not None @@ -450,7 +450,8 @@ def baseline_metric(commit: GitHash, else: return None - for depth, current_commit in list(enumerate(commit_hashes))[1:]: + for depth, current_commit in list(enumerate(commit_hashes)): + if current_commit == commit: continue # Check for a metric on this commit. current_metric = get_commit_metric(namespace, current_commit, test_env, name, metric, way) if current_metric is not None: -- cgit v1.2.1