From 4407f0fc129844e875360ac242e0eb830237c31c Mon Sep 17 00:00:00 2001 From: root Date: Thu, 24 Nov 2016 09:55:54 +0800 Subject: [PATCH 1/5] fix a bug,workflow can't run with blank lines cases.conf file --- benchmarking/run_cases.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/benchmarking/run_cases.py b/benchmarking/run_cases.py index 55b798b..e198122 100644 --- a/benchmarking/run_cases.py +++ b/benchmarking/run_cases.py @@ -63,12 +63,10 @@ def main(args): else: with open("../conf/cases.conf", "r") as f: case_lines = f.readlines() - for i in case_lines: - if i.strip() == "": - case_lines.remove(i) for line in case_lines: p = line.split() - testcase_list.append({"engine":p[0],"parameter":p[1:]}) + if len(p) > 0 and p!="\n": + testcase_list.append({"engine":p[0],"parameter":p[1:]}) for testcase in testcase_list: if testcase["engine"] == "qemurbd": benchmark = qemurbd.QemuRbd() From 2edbba1f69e3367b2c15b07593d21955b0b7d4af Mon Sep 17 00:00:00 2001 From: pythonfucku Date: Thu, 24 Nov 2016 10:29:30 +0800 Subject: [PATCH 2/5] fix web bug.Test Configuration->Benchmark Configuration has nothing with cases.conf has blank line --- conf/config.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/conf/config.py b/conf/config.py index d2fa8ba..5a7c71f 100644 --- a/conf/config.py +++ b/conf/config.py @@ -287,22 +287,18 @@ def get_config(self): try: with open(self.conf_path,"r") as f: lines = f.readlines() - for i in lines: - if i.strip() == "": - lines.remove(i) for line in lines: p = line.split() - testcase_list.append( self.parse_benchmark_cases( p ) ) + if len(p) != 0 and p!="\n": + testcase_list.append( self.parse_benchmark_cases( p ) ) except: common.bash("cp %s %s" % (self.default_conf_path, self.conf_path)) with open(self.conf_path,"r") as f: lines = f.readlines() - for i in lines: - if i.strip() == "": - lines.remove(i) for line in lines: p = line.split() - testcase_list.append( self.parse_benchmark_cases( p ) ) + if len(p) != 0 and p!="\n": + testcase_list.append( self.parse_benchmark_cases( p ) ) return testcase_list def parse_benchmark_cases(self, testcase): From 08b70eb0157911a569ea312394d5d027de00e615 Mon Sep 17 00:00:00 2001 From: pythonfucku Date: Thu, 24 Nov 2016 11:21:17 +0800 Subject: [PATCH 3/5] add. if case start with '#',workflow fill not running this case --- benchmarking/run_cases.py | 7 ++++++- webui/static/js/Common.js | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/benchmarking/run_cases.py b/benchmarking/run_cases.py index e198122..e7ed8f2 100644 --- a/benchmarking/run_cases.py +++ b/benchmarking/run_cases.py @@ -64,9 +64,14 @@ def main(args): with open("../conf/cases.conf", "r") as f: case_lines = f.readlines() for line in case_lines: + #if line.startswith("#"): + #continue p = line.split() if len(p) > 0 and p!="\n": - testcase_list.append({"engine":p[0],"parameter":p[1:]}) + if not p[0].startswith('#'): + testcase_list.append({"engine":p[0],"parameter":p[1:]}) + print testcase_list + return for testcase in testcase_list: if testcase["engine"] == "qemurbd": benchmark = qemurbd.QemuRbd() diff --git a/webui/static/js/Common.js b/webui/static/js/Common.js index af86c19..5b1d930 100644 --- a/webui/static/js/Common.js +++ b/webui/static/js/Common.js @@ -276,7 +276,8 @@ function CreateTableHTML_Benchmark(jsonObj){ }); tableHtml += ""; - tableHtml += "" + tableHtml += ""; + tableHtml += "
  • If case start with '#',workflow will not running this cases.
  • "; return tableHtml; } From 5ede22ca740354d86374bc3c9232bea30bf2ceef Mon Sep 17 00:00:00 2001 From: Name Date: Thu, 24 Nov 2016 12:03:04 +0800 Subject: [PATCH 4/5] Update run_cases.py --- benchmarking/run_cases.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/benchmarking/run_cases.py b/benchmarking/run_cases.py index e7ed8f2..20ca460 100644 --- a/benchmarking/run_cases.py +++ b/benchmarking/run_cases.py @@ -70,8 +70,7 @@ def main(args): if len(p) > 0 and p!="\n": if not p[0].startswith('#'): testcase_list.append({"engine":p[0],"parameter":p[1:]}) - print testcase_list - return + for testcase in testcase_list: if testcase["engine"] == "qemurbd": benchmark = qemurbd.QemuRbd() From 3dd67f0addd6043c54134980c8aa50b2841b94bd Mon Sep 17 00:00:00 2001 From: Name Date: Thu, 24 Nov 2016 12:04:11 +0800 Subject: [PATCH 5/5] Update run_cases.py --- benchmarking/run_cases.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/benchmarking/run_cases.py b/benchmarking/run_cases.py index 20ca460..97142a7 100644 --- a/benchmarking/run_cases.py +++ b/benchmarking/run_cases.py @@ -64,8 +64,6 @@ def main(args): with open("../conf/cases.conf", "r") as f: case_lines = f.readlines() for line in case_lines: - #if line.startswith("#"): - #continue p = line.split() if len(p) > 0 and p!="\n": if not p[0].startswith('#'):