Skip to content

Commit 927dfc5

Browse files
Remove synced_files from tests (#2698)
Remove synced_files from tests Reviewed-by: Laura Barcziová
2 parents c2042db + 5034b9a commit 927dfc5

File tree

10 files changed

+47
-90
lines changed

10 files changed

+47
-90
lines changed

tests/integration/test_bodhi_update.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151

5252
def test_bodhi_update_for_unknown_koji_build(koji_build_completed_old_format):
5353
packit_yaml = (
54-
"{'specfile_path': 'packit.spec', 'synced_files': [],"
54+
"{'specfile_path': 'packit.spec',"
5555
"'jobs': [{'trigger': 'commit', 'job': 'bodhi_update',"
5656
"'metadata': {'dist_git_branches': ['rawhide']}}],"
5757
"'downstream_package_name': 'packit'}"
@@ -628,7 +628,7 @@ def test_bodhi_update_for_unknown_koji_build_not_for_unfinished(
628628
koji_build_start_old_format,
629629
):
630630
packit_yaml = (
631-
"{'specfile_path': 'packit.spec', 'synced_files': [],"
631+
"{'specfile_path': 'packit.spec',"
632632
"'jobs': [{'trigger': 'commit', 'job': 'bodhi_update',"
633633
"'metadata': {'dist_git_branches': ['rawhide']}}],"
634634
"'downstream_package_name': 'packit'}"
@@ -712,7 +712,7 @@ def test_bodhi_update_for_unknown_koji_build_not_for_unfinished(
712712

713713
def test_bodhi_update_for_known_koji_build(koji_build_completed_old_format):
714714
packit_yaml = (
715-
"{'specfile_path': 'packit.spec', 'synced_files': [],"
715+
"{'specfile_path': 'packit.spec',"
716716
"'jobs': [{'trigger': 'commit', 'job': 'bodhi_update',"
717717
"'metadata': {'dist_git_branches': ['rawhide']}}],"
718718
"'downstream_package_name': 'packit'}"
@@ -804,7 +804,7 @@ def test_bodhi_update_for_known_koji_build(koji_build_completed_old_format):
804804

805805
def test_bodhi_update_for_not_configured_branch(koji_build_completed_old_format):
806806
packit_yaml = (
807-
"{'specfile_path': 'packit.spec', 'synced_files': [],"
807+
"{'specfile_path': 'packit.spec',"
808808
"'jobs': [{'trigger': 'commit', 'job': 'bodhi_update',"
809809
"'metadata': {'dist_git_branches': ['a-different-branch']}}],"
810810
"'downstream_package_name': 'packit'}"
@@ -865,7 +865,7 @@ def test_bodhi_update_for_not_configured_branch(koji_build_completed_old_format)
865865
def test_bodhi_update_fedora_stable_by_default(koji_build_completed_f36):
866866
"""(Known build scenario.)"""
867867
packit_yaml = (
868-
"{'specfile_path': 'python-ogr.spec', 'synced_files': [],"
868+
"{'specfile_path': 'python-ogr.spec',"
869869
"'jobs': [{'trigger': 'commit', 'job': 'bodhi_update', 'dist_git_branches': ['f36']}],"
870870
"'downstream_package_name': 'python-ogr'}"
871871
)
@@ -1045,7 +1045,7 @@ def test_bodhi_update_from_sidetag(
10451045
).with_args(sidetag_name).and_return(existing_update)
10461046

10471047
specfile_packit_yaml = (
1048-
"{'specfile_path': 'python-specfile.spec', 'synced_files': [],"
1048+
"{'specfile_path': 'python-specfile.spec',"
10491049
"'jobs': [{'trigger': 'commit', 'job': 'koji_build', 'sidetag_group': 'test',"
10501050
"'dependents': ['packit'], 'dist_git_branches': ['f40']}],"
10511051
"'downstream_package_name': 'python-specfile'}"
@@ -1079,7 +1079,7 @@ def test_bodhi_update_from_sidetag(
10791079
).and_return(specfile_pagure_project)
10801080

10811081
packit_packit_yaml = (
1082-
"{'specfile_path': 'packit.spec', 'synced_files': [],"
1082+
"{'specfile_path': 'packit.spec',"
10831083
"'jobs': [{'trigger': 'koji_build', 'job': 'bodhi_update', 'sidetag_group': 'test',"
10841084
"'dependencies': ['python-specfile'], 'dist_git_branches': ['f40']}],"
10851085
"'downstream_package_name': 'packit'}"

tests/integration/test_check_rerun.py

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,7 @@ def check_rerun_event_propose_downstream():
9090

9191
@pytest.fixture
9292
def mock_pr_functionality(request):
93-
packit_yaml = (
94-
"{'specfile_path': 'the-specfile.spec', 'synced_files': [], 'jobs':"
95-
+ str(request.param)
96-
+ "}"
97-
)
93+
packit_yaml = "{'specfile_path': 'the-specfile.spec', 'jobs':" + str(request.param) + "}"
9894
flexmock(
9995
GithubProject,
10096
full_repo_name="packit/hello-world",
@@ -139,11 +135,7 @@ def mock_pr_functionality(request):
139135

140136
@pytest.fixture
141137
def mock_push_functionality(request):
142-
packit_yaml = (
143-
"{'specfile_path': 'the-specfile.spec', 'synced_files': [], 'jobs':"
144-
+ str(request.param)
145-
+ "}"
146-
)
138+
packit_yaml = "{'specfile_path': 'the-specfile.spec', 'jobs':" + str(request.param) + "}"
147139
flexmock(
148140
GithubProject,
149141
full_repo_name="packit/hello-world",
@@ -189,11 +181,7 @@ def mock_push_functionality(request):
189181

190182
@pytest.fixture
191183
def mock_release_functionality(request):
192-
packit_yaml = (
193-
"{'specfile_path': 'the-specfile.spec', 'synced_files': [], 'jobs':"
194-
+ str(request.param)
195-
+ "}"
196-
)
184+
packit_yaml = "{'specfile_path': 'the-specfile.spec', 'jobs':" + str(request.param) + "}"
197185
flexmock(
198186
GithubProject,
199187
full_repo_name="packit/hello-world",

tests/integration/test_commit_comment.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,7 @@ def commit_build_comment_event():
3939

4040
@pytest.fixture
4141
def mock_commit_comment_functionality(request):
42-
packit_yaml = (
43-
"{'specfile_path': 'the-specfile.spec', 'synced_files': [], 'jobs': "
44-
+ str(request.param)
45-
+ "}"
46-
)
42+
packit_yaml = "{'specfile_path': 'the-specfile.spec', 'jobs': " + str(request.param) + "}"
4743

4844
flexmock(
4945
GithubProject,

tests/integration/test_dg_commit.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def distgit_commit_event():
5454

5555
def test_sync_from_downstream():
5656
packit_yaml = (
57-
"{'specfile_path': 'buildah.spec', 'synced_files': [],"
57+
"{'specfile_path': 'buildah.spec',"
5858
"'jobs': [{'trigger': 'commit', 'job': 'sync_from_downstream'}],"
5959
"'downstream_package_name': 'buildah'}"
6060
)
@@ -139,7 +139,7 @@ def test_sync_from_downstream():
139139

140140
def test_do_not_sync_from_downstream_on_a_different_branch():
141141
packit_yaml = (
142-
"{'specfile_path': 'buildah.spec', 'synced_files': [],"
142+
"{'specfile_path': 'buildah.spec',"
143143
"'jobs': [{'trigger': 'commit', 'job': 'sync_from_downstream'}],"
144144
"'downstream_package_name': 'buildah'}"
145145
)
@@ -211,7 +211,7 @@ def test_do_not_sync_from_downstream_on_a_different_branch():
211211
)
212212
def test_downstream_koji_build(sidetag_group):
213213
packit_yaml = (
214-
"{'specfile_path': 'buildah.spec', 'synced_files': [],"
214+
"{'specfile_path': 'buildah.spec',"
215215
"'jobs': [{'trigger': 'commit', 'job': 'koji_build', 'allowed_committers':"
216216
" ['rhcontainerbot']"
217217
+ (f", 'sidetag_group': '{sidetag_group}'" if sidetag_group else "")
@@ -761,7 +761,7 @@ def test_downstream_koji_build_no_config():
761761
)
762762
def test_downstream_koji_build_where_multiple_branches_defined(jobs_config):
763763
packit_yaml = (
764-
"{'specfile_path': 'buildah.spec', 'synced_files': [],"
764+
"{'specfile_path': 'buildah.spec',"
765765
f"'jobs': {jobs_config},"
766766
"'downstream_package_name': 'buildah'}"
767767
)
@@ -899,7 +899,7 @@ def test_downstream_koji_build_where_multiple_branches_defined(jobs_config):
899899
)
900900
def test_do_not_run_downstream_koji_build_for_a_different_branch(jobs_config):
901901
packit_yaml = (
902-
"{'specfile_path': 'buildah.spec', 'synced_files': [],"
902+
"{'specfile_path': 'buildah.spec',"
903903
f"'jobs': {jobs_config},"
904904
"'downstream_package_name': 'buildah'}"
905905
)

tests/integration/test_koji_build.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
def test_downstream_koji_build_report_known_build(koji_build_fixture, request):
4646
koji_build_event = request.getfixturevalue(koji_build_fixture.__name__)
4747
packit_yaml = (
48-
"{'specfile_path': 'python-ogr.spec', 'synced_files': [],"
48+
"{'specfile_path': 'python-ogr.spec',"
4949
"'jobs': [{'trigger': 'commit', 'job': 'koji_build'}],"
5050
"'downstream_package_name': 'python-ogr'}"
5151
)
@@ -119,7 +119,7 @@ def test_downstream_koji_build_report_known_build(koji_build_fixture, request):
119119

120120
def test_koji_build_error_msg(distgit_push_packit):
121121
packit_yaml = (
122-
"{'specfile_path': 'packit.spec', 'synced_files': [],"
122+
"{'specfile_path': 'packit.spec',"
123123
"'jobs': [{'trigger': 'commit', 'job': 'koji_build'}],"
124124
"'downstream_package_name': 'python-ogr', 'issue_repository': "
125125
"'https://github.com/packit/packit'}"

tests/integration/test_pr_comment.py

Lines changed: 14 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,7 @@ def pr_wrong_packit_comment_event():
153153

154154
@pytest.fixture
155155
def mock_pr_comment_functionality(request):
156-
packit_yaml = (
157-
"{'specfile_path': 'the-specfile.spec', 'synced_files': [], 'jobs': "
158-
+ str(request.param)
159-
+ "}"
160-
)
156+
packit_yaml = "{'specfile_path': 'the-specfile.spec', 'jobs': " + str(request.param) + "}"
161157

162158
flexmock(
163159
GithubProject,
@@ -402,7 +398,6 @@ def test_pr_comment_production_build_handler(pr_production_build_comment_event):
402398
packit_yaml = str(
403399
{
404400
"specfile_path": "the-specfile.spec",
405-
"synced_files": [],
406401
"jobs": [
407402
{
408403
"trigger": "pull_request",
@@ -653,9 +648,7 @@ def test_pr_test_command_handler(
653648
"metadata": {"targets": "fedora-rawhide-x86_64"},
654649
},
655650
]
656-
packit_yaml = (
657-
"{'specfile_path': 'the-specfile.spec', 'synced_files': [], 'jobs': " + str(jobs) + "}"
658-
)
651+
packit_yaml = "{'specfile_path': 'the-specfile.spec', 'jobs': " + str(jobs) + "}"
659652
_ = add_pull_request_event_with_pr_id_9
660653
pr = flexmock(head_commit="12345")
661654
flexmock(GithubProject).should_receive("get_pr").and_return(pr)
@@ -741,9 +734,7 @@ def test_pr_test_command_handler_identifiers(
741734
"metadata": {"targets": "fedora-rawhide-x86_64"},
742735
},
743736
]
744-
packit_yaml = (
745-
"{'specfile_path': 'the-specfile.spec', 'synced_files': [], 'jobs': " + str(jobs) + "}"
746-
)
737+
packit_yaml = "{'specfile_path': 'the-specfile.spec', 'jobs': " + str(jobs) + "}"
747738
_ = add_pull_request_event_with_pr_id_9
748739
pr = flexmock(head_commit="12345")
749740
flexmock(GithubProject).should_receive("get_pr").and_return(pr)
@@ -906,9 +897,7 @@ def test_pr_test_command_handler_retries(
906897
"metadata": {"targets": "fedora-rawhide-x86_64", "skip_build": True},
907898
},
908899
]
909-
packit_yaml = (
910-
"{'specfile_path': 'the-specfile.spec', 'synced_files': [], 'jobs': " + str(jobs) + "}"
911-
)
900+
packit_yaml = "{'specfile_path': 'the-specfile.spec', 'jobs': " + str(jobs) + "}"
912901
_ = add_pull_request_event_with_sha_0011223344
913902
pr = flexmock(
914903
source_project=flexmock(
@@ -1109,9 +1098,7 @@ def test_pr_test_command_handler_skip_build_option(
11091098
"metadata": {"targets": "fedora-rawhide-x86_64", "skip_build": True},
11101099
},
11111100
]
1112-
packit_yaml = (
1113-
"{'specfile_path': 'the-specfile.spec', 'synced_files': [], 'jobs': " + str(jobs) + "}"
1114-
)
1101+
packit_yaml = "{'specfile_path': 'the-specfile.spec', 'jobs': " + str(jobs) + "}"
11151102
pr = flexmock(
11161103
source_project=flexmock(
11171104
get_web_url=lambda: "https://github.com/someone/hello-world",
@@ -1303,9 +1290,7 @@ def test_pr_test_command_handler_compose_not_present(
13031290
"metadata": {"targets": "fedora-rawhide-x86_64", "skip_build": True},
13041291
},
13051292
]
1306-
packit_yaml = (
1307-
"{'specfile_path': 'the-specfile.spec', 'synced_files': [], 'jobs': " + str(jobs) + "}"
1308-
)
1293+
packit_yaml = "{'specfile_path': 'the-specfile.spec', 'jobs': " + str(jobs) + "}"
13091294
_ = add_pull_request_event_with_sha_0011223344
13101295
pr = flexmock(
13111296
source_project=flexmock(
@@ -1432,9 +1417,7 @@ def test_pr_test_command_handler_composes_not_available(
14321417
"metadata": {"targets": "fedora-rawhide-x86_64", "skip_build": True},
14331418
},
14341419
]
1435-
packit_yaml = (
1436-
"{'specfile_path': 'the-specfile.spec', 'synced_files': [], 'jobs': " + str(jobs) + "}"
1437-
)
1420+
packit_yaml = "{'specfile_path': 'the-specfile.spec', 'jobs': " + str(jobs) + "}"
14381421
_ = add_pull_request_event_with_sha_0011223344
14391422
pr = flexmock(
14401423
source_project=flexmock(
@@ -1557,9 +1540,7 @@ def test_pr_test_command_handler_not_allowed_external_contributor_on_internal_TF
15571540
"metadata": {"targets": "fedora-rawhide-x86_64"},
15581541
},
15591542
]
1560-
packit_yaml = (
1561-
"{'specfile_path': 'the-specfile.spec', 'synced_files': [], 'jobs': " + str(jobs) + "}"
1562-
)
1543+
packit_yaml = "{'specfile_path': 'the-specfile.spec', 'jobs': " + str(jobs) + "}"
15631544
db_project_object, _ = add_pull_request_event_with_pr_id_9
15641545
pr = flexmock(head_commit="12345")
15651546
flexmock(GithubProject).should_receive("get_pr").and_return(pr)
@@ -1622,9 +1603,7 @@ def test_pr_build_command_handler_not_allowed_external_contributor_on_internal_T
16221603
"metadata": {"targets": "fedora-rawhide-x86_64"},
16231604
},
16241605
]
1625-
packit_yaml = (
1626-
"{'specfile_path': 'the-specfile.spec', 'synced_files': [], 'jobs': " + str(jobs) + "}"
1627-
)
1606+
packit_yaml = "{'specfile_path': 'the-specfile.spec', 'jobs': " + str(jobs) + "}"
16281607
pr = flexmock(head_commit="12345")
16291608
flexmock(GithubProject).should_receive("get_pr").and_return(pr)
16301609
comment = flexmock()
@@ -1870,9 +1849,7 @@ def test_pr_test_command_handler_skip_build_option_no_fmf_metadata(
18701849
"metadata": {"targets": "fedora-rawhide-x86_64", "skip_build": True},
18711850
},
18721851
]
1873-
packit_yaml = (
1874-
"{'specfile_path': 'the-specfile.spec', 'synced_files': [], 'jobs': " + str(jobs) + "}"
1875-
)
1852+
packit_yaml = "{'specfile_path': 'the-specfile.spec', 'jobs': " + str(jobs) + "}"
18761853
pr = flexmock(
18771854
source_project=flexmock(
18781855
get_web_url=lambda: "https://github.com/someone/hello-world",
@@ -2063,9 +2040,7 @@ def test_pr_test_command_handler_multiple_builds(
20632040
"metadata": {"targets": ["fedora-rawhide-x86_64", "fedora-35-x86_64"]},
20642041
},
20652042
]
2066-
packit_yaml = (
2067-
"{'specfile_path': 'the-specfile.spec', 'synced_files': [], 'jobs': " + str(jobs) + "}"
2068-
)
2043+
packit_yaml = "{'specfile_path': 'the-specfile.spec', 'jobs': " + str(jobs) + "}"
20692044
pr = flexmock(
20702045
source_project=flexmock(
20712046
get_web_url=lambda: "https://github.com/someone/hello-world",
@@ -2352,7 +2327,7 @@ def test_pr_test_command_handler_multiple_builds(
23522327

23532328
def test_koji_build_retrigger_via_dist_git_pr_comment(pagure_pr_comment_added):
23542329
packit_yaml = (
2355-
"{'specfile_path': 'python-teamcity-messages.spec', 'synced_files': [],"
2330+
"{'specfile_path': 'python-teamcity-messages.spec',"
23562331
"'jobs': [{'trigger': 'commit', 'job': 'koji_build'}],"
23572332
"'downstream_package_name': 'python-ogr', 'issue_repository': "
23582333
"'https://github.com/namespace/repo'}"
@@ -2492,7 +2467,7 @@ def test_bodhi_update_retrigger_via_dist_git_pr_comment(pagure_pr_comment_added)
24922467
project["url_path"] = "rpms/jouduv-dort"
24932468

24942469
packit_yaml = (
2495-
"{'specfile_path': 'jouduv-dort.spec', 'synced_files': [],"
2470+
"{'specfile_path': 'jouduv-dort.spec',"
24962471
"'jobs': [{'trigger': 'commit', 'job': 'bodhi_update'}],"
24972472
"'downstream_package_name': 'jouduv-dort'}"
24982473
)
@@ -2985,7 +2960,7 @@ def _get_project(url, *_, **__):
29852960
)
29862961
def test_koji_build_tag_via_dist_git_pr_comment(pagure_pr_comment_added, all_branches):
29872962
packit_yaml = (
2988-
"{'specfile_path': 'python-teamcity-messages.spec', 'synced_files': [],"
2963+
"{'specfile_path': 'python-teamcity-messages.spec',"
29892964
"'jobs': [{'trigger': 'commit', 'job': 'koji_build', 'sidetag_group': 'test',"
29902965
"'dist_git_branches': ['fedora-stable']}],"
29912966
"'downstream_package_name': 'python-ogr', 'issue_repository': "

tests/integration/test_release_event.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ def test_dist_git_push_release_handle(
164164
).and_return(sync_release_pr_model)
165165

166166
packit_yaml = (
167-
"{'specfile_path': 'hello-world.spec', 'synced_files': []"
167+
"{'specfile_path': 'hello-world.spec'"
168168
", jobs: [{trigger: release, job: propose_downstream, metadata: {targets:[]}}]}"
169169
)
170170
flexmock(Github, get_repo=lambda full_name_or_id: None)
@@ -290,7 +290,7 @@ def test_dist_git_push_release_handle_multiple_branches(
290290
sync_release_pr_model,
291291
):
292292
packit_yaml = (
293-
"{'specfile_path': 'hello-world.spec', 'synced_files': []"
293+
"{'specfile_path': 'hello-world.spec'"
294294
", jobs: [{trigger: release, job: propose_downstream, "
295295
"metadata: {targets:[], dist-git-branch: fedora-all}}]}"
296296
)
@@ -426,7 +426,7 @@ def test_dist_git_push_release_handle_one_failed(
426426
sync_release_pr_model,
427427
):
428428
packit_yaml = (
429-
"{'specfile_path': 'hello-world.spec', 'synced_files': []"
429+
"{'specfile_path': 'hello-world.spec'"
430430
", jobs: [{trigger: release, job: propose_downstream, "
431431
"targets:[], dist_git_branches: [fedora-all,]}]}"
432432
)
@@ -590,7 +590,7 @@ def test_dist_git_push_release_handle_all_failed(
590590
propose_downstream_target_models,
591591
):
592592
packit_yaml = (
593-
"{'specfile_path': 'hello-world.spec', 'synced_files': []"
593+
"{'specfile_path': 'hello-world.spec'"
594594
", jobs: [{trigger: release, job: propose_downstream, "
595595
"metadata: {targets:[], dist-git-branch: fedora-all}}]}"
596596
)
@@ -730,7 +730,7 @@ def test_retry_propose_downstream_task(
730730
).and_return(model)
731731

732732
packit_yaml = (
733-
"{'specfile_path': 'hello-world.spec', 'synced_files': []"
733+
"{'specfile_path': 'hello-world.spec'"
734734
", jobs: [{trigger: release, job: propose_downstream, metadata: {targets:[]}}]}"
735735
)
736736
flexmock(Github, get_repo=lambda full_name_or_id: None)
@@ -848,7 +848,7 @@ def test_dont_retry_propose_downstream_task(
848848
branch="main",
849849
).and_return(model)
850850
packit_yaml = (
851-
"{'specfile_path': 'hello-world.spec', 'synced_files': []"
851+
"{'specfile_path': 'hello-world.spec'"
852852
", jobs: [{trigger: release, job: propose_downstream, metadata: {targets:[]}}]}"
853853
)
854854
flexmock(Github, get_repo=lambda full_name_or_id: None)
@@ -967,7 +967,7 @@ def test_dist_git_push_release_failed_issue_creation_disabled(
967967
propose_downstream_target_models,
968968
):
969969
packit_yaml = (
970-
"{'specfile_path': 'hello-world.spec', 'synced_files': []"
970+
"{'specfile_path': 'hello-world.spec'"
971971
", jobs: ["
972972
"{trigger: release, job: propose_downstream, "
973973
"targets:[], dist_git_branches: fedora-all, notifications: "

0 commit comments

Comments
 (0)