summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJose Lausuch <jose.lausuch@ericsson.com>2017-05-16 16:01:50 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-05-16 16:01:50 +0000
commit9a146d8b98e19c1aa2f4baec3a540d5eec8e8b34 (patch)
treee0a7c90bab2a1fa29b81872e7396f4f57da3e03b
parent555d7546711b67197c9daeb87e8a0415203b3b88 (diff)
parent8981bd79eaa1863a74c7c0e41e56c9f501a5f75b (diff)
Merge "Remove the former results in DB url" into stable/danube
-rwxr-xr-xfunctest/ci/generate_report.py6
-rw-r--r--functest/tests/unit/ci/test_generate_report.py8
2 files changed, 7 insertions, 7 deletions
diff --git a/functest/ci/generate_report.py b/functest/ci/generate_report.py
index 3872a07ed..1c844fabf 100755
--- a/functest/ci/generate_report.py
+++ b/functest/ci/generate_report.py
@@ -39,8 +39,8 @@ def init(tiers_to_run=[]):
def get_results_from_db():
- url = "%s/results?build_tag=%s" % (ft_utils.get_db_url(),
- CONST.BUILD_TAG)
+ url = "%s?build_tag=%s" % (ft_utils.get_db_url(),
+ CONST.BUILD_TAG)
logger.debug("Query to rest api: %s" % url)
try:
data = json.load(urllib2.urlopen(url))
@@ -56,7 +56,7 @@ def get_data(test, results):
for test_db in results:
if test['test_name'] in test_db['case_name']:
id = test_db['_id']
- url = ft_utils.get_db_url() + '/results/' + id
+ url = ft_utils.get_db_url() + '/' + id
test_result = test_db['criteria']
return {"url": url, "result": test_result}
diff --git a/functest/tests/unit/ci/test_generate_report.py b/functest/tests/unit/ci/test_generate_report.py
index 2225586f2..5e7db52a1 100644
--- a/functest/tests/unit/ci/test_generate_report.py
+++ b/functest/tests/unit/ci/test_generate_report.py
@@ -28,16 +28,16 @@ class GenerateReportTesting(unittest.TestCase):
@mock.patch('functest.ci.generate_report.urllib2.urlopen',
side_effect=urllib2.URLError('no host given'))
def test_get_results_from_db_fail(self, mock_method):
- url = "%s/results?build_tag=%s" % (ft_utils.get_db_url(),
- CONST.BUILD_TAG)
+ url = "%s?build_tag=%s" % (ft_utils.get_db_url(),
+ CONST.__getattribute__('BUILD_TAG'))
self.assertIsNone(gen_report.get_results_from_db())
mock_method.assert_called_once_with(url)
@mock.patch('functest.ci.generate_report.urllib2.urlopen',
return_value={'results': []})
def test_get_results_from_db_success(self, mock_method):
- url = "%s/results?build_tag=%s" % (ft_utils.get_db_url(),
- CONST.BUILD_TAG)
+ url = "%s?build_tag=%s" % (ft_utils.get_db_url(),
+ CONST.__getattribute__('BUILD_TAG'))
self.assertEqual(gen_report.get_results_from_db(), None)
mock_method.assert_called_once_with(url)