From ca3b3530f7b4a01291572ab78a866b9dbbcdd9db Mon Sep 17 00:00:00 2001 From: chenjiankun Date: Tue, 20 Sep 2016 07:47:21 +0000 Subject: Make a black list for yardstick reporting JIRA: YARDSTICK-353 Change-Id: Ic4821ff279401cc4eb26d172c0b649e9eeb2da48 Signed-off-by: chenjiankun --- reporting/yardstick/reporting-status.py | 5 +++++ reporting/yardstick/reportingConf.py | 1 + reporting/yardstick/scenarios.py | 20 ++++++++++++++++++++ 3 files changed, 26 insertions(+) create mode 100644 reporting/yardstick/scenarios.py (limited to 'reporting') diff --git a/reporting/yardstick/reporting-status.py b/reporting/yardstick/reporting-status.py index 345acef..60f1523 100644 --- a/reporting/yardstick/reporting-status.py +++ b/reporting/yardstick/reporting-status.py @@ -16,6 +16,7 @@ import yaml import reportingUtils as utils import reportingConf as conf import scenarioResult as sr +from scenarios import config as cf # Logger logger = utils.getLogger("Yardstick-Status") @@ -41,6 +42,10 @@ for version in conf.versions: scenario_results[k] += stable_result[k] scenario_result_criteria = {} + for s in scenario_results.keys(): + if cf.has_key(installer) and cf[installer].has_key(s): + scenario_results.pop(s) + # From each scenarios get results list for s, s_result in scenario_results.items(): logger.info("---------------------------------") diff --git a/reporting/yardstick/reportingConf.py b/reporting/yardstick/reportingConf.py index 52d9997..2db41f0 100644 --- a/reporting/yardstick/reportingConf.py +++ b/reporting/yardstick/reportingConf.py @@ -22,6 +22,7 @@ LASTEST_TESTS = 4 REPORTING_PATH = "." URL_BASE = 'http://testresults.opnfv.org/test/api/v1/results' +TEST_CONF = "https://git.opnfv.org/cgit/yardstick/plain/tests/ci/report_config.yaml" # LOG_LEVEL = "ERROR" LOG_LEVEL = "INFO" diff --git a/reporting/yardstick/scenarios.py b/reporting/yardstick/scenarios.py new file mode 100644 index 0000000..590fea2 --- /dev/null +++ b/reporting/yardstick/scenarios.py @@ -0,0 +1,20 @@ +import yaml +import os +import requests + +import reportingConf as conf + + +response = requests.get(conf.TEST_CONF) +yaml_file = yaml.safe_load(response.text) +reporting = yaml_file.get('reporting') + +config = {} + +for element in reporting: + name = element['name'] + scenarios = element['scenario'] + for s in scenarios: + if not config.has_key(name): + config[name] = {} + config[name][s] = True -- cgit 1.2.3-korg