Skip to content
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

added function for add_or_update_file #149

Closed
wants to merge 9 commits into from

Conversation

Sai-ganesh-0004
Copy link
Contributor

@Sai-ganesh-0004 Sai-ganesh-0004 commented Oct 26, 2024

Description

This PR adds unit tests to verify the functionality of the add_or_update_file function in allFileMetadata.py. These tests ensure that:

  • New file metadata is added correctly.
  • Metadata is updated when a file with the same hash already exists in the store.

The tests follow the project’s guidelines and use pytest for implementation.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Tests update

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • New and existing unit tests pass locally with my changes
  • I have maintained a clean commit history by using the necessary Git commands
  • I have checked that my code does not cause any merge conflicts

Screenshots (if applicable)

image

@Sai-ganesh-0004
Copy link
Contributor Author

I'm doing this under gssoc-ext so can you add the label

@techy4shri
Copy link
Collaborator

@Sai-ganesh-0004 resolve the issues with your PR. I can see one of the test cases has failed.

Copy link
Owner

@Kota-Karthik Kota-Karthik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Sai-ganesh-0004
You were not supposed to make any changes in twinTrim/dataStructures/allFileMetadata.py
whatever changes you have made in twinTrim/dataStructures/allFileMetadata.py , please revert them back
other than that tests look good
but workflows are failing
please fix it!

@Sai-ganesh-0004
Copy link
Contributor Author

Actually When I'm running it in my local environment it is working just fine. I don't know why it is not working here.
Maybe it is due to different versions of python working on GitHub and on my local terminal. Ill change and commit again.

image

@Sai-ganesh-0004
Copy link
Contributor Author

im using 3.10.8 so can you change the version in .github/workflows/test.yml.

@Sai-ganesh-0004
Copy link
Contributor Author

im using 3.10.8 so can you change the version in .github/workflows/test.yml.

should i change the version and push the changes again

Copy link
Contributor Author

@Sai-ganesh-0004 Sai-ganesh-0004 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have reverted the changes and made the code so that it is compatible with Python version 3.8

@techy4shri
Copy link
Collaborator

@Sai-ganesh-0004 it's not the python version which causes issues. 3.8 is min level of version which should be used for compatibility. Next time, make sure to follow dependencies installation instructions as stated in Readme to avoid such issues!
The workflow is working fine.

@Sai-ganesh-0004
Copy link
Contributor Author

@Sai-ganesh-0004 it's not the python version which causes issues. 3.8 is min level of version which should be used for compatibility. Next time, make sure to follow dependencies installation instructions as stated in Readme to avoid such issues! The workflow is working fine.

ok Sorry for the inconvenience. Are there any other issues?

Copy link
Owner

@Kota-Karthik Kota-Karthik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Sai-ganesh-0004
can you just squash all of your commits into one ?
We would just prefer and appreciate a cleaner commit history !
as soon as that is done , we will be merging this PR!

@Sai-ganesh-0004 Sai-ganesh-0004 closed this by deleting the head repository Oct 28, 2024
@techy4shri
Copy link
Collaborator

@Sai-ganesh-0004 why delete?

@Sai-ganesh-0004
Copy link
Contributor Author

created another pr i couldn't squash all the commits into one

@techy4shri
Copy link
Collaborator

Since you deleted it, we cannot do anything about it but here:
Also, please maintain a clean commit history by squashing all the commits. You can do so by follwowing the steps below:

  1. git fetch origin
  2. git rebase -i HEAD~N
  3. squash <commit message>
  4. git push --force

@techy4shri techy4shri added the REJECTED Pull request rejected label Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Write Tests for add_or_update_file Function
3 participants