[commit: ghc] wip/perf-testsuite: Can now load up git note data into the python test driver. Working on issue #12758. (e44d040)

git at git.haskell.org git at git.haskell.org
Wed Jul 19 23:26:45 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/perf-testsuite
Link       : http://ghc.haskell.org/trac/ghc/changeset/e44d040c7aaf53838fb377b928b2c5b1889ee17e/ghc

>---------------------------------------------------------------

commit e44d040c7aaf53838fb377b928b2c5b1889ee17e
Author: Jared Weakly <jweakly at pdx.edu>
Date:   Tue Jul 18 12:17:57 2017 -0700

    Can now load up git note data into the python test driver. Working on issue #12758.
    
    Reviewers: austin, bgamari
    
    Subscribers: rwbarton, thomie
    
    Differential Revision: https://phabricator.haskell.org/D3758


>---------------------------------------------------------------

e44d040c7aaf53838fb377b928b2c5b1889ee17e
 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 996dae1..239003c 100644
--- a/testsuite/driver/runtests.py
+++ b/testsuite/driver/runtests.py
@@ -337,8 +337,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 084ef7e..6eb7aaa 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