Skip to content

Commit

Permalink
CI fix for CV publish tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
damoore044 committed Apr 29, 2024
1 parent de93ea2 commit 56c58ae
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/foreman/api/test_contentview.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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'])
Expand All @@ -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
Expand Down

0 comments on commit 56c58ae

Please sign in to comment.