chore: Enable unparam linter and cover unused *Response results#3955
chore: Enable unparam linter and cover unused *Response results#3955gmlewis merged 6 commits intogoogle:masterfrom
unparam linter and cover unused *Response results#3955Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
|
signed |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3955 +/- ##
==========================================
+ Coverage 92.45% 92.51% +0.05%
==========================================
Files 203 203
Lines 14980 14980
==========================================
+ Hits 13850 13858 +8
+ Misses 927 923 -4
+ Partials 203 199 -4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
gmlewis
left a comment
There was a problem hiding this comment.
Thank you, @ManavSharma142!
This is very interesting and is actually highlighting a number of problems:
testBadOptionsdoesn't need to be within any table-driven teststestBadOptionsonly needs to be called once per endpoint, with newlines for argsmethodNameshould always be shared betweentestBadOptionsandtestNewRequestAndDoFailure- Some tests that actually take string arguments appear to be missing a
testBadOptionscall
Could you please investigate these issues in this repo, @ManavSharma142?
I believe a separate issue/pr is warranted, since this requires extensive refactoring across all test functions. |
unparam linter and cover unused *Response results
gmlewis
left a comment
There was a problem hiding this comment.
Thank you, @ManavSharma142!
LGTM.
Awaiting second LGTM+Approval from any other contribitor to this repo before merging.
|
Thank you, @ManavSharma142, @alexandear, and @Not-Dhananjay-Mishra! |
Fixes : #3953
I enabled the unparam linter for exported results and exercised previously unused *Response return values in tests.
For the 9 affected methods, I added testNewRequestAndDoFailure blocks to ensure the *Response path is covered.
I also updated the CI config to enable:
unparam:
check-exported: true
and modified apps_test.go accordingly.