Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 21 additions & 4 deletions packit_service/worker/helpers/testing_farm.py
Original file line number Diff line number Diff line change
Expand Up @@ -1575,7 +1575,7 @@ def _payload_rpminspect(self, distro: str, compose: str) -> dict:
git_ref = "master"
# rpminspect defines its own container in the tmt plan file,
# hence `compose=None`
payload = self._get_tf_base_payload(distro, None)
payload = self._get_tf_base_payload(distro, None, multihost=True)
payload["test"] = {
"tmt": {
"url": git_repo,
Expand All @@ -1593,7 +1593,7 @@ def _payload_rpmlint(self, distro: str, compose: str) -> dict:
git_ref = "main"
# rpmlint defines its own container in the tmt plan file,
# hence `compose=None`
payload = self._get_tf_base_payload(distro, None)
payload = self._get_tf_base_payload(distro, None, multihost=True)
payload["test"] = {
"tmt": {
"url": git_repo,
Expand All @@ -1614,7 +1614,7 @@ def _get_fedora_ci_payload(self, distro: str, plan: str) -> dict:
git_repo = "https://forge.fedoraproject.org/ci/shared-tests"
git_ref = "main" if self.service_config.deployment == Deployment.prod else "stg"
# All tests in ci/shared-tests define their own provision hence `compose=None`
payload = self._get_tf_base_payload(distro, None)
payload = self._get_tf_base_payload(distro, None, multihost=True)
payload["test"] = {
"tmt": {
"url": git_repo,
Expand Down Expand Up @@ -1652,7 +1652,12 @@ def _payload_custom(self, distro: str, compose: str) -> dict:
}
return payload

def _get_tf_base_payload(self, distro: str, compose: Optional[str]) -> dict:
def _get_tf_base_payload(
self,
distro: str,
compose: Optional[str],
multihost: bool = False,
) -> dict:
Comment on lines +1655 to +1660
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The docstring for _get_tf_base_payload should be updated to include the new multihost parameter and follow the Google-style format as required by the repository style guide (lines 412-414). It is currently missing the Args and Returns sections, which are necessary for non-trivial methods like this one that construct complex payload structures.

References
  1. All code must contain accurate and sufficiently detailed docstrings, formatted in accordance with the PEP 257 standard and in Google-style (including Args and Returns sections). (link)

"""
Common payload for all fedora-ci testing-farm jobs.

Expand All @@ -1663,6 +1668,17 @@ def _get_tf_base_payload(self, distro: str, compose: Optional[str]) -> dict:
# this has to be specified at the api request level.
# TODO: Revisit when 0.2 testing-farm API is decided
os_params = {"os": {"compose": compose}} if compose else {}
multihost_params = (
{
"settings": {
"pipeline": {
"type": "tmt-multihost",
}
}
}
if multihost
else {}
)
dist_git_branch = self.pr.target_branch
variables = {}
artifacts = []
Expand Down Expand Up @@ -1698,6 +1714,7 @@ def _get_tf_base_payload(self, distro: str, compose: Optional[str]) -> dict:
"token": self.service_config.testing_farm_secret,
},
},
**multihost_params,
}

def _handle_tf_submit_successful(
Expand Down
Loading