aboutsummaryrefslogtreecommitdiffstats
path: root/xtesting/core/testcase.py
diff options
context:
space:
mode:
authorCedric Ollivier <cedric.ollivier@orange.com>2019-11-30 10:31:42 +0000
committerGerrit Code Review <gerrit@opnfv.org>2019-11-30 10:31:42 +0000
commitef7528f9d97b451d08327140341a19959f152aab (patch)
tree4f2e4b3f88537fe524952853d80f243f61aa8798 /xtesting/core/testcase.py
parentb209efd0fa4233ba58e5d21175c567c8b0946dde (diff)
parent740afc884b2af2f068945e7a9963d5e4b66a1a0e (diff)
Merge "Postprocess the TestAPI href returned"
Diffstat (limited to 'xtesting/core/testcase.py')
-rw-r--r--xtesting/core/testcase.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/xtesting/core/testcase.py b/xtesting/core/testcase.py
index 58de9f42..9ccd4376 100644
--- a/xtesting/core/testcase.py
+++ b/xtesting/core/testcase.py
@@ -237,13 +237,14 @@ class TestCase():
headers=self._headers)
req.raise_for_status()
if urllib.parse.urlparse(url).scheme != "file":
- res_url = req.json()["href"]
- if env.get('TEST_DB_EXT_URL'):
- res_url = res_url.replace(
- env.get('TEST_DB_URL'), env.get('TEST_DB_EXT_URL'))
+ # href must be postprocessed as OPNFV testapi is misconfigured
+ # (localhost is returned)
+ uid = re.sub(r'^.*/api/v1/results/*', '', req.json()["href"])
+ netloc = env.get('TEST_DB_EXT_URL') if env.get(
+ 'TEST_DB_EXT_URL') else env.get('TEST_DB_URL')
self.__logger.info(
"The results were successfully pushed to DB: \n\n%s\n",
- res_url)
+ os.path.join(netloc, uid))
except AssertionError:
self.__logger.exception(
"Please run test before publishing the results")