Skip to content
This repository has been archived by the owner on Apr 7, 2022. It is now read-only.

Commit

Permalink
[RFR] Fix artifactor plugins (#9748)
Browse files Browse the repository at this point in the history
* issue with pushing data to ostriz

* fix duration which is sometimes absent

* fixing filedump
  • Loading branch information
izapolsk authored and jawatts committed Dec 10, 2019
1 parent 095bb2a commit 8d201da
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions artifactor/plugins/filedump.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ def filedump(
):
if not slaveid:
slaveid = "Master"
if slaveid not in self.store:
self.store[slaveid] = {}
test_ident = "{}/{}".format(
self.store[slaveid]["test_location"], self.store[slaveid]["test_name"]
)
Expand Down
2 changes: 1 addition & 1 deletion artifactor/plugins/ostriz.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def ostriz_send(
json_data["jenkins"] = jenkins or None
# Either None or a list of Polarion Test Case IDs
json_data["polarion"] = polarion_ids
if not json_data["params"]:
if not json_data.get("params"):
json_data["params"] = {}
json_data["params"].update(env_params)
requests.post(self.url, data=json.dumps(json_data))
Expand Down
4 changes: 2 additions & 2 deletions artifactor/plugins/reporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,15 +257,15 @@ def build_dict(self, path, container, contents):
if not end:
container["_sub"][head] = contents
container["_stats"][contents["outcomes"]["overall"]] += 1
container["_duration"] += contents["duration"]
container["_duration"] += contents.get("duration", 0)
# If we are in a module.
else:
if head not in container["_sub"]:
container["_sub"][head] = deepcopy(_tests_tpl)
# Call again to recurse down the tree.
self.build_dict(end, container["_sub"][head], contents)
container["_stats"][contents["outcomes"]["overall"]] += 1
container["_duration"] += contents["duration"]
container["_duration"] += contents.get("duration", 0)

def build_li(self, lev):
"""
Expand Down

0 comments on commit 8d201da

Please sign in to comment.