From 56c58ae299c18ae2377ee0bd2695f61034f067ab Mon Sep 17 00:00:00 2001 From: David Moore Date: Thu, 25 Apr 2024 15:19:56 -0400 Subject: [PATCH] CI fix for CV publish tasks --- tests/foreman/api/test_contentview.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/foreman/api/test_contentview.py b/tests/foreman/api/test_contentview.py index 2cbeaf50860..38618cf6bfe 100644 --- a/tests/foreman/api/test_contentview.py +++ b/tests/foreman/api/test_contentview.py @@ -534,7 +534,7 @@ def test_positive_add_to_composite(self, content_view, module_org, module_target assert composite_cv.component[0].read().content_view.id == content_view.id @pytest.mark.tier2 - def test_negative_publish_during_repo_sync(self, content_view, module_target_sat): + def test_negative_publish_during_repo_sync(self, module_org, content_view, module_target_sat): """Attempt to publish a new version of the content-view, while an associated repository is being synced. @@ -552,6 +552,7 @@ def test_negative_publish_during_repo_sync(self, content_view, module_target_sat 2. HTTP exception raised, assert publish task failed for expected reason, repo sync task_id found in humanized error, content-view versions unchanged. """ + org = content_view.organization.read() # add repository to content-view content_view.repository = [self.yum_repo] content_view.update(['repository']) @@ -565,15 +566,14 @@ def test_negative_publish_during_repo_sync(self, content_view, module_target_sat with pytest.raises(HTTPError) as InternalServerError: content_view.publish() assert str(content_view.id) in str(InternalServerError) - # search for failed publish task - task_action = 'Actions::Katello::ContentView::Publish' + task_action = f"Publish content view '{content_view.name}', organization '{org.name}'" task_search = module_target_sat.api.ForemanTask().search( query={'search': f'{task_action} and started_at >= "{timestamp}"'} ) - assert len(task_search) == 1 + assert len(task_search) > 0 task_id = task_search[0].id - # task failed for expected reason + # publish task failed for expected reason task = module_target_sat.api.ForemanTask(id=task_id).poll(must_succeed=False) assert task['result'] == 'error' assert len(task['humanized']['errors']) == 1