[Ezbench-dev] [PATCH 5/5] ezbench: add an ensure option (-e)
Martin Peres
martin.peres at linux.intel.com
Thu Mar 2 11:54:22 UTC 2017
This option takes precedence on -r and makes sure that at least N runs
are scheduled
---
ezbench | 24 ++++++++++++++++--------
1 file changed, 16 insertions(+), 8 deletions(-)
diff --git a/ezbench b/ezbench
index 470086f..66a2d3d 100755
--- a/ezbench
+++ b/ezbench
@@ -71,6 +71,8 @@ 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 to add",
action="store", type=int, nargs='?', default=3)
+parser.add_argument("-e", dest='ensure', help="Make sure that at least N rounds are executed",
+ action="store", type=int, nargs='?')
parser.add_argument("-p", dest='profile', help="Profile to be used by ezbench",
action="store")
parser.add_argument("-s", dest='add_conf_script', help="Add a configuration script for EzBench's runner",
@@ -178,15 +180,21 @@ if args.commits is not None and args.tests is not None:
# Add all the commits and tests to commit
for commit in run_info.commits:
for test in run_info.tests:
- total_rounds = sbench.add_test(commit, test, args.rounds)
- if args.rounds >= 0:
- print("added {} runs to {} on {} --> {} runs".format(args.rounds,
- test, commit,
- total_rounds))
+ if args.ensure is None:
+ total_rounds = sbench.add_test(commit, test, args.rounds)
+ if args.rounds >= 0:
+ print("added {} runs to {} on {} --> {} runs".format(args.rounds,
+ test, commit,
+ total_rounds))
+ else:
+ print("removed {} runs to {} on {} --> {} runs".format(-args.rounds,
+ test, commit,
+ total_rounds))
else:
- print("removed {} runs to {} on {} --> {} runs".format(-args.rounds,
- test, commit,
- total_rounds))
+ added = sbench.force_test_rounds(commit, test, args.ensure)
+ print("ensured {} runs of {} on {} --> added {} runs".format(args.ensure,
+ test, commit,
+ added))
if args.commits is not None and len(testsets_to_be_added) > 0:
# remove duplicates in the lists
--
2.11.1
More information about the Ezbench-dev
mailing list