-
Notifications
You must be signed in to change notification settings - Fork 65
[analyzer] Fix results for deleted files for CoCom backend #37
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
Conversation
Is it possible to add tests @inishchith ? |
@valeriocos As this requires deleted files in the version history, I'm not sure how do we proceed with adding tests for the changes. Edit:
|
You can start having a look at the setUpClass: grimoirelab-graal/tests/test_cocom.py Line 47 in 5dc57fa
It loads the repo available at: https://github.com/chaoss/grimoirelab-graal/tree/master/tests/data/graaltest.zip. To test your code, you can either create a new repo with some commits or add more commits to the existing one. A similar approach is also used in the tests for the Perceval git backend: |
@valeriocos Thanks for the help with a quick response!. |
153f0ad
to
22578ce
Compare
@valeriocos I've updated the PR with tests. Please do have a look when you get time. Thanks :) |
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.
Thank you @inishchith for the PR, overall it looks great. I have a couple of minor comments/questions:
- Why the values of deleted/renamed files are set to 0 and not to None ?
- Could you add some code in a test to check that the files deleted or renamed have their values properly set ?
- Could you squash the commits in just one and provide more details in the commit message ?
- Please increase the version of the cocom backend
Thanks
These files might have a history (analysis data in previous commits) and in case the comparison happens at the time of visualization at a point, 0 can be assigned instead of raising an exception on
Sorry, I missed that. Thanks for pointing it out!.
Sure!. @valeriocos I'll get back once I've worked on the proposed changes. |
Thank you for the quick reply @inishchith
I would go for |
There can be two scenarios, a deleted file and other renamed (or the one which has changed the directory). These changes handles both the cases. Alter test data to accomodate cases for deleted files results Signed-off-by: inishchith <[email protected]>
22578ce
to
3382cb4
Compare
@valeriocos I've made the required changes. Let me know if there are any more changes to be made. Thanks! |
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, thank you @inishchith and sorry for the late reply
@valeriocos Please have a look when convenient and let me know for any improvement that could be done.
Thanks!
Signed-off-by: inishchith [email protected]