Skip to content

Commit

Permalink
[6.16.z] cvv incremental update and cv publish duration fix (#16196)
Browse files Browse the repository at this point in the history
  • Loading branch information
Satellite-QE authored Sep 5, 2024
1 parent 7a1cde2 commit a98dd24
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions robottelo/cli/contentview.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,12 @@ def version_info(cls, options, output_format=None):
return result

@classmethod
def version_incremental_update(cls, options):
def version_incremental_update(cls, options, output_format='csv'):
"""Performs incremental update of the content-view's version"""
cls.command_sub = 'version incremental-update'
if options is None:
options = {}
return cls.execute(cls._construct_command(options), output_format='csv')
return cls.execute(cls._construct_command(options), output_format=output_format)

@classmethod
def version_list(cls, options):
Expand Down
7 changes: 4 additions & 3 deletions tests/foreman/longrun/test_inc_updates.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,9 +286,10 @@ def test_positive_incremental_update_time(module_target_sat, module_sca_manifest
# expect: incr. "version-1.1" is created
update_start_time = datetime.utcnow()
result = module_target_sat.cli.ContentView.version_incremental_update(
{'content-view-version-id': cvv['id'], 'errata-ids': REAL_RHEL8_1_ERRATA_ID}
options={'content-view-version-id': cvv['id'], 'errata-ids': REAL_RHEL8_1_ERRATA_ID},
output_format='base',
)
assert 'version-1.1' in str(result[0].keys())
assert f'Content View: {cv.name} version 1.1' in result
update_duration = (datetime.utcnow() - update_start_time).total_seconds()
logger.info(
f'Update of incremental version-1.1, for CV id: {content_view["id"]},'
Expand All @@ -305,7 +306,7 @@ def test_positive_incremental_update_time(module_target_sat, module_sca_manifest
if update_duration >= publish_duration:
# unexpected: perhaps both tasks were very quick, took a handful of seconds,
# assert the difference was not significant (within 20%).
assert (update_duration - publish_duration) / publish_duration <= 0.2, (
assert (update_duration - publish_duration) / publish_duration <= 0.25, (
f'Incremental update took longer than publish of entire content-view id: {content_view["id"]}:'
f' Update took significantly more time, 20% or longer, than publish.'
f' update duration: {update_duration} s.\n publish duration: {publish_duration} s.'
Expand Down

0 comments on commit a98dd24

Please sign in to comment.