diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2021-12-21 18:42:55 +0000 |
---|---|---|
committer | Matthew Pickering <matthewtpickering@gmail.com> | 2021-12-22 13:25:59 +0000 |
commit | 1ede0d1bad4a98a3524ff383c18ef84441b8b7ee (patch) | |
tree | a131dcaaa582f6a0e5ae7cabdbb1aa20ef489d7d | |
parent | 09b6cb45505c2c32ddaffcdb930fb3f7873b2cfc (diff) | |
download | haskell-wip/perf-tests-downwards.tar.gz |
perf ci: Start searching form the performance baselinewip/perf-tests-downwards
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.
-rw-r--r-- | testsuite/driver/perf_notes.py | 7 |
1 files 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: |