Skip to content

Commit b1b883f

Browse files
committed
Simplify fedora-ci jobs
Signed-off-by: Cristian Le <git@lecris.dev>
1 parent 379f24d commit b1b883f

2 files changed

Lines changed: 10 additions & 44 deletions

File tree

packit_service/worker/helpers/testing_farm.py

Lines changed: 9 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
from ogr.abstract import GitProject, PullRequest
1111
from ogr.utils import RequestResponse
1212
from packit.config import JobConfig, PackageConfig
13-
from packit.exceptions import PackitConfigException, PackitException
14-
from packit.utils import commands, nested_get
13+
from packit.exceptions import PackitConfigException
14+
from packit.utils import nested_get
1515
from packit.utils.koji_helper import KojiHelper
1616

1717
from packit_service.config import Deployment, ServiceConfig
@@ -1525,49 +1525,15 @@ def prepare_and_send_tf_request(
15251525
)
15261526
def _payload_installability(self, distro: str, compose: str) -> dict:
15271527
git_repo = "https://github.com/fedora-ci/installability-pipeline.git"
1528-
git_ref = (
1529-
commands.run_command(["git", "ls-remote", git_repo, "HEAD"], output=True)
1530-
.stdout.strip()
1531-
.split()[0]
1532-
)
1533-
1534-
if distro == "fedora-rawhide":
1535-
# profile names are in "fedora-N" format
1536-
# extract current rawhide version number from its candidate tag
1537-
if not (candidate_tag := self.koji_helper.get_candidate_tag("rawhide")):
1538-
raise PackitException(f"Failed to get test profile for {distro}")
1539-
profile = re.sub(r"f(\d+)(-.*)?", r"fedora-\1", candidate_tag)
1540-
else:
1541-
profile = distro
1542-
1543-
# installability test requires a Koji build
1544-
# (it should be guaranteed by the `HasEventSuccessfulScratchBuild` checker)
1545-
assert self.koji_build
1546-
1547-
return {
1548-
"test": {
1549-
"tmt": {
1550-
"url": git_repo,
1551-
"ref": git_ref,
1552-
},
1553-
},
1554-
"environments": [
1555-
{
1556-
"arch": "x86_64",
1557-
"os": {"compose": compose},
1558-
"variables": {
1559-
"PROFILE_NAME": profile,
1560-
"TASK_ID": self.koji_build.task_id,
1561-
},
1562-
},
1563-
],
1564-
"notification": {
1565-
"webhook": {
1566-
"url": f"{self.api_url}/testing-farm/results",
1567-
"token": self.service_config.testing_farm_secret,
1568-
},
1528+
git_ref = "master"
1529+
payload = self._get_tf_base_payload(distro, compose)
1530+
payload["test"] = {
1531+
"tmt": {
1532+
"url": git_repo,
1533+
"ref": git_ref,
15691534
},
15701535
}
1536+
return payload
15711537

15721538
@implements_fedora_ci_test(
15731539
"rpminspect",

tests/integration/test_listen_to_fedmsg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
from packit.config.requirements import LabelRequirementsConfig, RequirementsConfig
2727
from packit.copr_helper import CoprHelper
2828
from packit.local_project import LocalProject, LocalProjectBuilder
29+
from packit.utils import commands
2930
from packit.utils.koji_helper import KojiHelper
3031

3132
import packit_service.service.urls as urls
@@ -65,7 +66,6 @@
6566
from packit_service.worker.helpers.testing_farm import (
6667
TestingFarmClient,
6768
TestingFarmJobHelper,
68-
commands,
6969
)
7070
from packit_service.worker.jobs import SteveJobs
7171
from packit_service.worker.monitoring import Pushgateway

0 commit comments

Comments
 (0)