[commit: ghc] wip/perf-testsuite: Can now load up git note data into python (80194f0)
git at git.haskell.org
git at git.haskell.org
Sat Sep 2 21:44:53 UTC 2017
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/perf-testsuite
Link : http://ghc.haskell.org/trac/ghc/changeset/80194f070b2be8d9f41c07d69a3c86962b7fbe12/ghc
>---------------------------------------------------------------
commit 80194f070b2be8d9f41c07d69a3c86962b7fbe12
Author: Jared Weakly <jweakly at pdx.edu>
Date: Tue Jul 18 12:17:57 2017 -0700
Can now load up git note data into python
>---------------------------------------------------------------
80194f070b2be8d9f41c07d69a3c86962b7fbe12
testsuite/driver/runtests.py | 6 ++++--
testsuite/driver/testutil.py | 12 +++++++++---
2 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/testsuite/driver/runtests.py b/testsuite/driver/runtests.py
index 30f320a..e102a94 100644
--- a/testsuite/driver/runtests.py
+++ b/testsuite/driver/runtests.py
@@ -306,8 +306,10 @@ else:
sys.stdout.flush()
summary(t, sys.stdout, config.no_print_summary)
- print("Only perf tests: " + str(config.only_perf_tests) + "\n")
- print("Skip perf tests: " + str(config.skip_perf_tests) + "\n")
+
+ if config.use_git_notes:
+ note = subprocess.check_output(["git","notes","--ref=perf","append","-m", "\n".join(config.accumulate_metrics)])
+ parse_git_notes('perf') # Should this be hardcoded? Most likely not...
if config.summary_file:
with open(config.summary_file, 'w') as file:
diff --git a/testsuite/driver/testutil.py b/testsuite/driver/testutil.py
index c6297ff..59906a0 100644
--- a/testsuite/driver/testutil.py
+++ b/testsuite/driver/testutil.py
@@ -47,9 +47,15 @@ def lndir(srcdir, dstdir):
os.mkdir(dst)
lndir(src, dst)
-# def git_append(note):
-# def print_metrics():
-# print(config.accumulate_metrics)
+# This function allows one to read in git notes from the commandline
+# and then breaks it into a list of dictionaries that can be parsed
+# later on in the testing functions.
+def parse_git_notes(namespace):
+ logFields = ['TEST_ENV','TEST','WAY','METRIC','VALUE']
+ log = subprocess.check_output(['git', 'notes', '--ref=' + namespace, 'show']).decode('utf-8')
+ log = log.strip('\n').split('\n')
+ log = [entry.strip('\t').split('\t') for entry in log]
+ log = [dict(zip(logFields, row)) for row in log]
# On Windows, os.symlink is not defined with Python 2.7, but is in Python 3
# when using msys2, as GHC does. Unfortunately, only Administrative users have
More information about the ghc-commits
mailing list