summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKrzysztof Gogolewski <krzysztof.gogolewski@tweag.io>2020-09-05 02:08:16 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-09-12 00:33:25 -0400
commit8440b5fa1397940f2f293935927e690b34110a73 (patch)
tree8f641c7400a742603b792058166b271fb2046086
parent853d121acfcdae208e852edacac65a1b3e8cab83 (diff)
downloadhaskell-8440b5fa1397940f2f293935927e690b34110a73.tar.gz
Make sure we can read past perf notes
See #18656.
-rw-r--r--testsuite/driver/perf_notes.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/testsuite/driver/perf_notes.py b/testsuite/driver/perf_notes.py
index fb4461ec81..28038e630c 100644
--- a/testsuite/driver/perf_notes.py
+++ b/testsuite/driver/perf_notes.py
@@ -130,7 +130,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.
@@ -662,6 +668,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: