[Ezbench-dev] [PATCH v2 1/7] smartezbench: do not default to 3 runs if rounds is None in add_test

Martin Peres martin.peres at linux.intel.com
Fri Mar 10 11:11:09 UTC 2017


v2:
 - do not set the default rounds in argsparse because we want to handle
   testsets differently
---
 ezbench                                | 9 +++++++--
 python-modules/ezbench/smartezbench.py | 4 +---
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/ezbench b/ezbench
index 3a6e225..f0f379d 100755
--- a/ezbench
+++ b/ezbench
@@ -69,7 +69,7 @@ parser.add_argument("-t", dest='testsets', help="Test sets to run", action="appe
 parser.add_argument("-T", dest='list_testsets', help="List the available testsets", action="store_true")
 parser.add_argument("-c", dest='commits', help="Commits to run the tests on",
                     action="append")
-parser.add_argument("-r", dest='rounds', help="Number of execution rounds",
+parser.add_argument("-r", dest='rounds', help="Number of execution rounds to add",
                     action="store", type=int, nargs='?')
 parser.add_argument("-p", dest='profile', help="Profile to be used by ezbench",
                     action="store")
@@ -175,11 +175,16 @@ if args.commits is not None and args.tests is not None:
     if not run_info.success():
         sys.exit(1)
 
+    # Default to 3 round if -r is not set
+    rounds = int(args.rounds)
+    if rounds is None:
+        rounds = 3
+
     # Add all the commits and tests to commit
     for commit in run_info.commits:
         for test in run_info.tests:
             print("add {count} runs to {test} on {commit}".format(count=args.rounds, test=test, commit=commit))
-            sbench.add_test(commit, test, args.rounds)
+            sbench.add_test(commit, test, rounds)
 
 if args.commits is not None and len(testsets_to_be_added) > 0:
     # remove duplicates in the lists
diff --git a/python-modules/ezbench/smartezbench.py b/python-modules/ezbench/smartezbench.py
index c5612ed..6436d0b 100644
--- a/python-modules/ezbench/smartezbench.py
+++ b/python-modules/ezbench/smartezbench.py
@@ -499,9 +499,7 @@ class SmartEzbench:
             commit = scm.full_version_name(commit)
 
         if rounds is None:
-            rounds = 3
-        else:
-            rounds = int(rounds)
+            return
 
         self.__task_tree_add_test__(self.state['commits'], commit, test, rounds)
 
-- 
2.11.1



More information about the Ezbench-dev mailing list