[Git][ghc/ghc][wip/T18656] Make sure we can read past perf notes
Krzysztof Gogolewski
gitlab at gitlab.haskell.org
Sat Sep 5 00:09:42 UTC 2020
Krzysztof Gogolewski pushed to branch wip/T18656 at Glasgow Haskell Compiler / GHC
Commits:
b9eeae56 by Krzysztof Gogolewski at 2020-09-05T02:09:14+02:00
Make sure we can read past perf notes
See #18656.
- - - - -
1 changed file:
- testsuite/driver/perf_notes.py
Changes:
=====================================
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=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:
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/b9eeae56439b6f94777b75cceefe76c34530753d
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/b9eeae56439b6f94777b75cceefe76c34530753d
You're receiving this email because of your account on gitlab.haskell.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20200904/21e75b37/attachment-0001.html>
More information about the ghc-commits
mailing list