-
Notifications
You must be signed in to change notification settings - Fork 705
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: ssg_test_suite.get_product_context: fake Product #10582
Conversation
Product does not have __setitem__ and here product_yaml is made as dict to mock real product. But we want to change Product for testing. So just update and thus product_yaml type is not changed.
Hi @maage. Thanks for your PR. I'm waiting for a ComplianceAsCode member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/packit build |
Code Climate has analyzed commit e3eab37 and detected 0 issues on this pull request. The test coverage on the diff in this pull request is 100.0% (50% is the threshold). This pull request will bring the total coverage in the repository to 52.5% (0.0% change). View more on Code Climate. |
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.
Hello @maage and thank you for the quick fix. Althought I can confirm that the fix solves the problem, I think it would be better to equip the ssg.products.Product class with the proper setitem method instead. Your fix would create a difference in product_yaml in the test suite and product_yaml in the rest of the project. As the whole concept of accessing product properties is going to be changed, I think my suggestion will make later work easier by keeping the API the same.
Tagging @matejak because he introduced the Product class.
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.
After further investigation, I found out that the fix I propose is not solving the problem - the product_yaml is expected to be a dictionary in some other parts of the test suite as well, it leads to the part where some Jinja substitutions happen.. Due to the fact that currently no testing with Automatus is possible and this situation affects basically all newly created PRs, I am merging this PR although the proper solution should be different I believe. I will also create upstream issue pointing to the problem.
Okay. Thank you for looking further. I think This issue could have been catched by |
Just for posterity, the relevant issue is #10583 |
Description:
Product does not have setitem and here product_yaml is made as dict to mock real product.
But we want to change Product for testing. So just update and thus product_yaml type is not changed.
Rationale:
Allow modify
Product
like atssg_test_suite
but not atssg
.Review Hints:
See failed test at #10574