[commit: ghc] wip/perf-testsuite: Small changes to address Ben's comments (e0117dc)

git at git.haskell.org git at git.haskell.org
Sat Sep 2 21:45:10 UTC 2017


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

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

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

commit e0117dc3a4fb0a9152dda7aff4f9e38b879d5e20
Author: Jared Weakly <jweakly at pdx.edu>
Date:   Tue Jul 18 17:35:34 2017 -0700

    Small changes to address Ben's comments
    
    Signed-off-by: Jared Weakly <jweakly at pdx.edu>


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

e0117dc3a4fb0a9152dda7aff4f9e38b879d5e20
 testsuite/driver/runtests.py    | 5 +++++
 testsuite/driver/testglobals.py | 2 +-
 testsuite/driver/testlib.py     | 5 ++---
 testsuite/driver/testutil.py    | 6 ++++--
 4 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/testsuite/driver/runtests.py b/testsuite/driver/runtests.py
index e102a94..8d0b337 100644
--- a/testsuite/driver/runtests.py
+++ b/testsuite/driver/runtests.py
@@ -307,6 +307,11 @@ else:
 
     summary(t, sys.stdout, config.no_print_summary)
 
+    # This here is loading up all of the git notes into memory.
+    # It's most likely in the wrong spot and I haven't fully fleshed out
+    # where exactly I'm putting this and how I'm refactoring the performance
+    # test running logic.
+    # Currently this is useful for debugging, at least.
     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...
diff --git a/testsuite/driver/testglobals.py b/testsuite/driver/testglobals.py
index 5ed54bd..6d8cd3d 100644
--- a/testsuite/driver/testglobals.py
+++ b/testsuite/driver/testglobals.py
@@ -125,7 +125,7 @@ class TestConfig:
         # To accumulate the metrics for the git notes
         self.accumulate_metrics = []
         # Has the user defined a custom test environment? Local is default.
-        self.TEST_ENV = 'local'
+        self.test_env = 'local'
 
 global config
 config = TestConfig()
diff --git a/testsuite/driver/testlib.py b/testsuite/driver/testlib.py
index 45b44a5..8fc3ed7 100644
--- a/testsuite/driver/testlib.py
+++ b/testsuite/driver/testlib.py
@@ -1086,7 +1086,6 @@ def stats( name, way, stats_file ):
 # Check -t stats info
 
 def checkStats(name, way, stats_file, range_fields):
-
     full_name = name + '(' + way + ')'
 
     result = passed()
@@ -1112,8 +1111,8 @@ def checkStats(name, way, stats_file, range_fields):
 
             # Add val into the git note if option is set.
             if config.use_git_notes:
-                test_env = config.TEST_ENV
-                config.accumulate_metrics.append(test_env + '\t' + name + '\t' + way + '\t' + field + '\t' + str(val))
+                test_env = config.test_env
+                config.accumulate_metrics.append('\t'.join([test_env, name, way, field, str(val)]))
 
             if val < lowerBound:
                 print(field, 'value is too low:')
diff --git a/testsuite/driver/testutil.py b/testsuite/driver/testutil.py
index 59906a0..1fe1c20 100644
--- a/testsuite/driver/testutil.py
+++ b/testsuite/driver/testutil.py
@@ -54,8 +54,10 @@ 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]
+    log = [line.strip('\t').split('\t') for line in log]
+    log = [dict(zip(logFields, field)) for field in log]
+    return log
+    # Add a print statement here if you want to see what's being loaded from git notes.
 
 # 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