Add a test case for CCV publish dependency chaining#20914
Add a test case for CCV publish dependency chaining#20914vsedmik merged 2 commits intoSatelliteQE:masterfrom
Conversation
Reviewer's GuideAdds an automated API test that verifies composite content view (CCV) auto‑publish correctly chains and waits on multiple component content view publishes when they are triggered asynchronously and simultaneously. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 1 issue, and left some high level feedback:
- The test uses hard-coded future dates for the errata filter (
2025-07-01to2025-12-31), which may eventually cause the filter to match no content and make the test brittle over time; consider basing these dates relative to the current date or choosing a stable historical range known to contain errata. - The comparison
ccv_task.started_at >= latest_component_finishedimplicitly assumes these fields are comparable (e.g., parsed datetimes rather than strings); if they are strings from the API, consider normalizing them todatetimeobjects before comparison to avoid subtle ordering issues.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The test uses hard-coded future dates for the errata filter (`2025-07-01` to `2025-12-31`), which may eventually cause the filter to match no content and make the test brittle over time; consider basing these dates relative to the current date or choosing a stable historical range known to contain errata.
- The comparison `ccv_task.started_at >= latest_component_finished` implicitly assumes these fields are comparable (e.g., parsed datetimes rather than strings); if they are strings from the API, consider normalizing them to `datetime` objects before comparison to avoid subtle ordering issues.
## Individual Comments
### Comment 1
<location path="tests/foreman/api/test_contentview.py" line_range="2249-2250" />
<code_context>
+ comp.update(['latest'])
+
+ # 4. Asynchronously publish both component CVs (simultaneously).
+ rh_task = cv_rh.publish(synchronous=False)
+ custom_task = cv_custom.publish(synchronous=False)
+
+ # 5. Wait for the CCV publish task to be scheduled and wait until completed.
</code_context>
<issue_to_address>
**question:** Clarify or strengthen the concurrency aspect of the "simultaneous" publishes.
These publishes are still called sequentially, so “simultaneously” may be misleading. To better reflect the concurrency behavior, either (a) capture and assert the `started_at` times to verify the tasks actually overlap, or (b) reword the comment to clarify that both CVs are just enqueued as async tasks and overlap is not guaranteed. Making this explicit will help future readers understand the intended behavior.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
e1af490 to
2e2f249
Compare
|
PRT Result |
vijaysawant
left a comment
There was a problem hiding this comment.
Can we assert more specific return value of wait_for_tasks() which is defined inside robottelo/host_helpers? This function will return list and it would be true exiting publish tasks are running asynchronously.
vijaysawant
left a comment
There was a problem hiding this comment.
Let PRT pass and then merge it.
|
|
PRT Result |
ianballou
left a comment
There was a problem hiding this comment.
ACK from SME perspective, the steps make sense.
|
PRT Result |
|
|
PRT Result |
|
PRT failed ^ since we are still missing theforeman/foreman-tasks#788 in snap 5. Edit: But it seems to be present in snap 169. |
|
|
PRT Result |
Problem Statement
New approach has been taken for publishing CCVs to address SAT-24497 (when multiple component CVs are published simultaneously) and we should add coverage for that case.
Solution
This PR proposes such a test case.
Requires
theforeman/foreman-tasks#788
Katello/katello#11621
Related Issues
https://issues.redhat.com/browse/SAT-24497
PRT test Cases example
Summary by Sourcery
Tests: