Skip to content

Commit a42d585

Browse files
Add rpmlint Fedora-CI runners by default (#2856)
Add rpmlint Fedora-CI runners by default Follow-up to #2845. With this the parity with zuul should be all in place. TODO: Write new tests or update the old ones to cover new functionality. Merge after packit/tmt-plans#23 RELEASE NOTES BEGIN Rpmlint are now run in Fedora-CI by default. RELEASE NOTES END Reviewed-by: gemini-code-assist[bot] Reviewed-by: Laura Barcziová Reviewed-by: Matej Focko
2 parents 8893872 + ffcda40 commit a42d585

File tree

3 files changed

+94
-9
lines changed

3 files changed

+94
-9
lines changed

packit_service/worker/helpers/testing_farm.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1475,6 +1475,22 @@ def _payload_rpminspect(self, distro: str, compose: str) -> dict:
14751475
}
14761476
return payload
14771477

1478+
@implements_fedora_ci_test("rpmlint")
1479+
def _payload_rpmlint(self, distro: str, compose: str) -> dict:
1480+
git_repo = "https://github.com/packit/tmt-plans.git"
1481+
git_ref = "main"
1482+
# rpmlint defines its own container in the tmt plan file,
1483+
# hence `compose=None`
1484+
payload = self._get_tf_base_payload(distro, None)
1485+
payload["test"] = {
1486+
"tmt": {
1487+
"url": git_repo,
1488+
"ref": git_ref,
1489+
"name": "/plans/rpmlint",
1490+
},
1491+
}
1492+
return payload
1493+
14781494
@staticmethod
14791495
def is_fmf_configured(project: GitProject, metadata: EventData) -> bool:
14801496
try:

tests/integration/test_listen_to_fedmsg.py

Lines changed: 75 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2663,14 +2663,7 @@ def test_koji_build_end_downstream(
26632663
}
26642664

