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

test:add tests for fileinfo.go #1138

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

satyazzz123
Copy link
Contributor

added tests for fileinfo.go functions

fixes a part of: #884

Copy link

Thanks for making a pull request! 😃
One of the maintainers will review and advise on the next steps.

@github-actions github-actions bot added the test label Jan 28, 2024
Copy link

codecov bot commented Jan 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (3fd2033) 14.85% compared to head (b682725) 14.95%.

❗ Current head b682725 differs from pull request most recent head c5fc7ca. Consider uploading reports for the commit c5fc7ca to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1138      +/-   ##
==========================================
+ Coverage   14.85%   14.95%   +0.09%     
==========================================
  Files          90       90              
  Lines        8379     8379              
==========================================
+ Hits         1245     1253       +8     
+ Misses       6813     6805       -8     
  Partials      321      321              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@satyazzz123
Copy link
Contributor Author

@kmehant @seshapad @HarikrishnanBalagopal I have raised a PR for testing fileinfo.go. Please have a look

@kmehant
Copy link
Member

kmehant commented Jan 28, 2024

@satyazzz123 thank you for the PR. Shall we close this PR (#1124) first before we move on to new ones? Please update the PR when you are able to and let us know. Appreciate your contributions.

@satyazzz123
Copy link
Contributor Author

@satyazzz123 thank you for the PR. Shall we close this PR (#1124) first before we move on to new ones? Please update the PR when you are able to and let us know. Appreciate your contributions.

Almost done with the changes will push those changes for #1124 . Sorry for the delay.

Comment on lines 29 to 42
expectedName := "testfile.txt"
fileInfo := &FileInfo{
stat: types.ContainerPathStat{
Name: expectedName,
},
}
Copy link
Member

Choose a reason for hiding this comment

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

lets try getting types.ContainerPathStat from any simple operation rather than constructing it ourselves and then pass it. We are not actually testing much here by constructing the struct ourselves.

Copy link
Member

Choose a reason for hiding this comment

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

lets try the same (#1138 (comment)) for all of your other test functions in this PR. Thanks.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got it working on the requested changes

Signed-off-by: satyazzz123 <[email protected]>
Signed-off-by: satyazzz123 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants