Skip to content

Commit

Permalink
Remove synced_files from tests (#2698)
Browse files Browse the repository at this point in the history
Remove synced_files from tests

Reviewed-by: Laura Barcziová
  • Loading branch information
softwarefactory-project-zuul[bot] authored Jan 15, 2025
2 parents c2042db + 5034b9a commit 927dfc5
Show file tree
Hide file tree
Showing 10 changed files with 47 additions and 90 deletions.
14 changes: 7 additions & 7 deletions tests/integration/test_bodhi_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@

def test_bodhi_update_for_unknown_koji_build(koji_build_completed_old_format):
packit_yaml = (
"{'specfile_path': 'packit.spec', 'synced_files': [],"
"{'specfile_path': 'packit.spec',"
"'jobs': [{'trigger': 'commit', 'job': 'bodhi_update',"
"'metadata': {'dist_git_branches': ['rawhide']}}],"
"'downstream_package_name': 'packit'}"
Expand Down Expand Up @@ -628,7 +628,7 @@ def test_bodhi_update_for_unknown_koji_build_not_for_unfinished(
koji_build_start_old_format,
):
packit_yaml = (
"{'specfile_path': 'packit.spec', 'synced_files': [],"
"{'specfile_path': 'packit.spec',"
"'jobs': [{'trigger': 'commit', 'job': 'bodhi_update',"
"'metadata': {'dist_git_branches': ['rawhide']}}],"
"'downstream_package_name': 'packit'}"
Expand Down Expand Up @@ -712,7 +712,7 @@ def test_bodhi_update_for_unknown_koji_build_not_for_unfinished(

def test_bodhi_update_for_known_koji_build(koji_build_completed_old_format):
packit_yaml = (
"{'specfile_path': 'packit.spec', 'synced_files': [],"
"{'specfile_path': 'packit.spec',"
"'jobs': [{'trigger': 'commit', 'job': 'bodhi_update',"
"'metadata': {'dist_git_branches': ['rawhide']}}],"
"'downstream_package_name': 'packit'}"
Expand Down Expand Up @@ -804,7 +804,7 @@ def test_bodhi_update_for_known_koji_build(koji_build_completed_old_format):

def test_bodhi_update_for_not_configured_branch(koji_build_completed_old_format):
packit_yaml = (
"{'specfile_path': 'packit.spec', 'synced_files': [],"
"{'specfile_path': 'packit.spec',"
"'jobs': [{'trigger': 'commit', 'job': 'bodhi_update',"
"'metadata': {'dist_git_branches': ['a-different-branch']}}],"
"'downstream_package_name': 'packit'}"
Expand Down Expand Up @@ -865,7 +865,7 @@ def test_bodhi_update_for_not_configured_branch(koji_build_completed_old_format)
def test_bodhi_update_fedora_stable_by_default(koji_build_completed_f36):
"""(Known build scenario.)"""
packit_yaml = (
"{'specfile_path': 'python-ogr.spec', 'synced_files': [],"
"{'specfile_path': 'python-ogr.spec',"
"'jobs': [{'trigger': 'commit', 'job': 'bodhi_update', 'dist_git_branches': ['f36']}],"
"'downstream_package_name': 'python-ogr'}"
)
Expand Down Expand Up @@ -1045,7 +1045,7 @@ def test_bodhi_update_from_sidetag(
).with_args(sidetag_name).and_return(existing_update)

specfile_packit_yaml = (
"{'specfile_path': 'python-specfile.spec', 'synced_files': [],"
"{'specfile_path': 'python-specfile.spec',"
"'jobs': [{'trigger': 'commit', 'job': 'koji_build', 'sidetag_group': 'test',"
"'dependents': ['packit'], 'dist_git_branches': ['f40']}],"
"'downstream_package_name': 'python-specfile'}"
Expand Down Expand Up @@ -1079,7 +1079,7 @@ def test_bodhi_update_from_sidetag(
).and_return(specfile_pagure_project)

packit_packit_yaml = (
"{'specfile_path': 'packit.spec', 'synced_files': [],"
"{'specfile_path': 'packit.spec',"
"'jobs': [{'trigger': 'koji_build', 'job': 'bodhi_update', 'sidetag_group': 'test',"
"'dependencies': ['python-specfile'], 'dist_git_branches': ['f40']}],"
"'downstream_package_name': 'packit'}"
Expand Down
18 changes: 3 additions & 15 deletions tests/integration/test_check_rerun.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,7 @@ def check_rerun_event_propose_downstream():

@pytest.fixture
def mock_pr_functionality(request):
packit_yaml = (
"{'specfile_path': 'the-specfile.spec', 'synced_files': [], 'jobs':"
+ str(request.param)
+ "}"
)
packit_yaml = "{'specfile_path': 'the-specfile.spec', 'jobs':" + str(request.param) + "}"
flexmock(
GithubProject,
full_repo_name="packit/hello-world",
Expand Down Expand Up @@ -139,11 +135,7 @@ def mock_pr_functionality(request):

@pytest.fixture
def mock_push_functionality(request):
packit_yaml = (
"{'specfile_path': 'the-specfile.spec', 'synced_files': [], 'jobs':"
+ str(request.param)
+ "}"
)
packit_yaml = "{'specfile_path': 'the-specfile.spec', 'jobs':" + str(request.param) + "}"
flexmock(
GithubProject,
full_repo_name="packit/hello-world",
Expand Down Expand Up @@ -189,11 +181,7 @@ def mock_push_functionality(request):

@pytest.fixture
def mock_release_functionality(request):
packit_yaml = (
"{'specfile_path': 'the-specfile.spec', 'synced_files': [], 'jobs':"
+ str(request.param)
+ "}"
)
packit_yaml = "{'specfile_path': 'the-specfile.spec', 'jobs':" + str(request.param) + "}"
flexmock(
GithubProject,
full_repo_name="packit/hello-world",
Expand Down
6 changes: 1 addition & 5 deletions tests/integration/test_commit_comment.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,7 @@ def commit_build_comment_event():

@pytest.fixture
def mock_commit_comment_functionality(request):
packit_yaml = (
"{'specfile_path': 'the-specfile.spec', 'synced_files': [], 'jobs': "
+ str(request.param)
+ "}"
)
packit_yaml = "{'specfile_path': 'the-specfile.spec', 'jobs': " + str(request.param) + "}"

flexmock(
GithubProject,
Expand Down
10 changes: 5 additions & 5 deletions tests/integration/test_dg_commit.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def distgit_commit_event():

def test_sync_from_downstream():
packit_yaml = (
"{'specfile_path': 'buildah.spec', 'synced_files': [],"
"{'specfile_path': 'buildah.spec',"
"'jobs': [{'trigger': 'commit', 'job': 'sync_from_downstream'}],"
"'downstream_package_name': 'buildah'}"
)
Expand Down Expand Up @@ -139,7 +139,7 @@ def test_sync_from_downstream():

def test_do_not_sync_from_downstream_on_a_different_branch():
packit_yaml = (
"{'specfile_path': 'buildah.spec', 'synced_files': [],"
"{'specfile_path': 'buildah.spec',"
"'jobs': [{'trigger': 'commit', 'job': 'sync_from_downstream'}],"
"'downstream_package_name': 'buildah'}"
)
Expand Down Expand Up @@ -211,7 +211,7 @@ def test_do_not_sync_from_downstream_on_a_different_branch():
)
def test_downstream_koji_build(sidetag_group):
packit_yaml = (
"{'specfile_path': 'buildah.spec', 'synced_files': [],"
"{'specfile_path': 'buildah.spec',"
"'jobs': [{'trigger': 'commit', 'job': 'koji_build', 'allowed_committers':"
" ['rhcontainerbot']"
+ (f", 'sidetag_group': '{sidetag_group}'" if sidetag_group else "")
Expand Down Expand Up @@ -761,7 +761,7 @@ def test_downstream_koji_build_no_config():
)
def test_downstream_koji_build_where_multiple_branches_defined(jobs_config):
packit_yaml = (
"{'specfile_path': 'buildah.spec', 'synced_files': [],"
"{'specfile_path': 'buildah.spec',"
f"'jobs': {jobs_config},"
"'downstream_package_name': 'buildah'}"
)
Expand Down Expand Up @@ -899,7 +899,7 @@ def test_downstream_koji_build_where_multiple_branches_defined(jobs_config):
)
def test_do_not_run_downstream_koji_build_for_a_different_branch(jobs_config):
packit_yaml = (
"{'specfile_path': 'buildah.spec', 'synced_files': [],"
"{'specfile_path': 'buildah.spec',"
f"'jobs': {jobs_config},"
"'downstream_package_name': 'buildah'}"
)
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/test_koji_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
def test_downstream_koji_build_report_known_build(koji_build_fixture, request):
koji_build_event = request.getfixturevalue(koji_build_fixture.__name__)
packit_yaml = (
"{'specfile_path': 'python-ogr.spec', 'synced_files': [],"
"{'specfile_path': 'python-ogr.spec',"
"'jobs': [{'trigger': 'commit', 'job': 'koji_build'}],"
"'downstream_package_name': 'python-ogr'}"
)
Expand Down Expand Up @@ -119,7 +119,7 @@ def test_downstream_koji_build_report_known_build(koji_build_fixture, request):

def test_koji_build_error_msg(distgit_push_packit):
packit_yaml = (
"{'specfile_path': 'packit.spec', 'synced_files': [],"
"{'specfile_path': 'packit.spec',"
"'jobs': [{'trigger': 'commit', 'job': 'koji_build'}],"
"'downstream_package_name': 'python-ogr', 'issue_repository': "
"'https://github.com/packit/packit'}"
Expand Down
53 changes: 14 additions & 39 deletions tests/integration/test_pr_comment.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,7 @@ def pr_wrong_packit_comment_event():

@pytest.fixture
def mock_pr_comment_functionality(request):
packit_yaml = (
"{'specfile_path': 'the-specfile.spec', 'synced_files': [], 'jobs': "
+ str(request.param)
+ "}"
)
packit_yaml = "{'specfile_path': 'the-specfile.spec', 'jobs': " + str(request.param) + "}"

flexmock(
GithubProject,
Expand Down Expand Up @@ -402,7 +398,6 @@ def test_pr_comment_production_build_handler(pr_production_build_comment_event):
packit_yaml = str(
{
"specfile_path": "the-specfile.spec",
"synced_files": [],
"jobs": [
{
"trigger": "pull_request",
Expand Down Expand Up @@ -653,9 +648,7 @@ def test_pr_test_command_handler(
"metadata": {"targets": "fedora-rawhide-x86_64"},
},
]
packit_yaml = (
"{'specfile_path': 'the-specfile.spec', 'synced_files': [], 'jobs': " + str(jobs) + "}"
)
packit_yaml = "{'specfile_path': 'the-specfile.spec', 'jobs': " + str(jobs) + "}"
_ = add_pull_request_event_with_pr_id_9
pr = flexmock(head_commit="12345")
flexmock(GithubProject).should_receive("get_pr").and_return(pr)
Expand Down Expand Up @@ -741,9 +734,7 @@ def test_pr_test_command_handler_identifiers(
"metadata": {"targets": "fedora-rawhide-x86_64"},
},
]
packit_yaml = (
"{'specfile_path': 'the-specfile.spec', 'synced_files': [], 'jobs': " + str(jobs) + "}"
)
packit_yaml = "{'specfile_path': 'the-specfile.spec', 'jobs': " + str(jobs) + "}"
_ = add_pull_request_event_with_pr_id_9
pr = flexmock(head_commit="12345")
flexmock(GithubProject).should_receive("get_pr").and_return(pr)
Expand Down Expand Up @@ -906,9 +897,7 @@ def test_pr_test_command_handler_retries(
"metadata": {"targets": "fedora-rawhide-x86_64", "skip_build": True},
},
]
packit_yaml = (
"{'specfile_path': 'the-specfile.spec', 'synced_files': [], 'jobs': " + str(jobs) + "}"
)
packit_yaml = "{'specfile_path': 'the-specfile.spec', 'jobs': " + str(jobs) + "}"
_ = add_pull_request_event_with_sha_0011223344
pr = flexmock(
source_project=flexmock(
Expand Down Expand Up @@ -1109,9 +1098,7 @@ def test_pr_test_command_handler_skip_build_option(
"metadata": {"targets": "fedora-rawhide-x86_64", "skip_build": True},
},
]
packit_yaml = (
"{'specfile_path': 'the-specfile.spec', 'synced_files': [], 'jobs': " + str(jobs) + "}"
)
packit_yaml = "{'specfile_path': 'the-specfile.spec', 'jobs': " + str(jobs) + "}"
pr = flexmock(
source_project=flexmock(
get_web_url=lambda: "https://github.com/someone/hello-world",
Expand Down Expand Up @@ -1303,9 +1290,7 @@ def test_pr_test_command_handler_compose_not_present(
"metadata": {"targets": "fedora-rawhide-x86_64", "skip_build": True},
},
]
packit_yaml = (
"{'specfile_path': 'the-specfile.spec', 'synced_files': [], 'jobs': " + str(jobs) + "}"
)
packit_yaml = "{'specfile_path': 'the-specfile.spec', 'jobs': " + str(jobs) + "}"
_ = add_pull_request_event_with_sha_0011223344
pr = flexmock(
source_project=flexmock(
Expand Down Expand Up @@ -1432,9 +1417,7 @@ def test_pr_test_command_handler_composes_not_available(
"metadata": {"targets": "fedora-rawhide-x86_64", "skip_build": True},
},
]
packit_yaml = (
"{'specfile_path': 'the-specfile.spec', 'synced_files': [], 'jobs': " + str(jobs) + "}"
)
packit_yaml = "{'specfile_path': 'the-specfile.spec', 'jobs': " + str(jobs) + "}"
_ = add_pull_request_event_with_sha_0011223344
pr = flexmock(
source_project=flexmock(
Expand Down Expand Up @@ -1557,9 +1540,7 @@ def test_pr_test_command_handler_not_allowed_external_contributor_on_internal_TF
"metadata": {"targets": "fedora-rawhide-x86_64"},
},
]
packit_yaml = (
"{'specfile_path': 'the-specfile.spec', 'synced_files': [], 'jobs': " + str(jobs) + "}"
)
packit_yaml = "{'specfile_path': 'the-specfile.spec', 'jobs': " + str(jobs) + "}"
db_project_object, _ = add_pull_request_event_with_pr_id_9
pr = flexmock(head_commit="12345")
flexmock(GithubProject).should_receive("get_pr").and_return(pr)
Expand Down Expand Up @@ -1622,9 +1603,7 @@ def test_pr_build_command_handler_not_allowed_external_contributor_on_internal_T
"metadata": {"targets": "fedora-rawhide-x86_64"},
},
]
packit_yaml = (
"{'specfile_path': 'the-specfile.spec', 'synced_files': [], 'jobs': " + str(jobs) + "}"
)
packit_yaml = "{'specfile_path': 'the-specfile.spec', 'jobs': " + str(jobs) + "}"
pr = flexmock(head_commit="12345")
flexmock(GithubProject).should_receive("get_pr").and_return(pr)
comment = flexmock()
Expand Down Expand Up @@ -1870,9 +1849,7 @@ def test_pr_test_command_handler_skip_build_option_no_fmf_metadata(
"metadata": {"targets": "fedora-rawhide-x86_64", "skip_build": True},
},
]
packit_yaml = (
"{'specfile_path': 'the-specfile.spec', 'synced_files': [], 'jobs': " + str(jobs) + "}"
)
packit_yaml = "{'specfile_path': 'the-specfile.spec', 'jobs': " + str(jobs) + "}"
pr = flexmock(
source_project=flexmock(
get_web_url=lambda: "https://github.com/someone/hello-world",
Expand Down Expand Up @@ -2063,9 +2040,7 @@ def test_pr_test_command_handler_multiple_builds(
"metadata": {"targets": ["fedora-rawhide-x86_64", "fedora-35-x86_64"]},
},
]
packit_yaml = (
"{'specfile_path': 'the-specfile.spec', 'synced_files': [], 'jobs': " + str(jobs) + "}"
)
packit_yaml = "{'specfile_path': 'the-specfile.spec', 'jobs': " + str(jobs) + "}"
pr = flexmock(
source_project=flexmock(
get_web_url=lambda: "https://github.com/someone/hello-world",
Expand Down Expand Up @@ -2352,7 +2327,7 @@ def test_pr_test_command_handler_multiple_builds(

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

packit_yaml = (
"{'specfile_path': 'jouduv-dort.spec', 'synced_files': [],"
"{'specfile_path': 'jouduv-dort.spec',"
"'jobs': [{'trigger': 'commit', 'job': 'bodhi_update'}],"
"'downstream_package_name': 'jouduv-dort'}"
)
Expand Down Expand Up @@ -2985,7 +2960,7 @@ def _get_project(url, *_, **__):
)
def test_koji_build_tag_via_dist_git_pr_comment(pagure_pr_comment_added, all_branches):
packit_yaml = (
"{'specfile_path': 'python-teamcity-messages.spec', 'synced_files': [],"
"{'specfile_path': 'python-teamcity-messages.spec',"
"'jobs': [{'trigger': 'commit', 'job': 'koji_build', 'sidetag_group': 'test',"
"'dist_git_branches': ['fedora-stable']}],"
"'downstream_package_name': 'python-ogr', 'issue_repository': "
Expand Down
14 changes: 7 additions & 7 deletions tests/integration/test_release_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def test_dist_git_push_release_handle(
).and_return(sync_release_pr_model)

packit_yaml = (
"{'specfile_path': 'hello-world.spec', 'synced_files': []"
"{'specfile_path': 'hello-world.spec'"
", jobs: [{trigger: release, job: propose_downstream, metadata: {targets:[]}}]}"
)
flexmock(Github, get_repo=lambda full_name_or_id: None)
Expand Down Expand Up @@ -290,7 +290,7 @@ def test_dist_git_push_release_handle_multiple_branches(
sync_release_pr_model,
):
packit_yaml = (
"{'specfile_path': 'hello-world.spec', 'synced_files': []"
"{'specfile_path': 'hello-world.spec'"
", jobs: [{trigger: release, job: propose_downstream, "
"metadata: {targets:[], dist-git-branch: fedora-all}}]}"
)
Expand Down Expand Up @@ -426,7 +426,7 @@ def test_dist_git_push_release_handle_one_failed(
sync_release_pr_model,
):
packit_yaml = (
"{'specfile_path': 'hello-world.spec', 'synced_files': []"
"{'specfile_path': 'hello-world.spec'"
", jobs: [{trigger: release, job: propose_downstream, "
"targets:[], dist_git_branches: [fedora-all,]}]}"
)
Expand Down Expand Up @@ -590,7 +590,7 @@ def test_dist_git_push_release_handle_all_failed(
propose_downstream_target_models,
):
packit_yaml = (
"{'specfile_path': 'hello-world.spec', 'synced_files': []"
"{'specfile_path': 'hello-world.spec'"
", jobs: [{trigger: release, job: propose_downstream, "
"metadata: {targets:[], dist-git-branch: fedora-all}}]}"
)
Expand Down Expand Up @@ -730,7 +730,7 @@ def test_retry_propose_downstream_task(
).and_return(model)

packit_yaml = (
"{'specfile_path': 'hello-world.spec', 'synced_files': []"
"{'specfile_path': 'hello-world.spec'"
", jobs: [{trigger: release, job: propose_downstream, metadata: {targets:[]}}]}"
)
flexmock(Github, get_repo=lambda full_name_or_id: None)
Expand Down Expand Up @@ -848,7 +848,7 @@ def test_dont_retry_propose_downstream_task(
branch="main",
).and_return(model)
packit_yaml = (
"{'specfile_path': 'hello-world.spec', 'synced_files': []"
"{'specfile_path': 'hello-world.spec'"
", jobs: [{trigger: release, job: propose_downstream, metadata: {targets:[]}}]}"
)
flexmock(Github, get_repo=lambda full_name_or_id: None)
Expand Down Expand Up @@ -967,7 +967,7 @@ def test_dist_git_push_release_failed_issue_creation_disabled(
propose_downstream_target_models,
):
packit_yaml = (
"{'specfile_path': 'hello-world.spec', 'synced_files': []"
"{'specfile_path': 'hello-world.spec'"
", jobs: ["
"{trigger: release, job: propose_downstream, "
"targets:[], dist_git_branches: fedora-all, notifications: "
Expand Down
Loading

0 comments on commit 927dfc5

Please sign in to comment.