aboutsummaryrefslogtreecommitdiffstats
path: root/xtesting
diff options
context:
space:
mode:
Diffstat (limited to 'xtesting')
-rw-r--r--xtesting/core/campaign.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/xtesting/core/campaign.py b/xtesting/core/campaign.py
index 60af3f46..7c766e53 100644
--- a/xtesting/core/campaign.py
+++ b/xtesting/core/campaign.py
@@ -71,9 +71,17 @@ class Campaign():
"{}?build_tag={}".format(url, env.get('BUILD_TAG')),
headers=testcase.TestCase.headers)
req.raise_for_status()
- Campaign.__logger.debug("data from DB: \n%s", req.json())
+ output = req.json()
+ Campaign.__logger.debug("data from DB: \n%s", output)
+ for i, _ in enumerate(output["results"]):
+ for j, _ in enumerate(
+ output["results"][i]["details"]["links"]):
+ output["results"][i]["details"]["links"][j] = re.sub(
+ "^{}/*".format(os.environ["HTTP_DST_URL"]), '',
+ output["results"][i]["details"]["links"][j])
+ Campaign.__logger.debug("data to archive: \n%s", output)
with open("{}.json".format(env.get('BUILD_TAG')), "w") as dfile:
- json.dump(req.json(), dfile)
+ json.dump(output, dfile)
except Exception: # pylint: disable=broad-except
Campaign.__logger.exception(
"The results cannot be collected from DB")