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: added test for mergeProcessFileCallBack function #1121

Merged
merged 3 commits into from
Dec 14, 2023

Conversation

satyazzz123
Copy link
Contributor

test for mergeProcessFileCallBack function

i) this test covers a scenario when the source and destination files are of same content.

fixes a part of #881

Signed-off-by: satyazzz123 <beherasatyajit716@gmail.com>
Copy link

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

Copy link

codecov bot commented Dec 13, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (0bbafac) 14.76% compared to head (33d1c13) 14.82%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1121      +/-   ##
==========================================
+ Coverage   14.76%   14.82%   +0.05%     
==========================================
  Files          90       90              
  Lines        8379     8379              
==========================================
+ Hits         1237     1242       +5     
+ Misses       6824     6818       -6     
- Partials      318      319       +1     

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

@satyazzz123
Copy link
Contributor Author

@kmehant @seshapad please review this PR.

@seshapad seshapad changed the title added test for mergeProcessFileCallBack function test: added test for mergeProcessFileCallBack function Dec 14, 2023
@github-actions github-actions bot added the test label Dec 14, 2023
Copy link
Member

@kmehant kmehant left a comment

Choose a reason for hiding this comment

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

Thank you @satyazzz123!

cc @seshapad

func TestMergeProcessFileCallBack_SameContent(t *testing.T) {
t.Run("test for source and destination files with same content", func(t *testing.T) {

sourceFile, err := ioutil.TempFile("", "source")
Copy link
Member

Choose a reason for hiding this comment

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

Can you use a variable (named appropriately) to represent the empty string

Signed-off-by: satyazzz123 <beherasatyajit716@gmail.com>
}
defer os.Remove(sourceFile.Name())

destinationFile, err := ioutil.TempFile("", "destination")
Copy link
Member

Choose a reason for hiding this comment

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

Use nonExistentPath here as well.

Signed-off-by: satyazzz123 <beherasatyajit716@gmail.com>
@satyazzz123 satyazzz123 requested a review from seshapad December 14, 2023 10:10
@seshapad seshapad merged commit 17a115d into konveyor:main Dec 14, 2023
3 checks passed
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.

3 participants