26652665
rpminspect_repo = "https://github.com/fedora-ci/rpminspect-pipeline.git"
2666-
2667-
payload_rpminspect = {
2668-
"test": {
2669-
"tmt": {
2670-
"url": rpminspect_repo,
2671-
"ref": "master",
2672-
},
2673-
},
2666+
common_payload_no_compose = {
26742667
"environments": [
26752668
{
26762669
"arch": "x86_64",
@@ -2701,6 +2694,29 @@ def test_koji_build_end_downstream(
27012694
},
27022695
}
27032696

2697+
payload_rpminspect = {
2698+
"test": {
2699+
"tmt": {
2700+
"url": rpminspect_repo,
2701+
"ref": "master",
2702+
},
2703+
},
2704+
**common_payload_no_compose,
2705+
}
2706+
2707+
rpmlint_repo = "https://github.com/packit/tmt-plans.git"
2708+
2709+
payload_rpmlint = {
2710+
"test": {
2711+
"tmt": {
2712+
"url": rpmlint_repo,
2713+
"ref": "main",
2714+
"name": "/plans/rpmlint",
2715+
},
2716+
},
2717+
**common_payload_no_compose,
2718+
}
2719+
27042720
payload_custom = {
27052721
"test": {
27062722
"tmt": {
@@ -2772,6 +2788,16 @@ def test_koji_build_end_downstream(
27722788
json={"id": pipeline_id},
27732789
),
27742790
).once()
2791+
flexmock(TestingFarmClient).should_receive(
2792+
"send_testing_farm_request",
2793+
).with_args(endpoint="requests", method="POST", data=payload_rpmlint).and_return(
2794+
RequestResponse(
2795+
status_code=200,
2796+
ok=True,
2797+
content=json.dumps({"id": pipeline_id}).encode(),
2798+
json={"id": pipeline_id},
2799+
),
2800+
).once()
27752801
flexmock(TestingFarmClient).should_receive(
27762802
"send_testing_farm_request",
27772803
).with_args(endpoint="requests", method="POST", data=payload_custom).and_return(
@@ -2822,11 +2848,25 @@ def test_koji_build_end_downstream(
28222848
.once()
28232849
.mock()
28242850
)
2851+
tft_test_run_model_rpmlint = (
2852+
flexmock(
2853+
id=8,
2854+
koji_builds=[koji_build_pr_downstream],
2855+
status=TestingFarmResult.new,
2856+
target="fedora-rawhide",
2857+
data={"fedora_ci_test": "rpmlint"},
2858+
)
2859+
.should_receive("set_pipeline_id")
2860+
.with_args(pipeline_id)
2861+
.once()
2862+
.mock()
2863+
)
28252864
group = flexmock(
28262865
grouped_targets=[
28272866
tft_test_run_model_installability,
28282867
tft_test_run_model_custom,
28292868
tft_test_run_model_rpminspect,
2869+
tft_test_run_model_rpmlint,
28302870
]
28312871
)
28322872
flexmock(TFTTestRunGroupModel).should_receive("create").with_args(
@@ -2872,6 +2912,19 @@ def test_koji_build_end_downstream(
28722912
"fedora_ci_test": "rpminspect",
28732913
},
28742914
).and_return(tft_test_run_model_rpminspect).once()
2915+
flexmock(TFTTestRunTargetModel).should_receive("create").with_args(
2916+
pipeline_id=None,
2917+
identifier=None,
2918+
status=TestingFarmResult.new,
2919+
target="fedora-rawhide",
2920+
web_url=None,
2921+
test_run_group=group,
2922+
koji_build_targets=[koji_build_pr_downstream],
2923+
data={
2924+
"base_project_url": "https://src.fedoraproject.org/rpms/packit",
2925+
"fedora_ci_test": "rpmlint",
2926+
},
2927+
).and_return(tft_test_run_model_rpmlint).once()
28752928

28762929
# check if packit-service set correct PR statuses
28772930
flexmock(StatusReporter).should_receive("set_status").with_args(
@@ -2923,6 +2976,20 @@ def test_koji_build_end_downstream(
29232976
check_name="Packit - rpminspect test(s)",
29242977
target_branch="rawhide",
29252978
).once()
2979+
flexmock(StatusReporter).should_receive("set_status").with_args(
2980+
state=BaseCommitStatus.running,
2981+
description="Submitting the tests ...",
2982+
url="",
2983+
check_name="Packit - rpmlint test(s)",
2984+
target_branch="rawhide",
2985+
).once()
2986+
flexmock(StatusReporter).should_receive("set_status").with_args(
2987+
state=BaseCommitStatus.running,
2988+
description="Tests have been submitted ...",
2989+
url="https://dashboard.localhost/jobs/testing-farm/8",
2990+
check_name="Packit - rpmlint test(s)",
2991+
target_branch="rawhide",
2992+
).once()
29262993

29272994
urls.DASHBOARD_URL = "https://dashboard.localhost"
29282995

tests/integration/test_pr_comment.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3446,6 +3446,7 @@ def _test_downstream_tf_retrigger_common(
34463446
[
34473447
("380723461ab74e1cde4eb89b711c8f1d", "Packit - installability test(s) - rawhide"),
34483448
("27516f942959e4114b2856f76852577a", "Packit - rpminspect test(s) - rawhide"),
3449+
("e02f17936a385a5031056e304b9c5de6", "Packit - rpmlint test(s) - rawhide"),
34493450
],
34503451
id="rawhide target branch",
34513452
),
@@ -3454,6 +3455,7 @@ def _test_downstream_tf_retrigger_common(
34543455
[
34553456
("a478035df5f8599527e3e37bfc2ca25f", "Packit - installability test(s) - f42"),
34563457
("e9d900e81542cc243d51d9058f1845d3", "Packit - rpminspect test(s) - f42"),
3458+
("a4de9ef7a17005c5404c54acab49d599", "Packit - rpmlint test(s) - f42"),
34573459
],
34583460
id="f42 target branch",
34593461
),
@@ -3469,7 +3471,7 @@ def test_downstream_testing_farm_retrigger_via_dist_git_pr_comment(
34693471
target_branch,
34703472
flags,
34713473
"/packit-ci test",
3472-
tests=2,
3474+
tests=3,
34733475
)
34743476

34753477

0 commit comments

Comments
 (0)