diff options
author | 2019-11-30 13:19:08 +0000 | |
---|---|---|
committer | 2019-11-30 13:19:08 +0000 | |
commit | 2458049812df6f142a781d98d33c8270800becb4 (patch) | |
tree | d3fe05b5a45e0f988f22b7b725e3ae3af7c33795 /xtesting/core | |
parent | a9216e7d1ede61830386b356046507cc4b0e3634 (diff) | |
parent | 3fbd1085b8fe00e05b4bd71f0e27798242d3e159 (diff) |
Merge "Postprocess the TestAPI href returned" into stable/hunter
Diffstat (limited to 'xtesting/core')
-rw-r--r-- | xtesting/core/testcase.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/xtesting/core/testcase.py b/xtesting/core/testcase.py index b8d4e4de..ab82ecfc 100644 --- a/xtesting/core/testcase.py +++ b/xtesting/core/testcase.py @@ -237,13 +237,14 @@ class TestCase(object): 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") |