From 223806ad2a5d60c9909f32f35b8cea16bf703a69 Mon Sep 17 00:00:00 2001 From: xudan Date: Wed, 22 Mar 2017 07:51:37 +0000 Subject: dovetail tool: Add an option cmd for pushing results into DB JIRA: DOVETAIL-373 1. add an option --report/-r to choose the report type. 2. "-r file" will store results with files. 3. "-r http://192.168.135.2:8000/api/v1" will push results into DB. The DB url can replaced by user's local DB or official DB. 4. Default report type is defined as "report_dest" in dovetail_config.yml. 5. Yardstick can't push results of one testcase into DB now, so both "-r file" and "-r http://..." will be regarded as "file". Change-Id: Ieaa017ab59c5b15235bf306ef57cdc56beb22af8 Signed-off-by: xudan --- dovetail/report.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'dovetail/report.py') diff --git a/dovetail/report.py b/dovetail/report.py index d4be67c6..f2210cb7 100644 --- a/dovetail/report.py +++ b/dovetail/report.py @@ -287,9 +287,9 @@ class FunctestCrawler(object): return json_results def crawl_from_url(self, testcase=None): - url = \ - dt_cfg.dovetail_config[self.type]['result']['db_url'] % \ - testcase.validate_testcase() + url = "%s/results?case=%s&last=1" % \ + (dt_cfg.dovetail_config['report_dest'], + testcase.validate_testcase()) self.logger.debug("Query to rest api: %s", url) try: data = json.load(urllib2.urlopen(url)) -- cgit 1.2.3-korg