Skip to content

Commit cddb32c

Browse files
committed
Drop inclusion of koji artifact for now
Eventually the tests should use the repo created by the artifacts and multihost pipeline, but these are not ready to do so yet Signed-off-by: Cristian Le <git@lecris.dev>
1 parent 1f773c8 commit cddb32c

2 files changed

Lines changed: 52 additions & 72 deletions

File tree

packit_service/worker/helpers/testing_farm.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1526,7 +1526,7 @@ def prepare_and_send_tf_request(
15261526
def _payload_installability(self, distro: str, compose: str) -> dict:
15271527
git_repo = "https://github.com/fedora-ci/installability-pipeline.git"
15281528
git_ref = "master"
1529-
payload = self._get_tf_base_payload(distro, compose)
1529+
payload = self._get_tf_base_payload(distro, compose, with_artifacts=False)
15301530
payload["test"] = {
15311531
"tmt": {
15321532
"url": git_repo,
@@ -1544,7 +1544,7 @@ def _payload_rpminspect(self, distro: str, compose: str) -> dict:
15441544
git_ref = "master"
15451545
# rpminspect defines its own container in the tmt plan file,
15461546
# hence `compose=None`
1547-
payload = self._get_tf_base_payload(distro, None)
1547+
payload = self._get_tf_base_payload(distro, None, with_artifacts=False)
15481548
payload["test"] = {
15491549
"tmt": {
15501550
"url": git_repo,
@@ -1562,7 +1562,7 @@ def _payload_rpmlint(self, distro: str, compose: str) -> dict:
15621562
git_ref = "main"
15631563
# rpmlint defines its own container in the tmt plan file,
15641564
# hence `compose=None`
1565-
payload = self._get_tf_base_payload(distro, None)
1565+
payload = self._get_tf_base_payload(distro, None, with_artifacts=False)
15661566
payload["test"] = {
15671567
"tmt": {
15681568
"url": git_repo,
@@ -1583,7 +1583,7 @@ def _get_fedora_ci_payload(self, distro: str, plan: str) -> dict:
15831583
git_repo = "https://forge.fedoraproject.org/ci/shared-tests"
15841584
git_ref = "main" if self.service_config.deployment == Deployment.prod else "stg"
15851585
# All tests in ci/shared-tests define their own provision hence `compose=None`
1586-
payload = self._get_tf_base_payload(distro, None)
1586+
payload = self._get_tf_base_payload(distro, None, with_artifacts=False)
15871587
payload["test"] = {
15881588
"tmt": {
15891589
"url": git_repo,
@@ -1621,7 +1621,9 @@ def _payload_custom(self, distro: str, compose: str) -> dict:
16211621
}
16221622
return payload
16231623

1624-
def _get_tf_base_payload(self, distro: str, compose: Optional[str]) -> dict:
1624+
def _get_tf_base_payload(
1625+
self, distro: str, compose: Optional[str], with_artifacts: bool = True
1626+
) -> dict:
16251627
"""
16261628
Common payload for all fedora-ci testing-farm jobs.
16271629
@@ -1637,7 +1639,9 @@ def _get_tf_base_payload(self, distro: str, compose: Optional[str]) -> dict:
16371639
artifacts = []
16381640
if self.koji_build:
16391641
variables["KOJI_TASK_ID"] = self.koji_build.task_id
1640-
artifacts.append({"id": self.koji_build.task_id, "type": "fedora-koji-build"})
1642+
# TODO: Drop this check with the switch to multihost-pipeline
1643+
if with_artifacts:
1644+
artifacts.append({"id": self.koji_build.task_id, "type": "fedora-koji-build"})
16411645

16421646
context = {
16431647
"distro": distro,

tests/integration/test_listen_to_fedmsg.py

Lines changed: 42 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -2676,38 +2676,46 @@ def test_koji_build_end_downstream(
26762676
koji_build_pr_downstream.should_receive("set_status").with_args("success").once()
26772677
koji_build_pr_downstream.should_receive("set_build_logs_urls")
26782678
koji_build_pr_downstream.should_receive("set_web_url")
2679-
common_payload_no_compose = {
2680-
"environments": [
2681-
{
2682-
"arch": "x86_64",
2683-
"variables": {
2684-
"KOJI_TASK_ID": "1",
2685-
},
2686-
"artifacts": [
2687-
{
2688-
"id": "1",
2689-
"type": "fedora-koji-build",
2679+
2680+
def _common_payload(*, with_compose: bool, with_artifact: bool):
2681+
_payload = {
2682+
"environments": [
2683+
{
2684+
"arch": "x86_64",
2685+
"variables": {
2686+
"KOJI_TASK_ID": "1",
26902687
},
2691-
],
2692-
"tmt": {
2693-
"context": {
2694-
"distro": distro,
2695-
"arch": "x86_64",
2696-
"trigger": "commit",
2697-
"initiator": "fedora-ci",
2698-
"dist-git-branch": "rawhide",
2699-
**extra_context,
2688+
"artifacts": [],
2689+
"tmt": {
2690+
"context": {
2691+
"distro": distro,
2692+
"arch": "x86_64",
2693+
"trigger": "commit",
2694+
"initiator": "fedora-ci",
2695+
"dist-git-branch": "rawhide",
2696+
**extra_context,
2697+
},
27002698
},
27012699
},
2700+
],
2701+
"notification": {
2702+
"webhook": {
2703+
"url": "https://stg.packit.dev/api/testing-farm/results",
2704+
"token": "secret token",
2705+
},
27022706
},
2703-
],
2704-
"notification": {
2705-
"webhook": {
2706-
"url": "https://stg.packit.dev/api/testing-farm/results",
2707-
"token": "secret token",
2708-
},
2709-
},
2710-
}
2707+
}
2708+
assert isinstance(_payload["environments"], list) # narrow type
2709+
if with_artifact:
2710+
_payload["environments"][0]["artifacts"] = [
2711+
{
2712+
"id": "1",
2713+
"type": "fedora-koji-build",
2714+
}
2715+
]
2716+
if with_compose:
2717+
_payload["environments"][0]["os"] = {"compose": compose}
2718+
return _payload
27112719

27122720
installability_repo = "https://github.com/fedora-ci/installability-pipeline.git"
27132721
payload_installability = {
@@ -2717,10 +2725,8 @@ def test_koji_build_end_downstream(
27172725
"ref": "master",
27182726
},
27192727
},
2720-
**common_payload_no_compose,
2728+
**_common_payload(with_compose=True, with_artifact=False),
27212729
}
2722-
payload_installability = copy.deepcopy(payload_installability)
2723-
payload_installability["environments"][0]["os"] = {"compose": compose}
27242730

27252731
rpminspect_repo = "https://github.com/fedora-ci/rpminspect-pipeline.git"
27262732
payload_rpminspect = {
@@ -2730,7 +2736,7 @@ def test_koji_build_end_downstream(
27302736
"ref": "master",
27312737
},
27322738
},
2733-
**common_payload_no_compose,
2739+
**_common_payload(with_compose=False, with_artifact=False),
27342740
}
27352741

27362742
rpmlint_repo = "https://github.com/packit/tmt-plans.git"
@@ -2743,7 +2749,7 @@ def test_koji_build_end_downstream(
27432749
"name": "/plans/rpmlint",
27442750
},
27452751
},
2746-
**common_payload_no_compose,
2752+
**_common_payload(with_compose=False, with_artifact=False),
27472753
}
27482754

27492755
shared_tests_repo = "https://forge.fedoraproject.org/ci/shared-tests"
@@ -2756,7 +2762,7 @@ def test_koji_build_end_downstream(
27562762
"name": "/rmdepcheck",
27572763
},
27582764
},
2759-
**common_payload_no_compose,
2765+
**_common_payload(with_compose=False, with_artifact=False),
27602766
}
27612767

27622768
payload_license_validate = {
@@ -2767,7 +2773,7 @@ def test_koji_build_end_downstream(
27672773
"name": "/license-validate",
27682774
},
27692775
},
2770-
**common_payload_no_compose,
2776+
**_common_payload(with_compose=False, with_artifact=False),
27712777
}
27722778

27732779
payload_custom = {
@@ -2777,37 +2783,7 @@ def test_koji_build_end_downstream(
27772783
"ref": "0011223344",
27782784
},
27792785
},
2780-
"environments": [
2781-
{
2782-
"arch": "x86_64",
2783-
"os": {"compose": compose},
2784-
"variables": {
2785-
"KOJI_TASK_ID": "1",
2786-
},
2787-
"artifacts": [
2788-
{
2789-
"id": "1",
2790-
"type": "fedora-koji-build",
2791-
},
2792-
],
2793-
"tmt": {
2794-
"context": {
2795-
"distro": distro,
2796-
"arch": "x86_64",
2797-
"trigger": "commit",
2798-
"initiator": "fedora-ci",
2799-
"dist-git-branch": "rawhide",
2800-
**extra_context,
2801-
},
2802-
},
2803-
},
2804-
],
2805-
"notification": {
2806-
"webhook": {
2807-
"url": "https://stg.packit.dev/api/testing-farm/results",
2808-
"token": "secret token",
2809-
},
2810-
},
2786+
**_common_payload(with_compose=True, with_artifact=True),
28112787
}
28122788

28132789
flexmock(aliases).should_receive("get_aliases").and_return({"fedora-all": [], "epel-all": []})

0 commit comments

Comments
 (0)