Skip to content

Commit

Permalink
Remove synced_files from tests
Browse files Browse the repository at this point in the history
  • Loading branch information
majamassarini committed Jan 15, 2025
1 parent c2042db commit 33575f8
Show file tree
Hide file tree
Showing 10 changed files with 47 additions and 50 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
6 changes: 3 additions & 3 deletions tests/integration/test_check_rerun.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def check_rerun_event_propose_downstream():
@pytest.fixture
def mock_pr_functionality(request):
packit_yaml = (
"{'specfile_path': 'the-specfile.spec', 'synced_files': [], 'jobs':"
"{'specfile_path': 'the-specfile.spec', 'jobs':"
+ str(request.param)
+ "}"
)
Expand Down Expand Up @@ -140,7 +140,7 @@ def mock_pr_functionality(request):
@pytest.fixture
def mock_push_functionality(request):
packit_yaml = (
"{'specfile_path': 'the-specfile.spec', 'synced_files': [], 'jobs':"
"{'specfile_path': 'the-specfile.spec', 'jobs':"
+ str(request.param)
+ "}"
)
Expand Down Expand Up @@ -190,7 +190,7 @@ def mock_push_functionality(request):
@pytest.fixture
def mock_release_functionality(request):
packit_yaml = (
"{'specfile_path': 'the-specfile.spec', 'synced_files': [], 'jobs':"
"{'specfile_path': 'the-specfile.spec', 'jobs':"
+ str(request.param)
+ "}"
)
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/test_commit_comment.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def commit_build_comment_event():
@pytest.fixture
def mock_commit_comment_functionality(request):
packit_yaml = (
"{'specfile_path': 'the-specfile.spec', 'synced_files': [], 'jobs': "
"{'specfile_path': 'the-specfile.spec', 'jobs': "
+ str(request.param)
+ "}"
)
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
29 changes: 14 additions & 15 deletions tests/integration/test_pr_comment.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,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': "
"{'specfile_path': 'the-specfile.spec', 'jobs': "
+ str(request.param)
+ "}"
)
Expand Down Expand Up @@ -402,7 +402,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 @@ -654,7 +653,7 @@ def test_pr_test_command_handler(
},
]
packit_yaml = (
"{'specfile_path': 'the-specfile.spec', 'synced_files': [], 'jobs': " + str(jobs) + "}"
"{'specfile_path': 'the-specfile.spec', 'jobs': " + str(jobs) + "}"
)
_ = add_pull_request_event_with_pr_id_9
pr = flexmock(head_commit="12345")
Expand Down Expand Up @@ -742,7 +741,7 @@ def test_pr_test_command_handler_identifiers(
},
]
packit_yaml = (
"{'specfile_path': 'the-specfile.spec', 'synced_files': [], 'jobs': " + str(jobs) + "}"
"{'specfile_path': 'the-specfile.spec', 'jobs': " + str(jobs) + "}"
)
_ = add_pull_request_event_with_pr_id_9
pr = flexmock(head_commit="12345")
Expand Down Expand Up @@ -907,7 +906,7 @@ def test_pr_test_command_handler_retries(
},
]
packit_yaml = (
"{'specfile_path': 'the-specfile.spec', 'synced_files': [], 'jobs': " + str(jobs) + "}"
"{'specfile_path': 'the-specfile.spec', 'jobs': " + str(jobs) + "}"
)
_ = add_pull_request_event_with_sha_0011223344
pr = flexmock(
Expand Down Expand Up @@ -1110,7 +1109,7 @@ def test_pr_test_command_handler_skip_build_option(
},
]
packit_yaml = (
"{'specfile_path': 'the-specfile.spec', 'synced_files': [], 'jobs': " + str(jobs) + "}"
"{'specfile_path': 'the-specfile.spec', 'jobs': " + str(jobs) + "}"
)
pr = flexmock(
source_project=flexmock(
Expand Down Expand Up @@ -1304,7 +1303,7 @@ def test_pr_test_command_handler_compose_not_present(
},
]
packit_yaml = (
"{'specfile_path': 'the-specfile.spec', 'synced_files': [], 'jobs': " + str(jobs) + "}"
"{'specfile_path': 'the-specfile.spec', 'jobs': " + str(jobs) + "}"
)
_ = add_pull_request_event_with_sha_0011223344
pr = flexmock(
Expand Down Expand Up @@ -1433,7 +1432,7 @@ def test_pr_test_command_handler_composes_not_available(
},
]
packit_yaml = (
"{'specfile_path': 'the-specfile.spec', 'synced_files': [], 'jobs': " + str(jobs) + "}"
"{'specfile_path': 'the-specfile.spec', 'jobs': " + str(jobs) + "}"
)
_ = add_pull_request_event_with_sha_0011223344
pr = flexmock(
Expand Down Expand Up @@ -1558,7 +1557,7 @@ def test_pr_test_command_handler_not_allowed_external_contributor_on_internal_TF
},
]
packit_yaml = (
"{'specfile_path': 'the-specfile.spec', 'synced_files': [], 'jobs': " + str(jobs) + "}"
"{'specfile_path': 'the-specfile.spec', 'jobs': " + str(jobs) + "}"
)
db_project_object, _ = add_pull_request_event_with_pr_id_9
pr = flexmock(head_commit="12345")
Expand Down Expand Up @@ -1623,7 +1622,7 @@ def test_pr_build_command_handler_not_allowed_external_contributor_on_internal_T
},
]
packit_yaml = (
"{'specfile_path': 'the-specfile.spec', 'synced_files': [], 'jobs': " + str(jobs) + "}"
"{'specfile_path': 'the-specfile.spec', 'jobs': " + str(jobs) + "}"
)
pr = flexmock(head_commit="12345")
flexmock(GithubProject).should_receive("get_pr").and_return(pr)
Expand Down Expand Up @@ -1871,7 +1870,7 @@ def test_pr_test_command_handler_skip_build_option_no_fmf_metadata(
},
]
packit_yaml = (
"{'specfile_path': 'the-specfile.spec', 'synced_files': [], 'jobs': " + str(jobs) + "}"
"{'specfile_path': 'the-specfile.spec', 'jobs': " + str(jobs) + "}"
)
pr = flexmock(
source_project=flexmock(
Expand Down Expand Up @@ -2064,7 +2063,7 @@ def test_pr_test_command_handler_multiple_builds(
},
]
packit_yaml = (
"{'specfile_path': 'the-specfile.spec', 'synced_files': [], 'jobs': " + str(jobs) + "}"
"{'specfile_path': 'the-specfile.spec', 'jobs': " + str(jobs) + "}"
)
pr = flexmock(
source_project=flexmock(
Expand Down Expand Up @@ -2352,7 +2351,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 +2491,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 +2984,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
1 change: 0 additions & 1 deletion tests/integration/test_vm_image_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
def test_vm_image_build(github_vm_image_build_comment):
packit_yaml = (
"{'specfile_path': 'python-knx-stack.spec',"
" 'synced_files': [],"
" 'jobs': [{"
" 'job': 'vm_image_build',"
" 'trigger': 'pull_request',"
Expand Down
Loading

0 comments on commit 33575f8

Please sign in to comment.