-
Notifications
You must be signed in to change notification settings - Fork 14
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(SPV-1079): add endpoint tests for get merkleroots #745
base: main
Are you sure you want to change the base?
Conversation
Manual TestsβΉοΈ Remember to ask team members to perform manual tests and to assign |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #745 +/- ##
==========================================
- Coverage 46.13% 45.80% -0.33%
==========================================
Files 328 329 +1
Lines 16700 16770 +70
==========================================
- Hits 7705 7682 -23
- Misses 8421 8515 +94
+ Partials 574 573 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 3 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
res, _ := client.R(). | ||
SetHeader("Content-Type", "application/json"). | ||
SetError(resErr). | ||
Get(tt.bhsURL) |
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.
pleae add error check
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.
done
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.
This is exception where we don't need add error checks, because given.HttpClient()
is returning special client that will fail a tests if there will be any error before any error will be returned.
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.
please please please
Remove those tests now, as the new one are much better then that.
res, err := client.R(). | ||
SetHeader("Content-Type", "application/json"). | ||
Get(url) | ||
require.NoError(t, err, "Unexpected error occurred while getting MerkleRoots") |
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.
it is not needed for those tests, please read the documentation of given.HttpClient method, if it's not enaugh clear, then read below.
The given.HttpClient method is adding error handler to resty so that any unexpected error that could be returned here will fail the tests so you don't need to make any assumptions about returned error and can focus only on res.
res, _ := client.R(). | ||
SetHeader("Content-Type", "application/json"). | ||
SetError(resErr). | ||
Get(tt.bhsURL) |
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.
This is exception where we don't need add error checks, because given.HttpClient()
is returning special client that will fail a tests if there will be any error before any error will be returned.
Pull Request Checklist