-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix tests from repositories component #16227
fix tests from repositories component #16227
Conversation
|
1 similar comment
|
PRT Result
|
|
PRT Result
|
7310f16
to
7975314
Compare
|
PRT Result
|
tests/foreman/api/test_product.py
Outdated
@@ -209,8 +209,8 @@ def test_positive_filter_product_list(module_sca_manifest_org, module_target_sat | |||
query={'redhat_only': True, 'per_page': 1000} | |||
) | |||
|
|||
assert len(custom_products) == 1 | |||
assert product.name == custom_products[0].name | |||
assert len(custom_products) >= 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we know what else is returned by the search on L207 and why? Is it another custom product created by another test within the same org?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when we run whole test module, at L207 we get list of more than one custom products, so at this assertion L212, using greater than one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then the assertion doesn't make much sense to me. It just asserts that one of the test in the module (no matter which one) created some custom product.
We can go with function-scoped org and assert == 1
or remove this assertion and rely on the next one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, removing this assertion, if we use function scoped org then another assertion need to adjust (len of rh_products > 1)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes agree with @vsedmik , we could scope by function_org
and should only have the one created,
or you should able to narrow the search of custom products in module_org
, by the name/id/label of the one created just prior?
Do you ~need/expect multiple custom products, or is this just handling when multiple are present?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@damoore044 If we look at L207, custom_product is being search using organization, another test create custom product hence it is giving more than one custom product.
I would remove the assertion and will rely on next one.
7975314
to
0d1b21d
Compare
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack nice!
pending prior comments and nonblocking thoughts on the first assertion.
tests/foreman/api/test_product.py
Outdated
@@ -209,8 +209,8 @@ def test_positive_filter_product_list(module_sca_manifest_org, module_target_sat | |||
query={'redhat_only': True, 'per_page': 1000} | |||
) | |||
|
|||
assert len(custom_products) == 1 | |||
assert product.name == custom_products[0].name | |||
assert len(custom_products) >= 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes agree with @vsedmik , we could scope by function_org
and should only have the one created,
or you should able to narrow the search of custom products in module_org
, by the name/id/label of the one created just prior?
Do you ~need/expect multiple custom products, or is this just handling when multiple are present?
PRT Result
|
|
PRT Result
|
|
PRT Result
|
a9ac75d
to
0d1b21d
Compare
|
PRT Result
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Is the do_not_merge
label still valid @vijaysawant ?
(cherry picked from commit 14efc53)
Problem Statement
[6.16.0] TFA - Compoenent repositories has few tests failing with minor issue, DISTRIBUTOR_CONFLICT , Assertion Error, etc
api/test_product.py::test_positive_filter_product_list
api/test_repositories.py::test_negative_upload_expired_manifest
api/test_repositories.py::test_positive_sync_mulitple_large_repos
Solution
This PR will address those failures
Related Issues
N/A
PRT test Cases example