-
Notifications
You must be signed in to change notification settings - Fork 119
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
Implement a proper testing framework (GSoC23) #1079
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is my first pull request on how I have tried to mock a test, I used FakePkg class and tried to modify an existing test. I have created a new helper function get_tested_mock_package which helps to create a FakePkg obj, this object is further passed to tests.
…e API, instead of just kwargs
modified to use dict methods in get_tested_mock_package
Test that required FakePkg has been abstracted and hence do not necessarily need to be imported
Github Actions changes to be merged
This commit removes two binary rpm files that were used for testing docs and docs modules in python packages, for which tests are mocking has been implemented
In add_file_with_content function, changes were made to check for any type prior it was only checked for True
created an another test (test_python_dependencies_metadata2) which helps to get rid of a binary file python310-jupyter-server-fileid-0.9.0-7.2.noarch.rpm
In this commit, I have mocked another metadata test, that checks for metadata content in python packages. With this test we can get rid of binary file: python310-scikit-build-0.17.2-41.1.noarch.rpm. The new test function is test_python_dependencies_metadata3
…tatements In this commit, I have completely removed previous paramatrized tests for 5 binaries, and also added another test test_python_dependencies_metadata4
afrid18
force-pushed
the
GSoC23
branch
4 times, most recently
from
July 6, 2023 17:58
3c34474
to
d3d5f18
Compare
…rom metadata and requires.txt
afrid18
force-pushed
the
GSoC23
branch
2 times, most recently
from
July 10, 2023 08:45
76ff584
to
7d8ab46
Compare
danigm
reviewed
Jul 11, 2023
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.
Good work, we've starting to have some tests replaced with FakePkg
.
As this is managed by PR-CI, No need of checking them again on branch
Pkg and FakePkg both use _gather_dep_info and _gather_aux so moved them to their parent class AbstractPkg
…ested_mock_package Added a new helper method in FakePkg called create_files this will avoid if else chain in get_tested_mock_package utility
afrid18
force-pushed
the
GSoC23
branch
4 times, most recently
from
August 7, 2023 08:53
97b73f8
to
acc5e85
Compare
added a new helper method in FakePkg class which is initiate_files_base_data, this is used to initiate fakepkg class with basic files data after setting up custom metadata; removed a binary other binary is required for file
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This PR is intended work of Google Summer of Code 2023 Project. This project aims to get rid of binary rpm packages that are being used for testing rpmlint codebase because RPM packages consume relatively more space. Hence mocking them in a way which no longer need Binary RPM packages just for testing purposes.
Description
In this PR, I have mainly worked on PythonCheck tests, which I eventually able to remove 6 binary files after mocking those tests. This approach can be carry forwarded to other checks as well.