diff options
author | Krzysztof Gogolewski <krzysztof.gogolewski@tweag.io> | 2020-09-05 02:08:16 +0200 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2020-09-17 19:46:29 -0400 |
commit | 8edda01f171127bfc550ef8a0fa2a5d619e67b4e (patch) | |
tree | b6af6e302277c14026567a2890def97d227830e9 | |
parent | 7d00408b424e3f819ee0e4d9843a6fd04162dd0f (diff) | |
download | haskell-8edda01f171127bfc550ef8a0fa2a5d619e67b4e.tar.gz |
Make sure we can read past perf notes
See #18656.
(cherry picked from commit b8a9cff2ce651c085c84980d3e709db2ecda8c3f)
-rw-r--r-- | testsuite/driver/perf_notes.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/testsuite/driver/perf_notes.py b/testsuite/driver/perf_notes.py index 2bc88cd27c..96233c8916 100644 --- a/testsuite/driver/perf_notes.py +++ b/testsuite/driver/perf_notes.py @@ -113,7 +113,13 @@ MetricOracles = NamedTuple("MetricOracles", [("baseline", MetricBaselineOracle), def parse_perf_stat(stat_str: str) -> PerfStat: field_vals = stat_str.strip('\t').split('\t') - return PerfStat(*field_vals) # type: ignore + stat = PerfStat(*field_vals) # type: ignore + if stat.test_env.startswith('"') and stat.test_env.endswith('"'): + # Due to a bug, in historical data sometimes the test_env + # contains additional quotation marks (#18656). + # Remove them, so that we can refer to past data in a uniform fashion. + stat = stat._replace(test_env=TestEnv(stat.test_env[1:-1])) + return stat # Get all recorded (in a git note) metrics for a given commit. # Returns an empty array if the note is not found. @@ -645,6 +651,8 @@ def main() -> None: metrics = [test for test in metrics if test.stat.way == args.way] if args.test_env: + if '"' in args.test_env: + raise Exception('test_env should not contain quotation marks') metrics = [test for test in metrics if test.stat.test_env == args.test_env] if args.test_name: |