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
reference: rewrite test to use sub-tests, add benchmark #3883
reference: rewrite test to use sub-tests, add benchmark #3883
Conversation
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
BenchmarkParse BenchmarkParse-10 12696 93805 ns/op 9311 B/op 185 allocs/op PASS Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Codecov ReportPatch coverage has no change and project coverage change:
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more Additional details and impacted files@@ Coverage Diff @@
## main #3883 +/- ##
==========================================
+ Coverage 56.63% 56.81% +0.17%
==========================================
Files 106 106
Lines 10674 10674
==========================================
+ Hits 6045 6064 +19
+ Misses 3955 3936 -19
Partials 674 674 ☔ View full report in Codecov by Sentry. |
@@ -677,6 +683,7 @@ func TestParseDockerRef(t *testing.T) { | |||
}, | |||
} | |||
for _, test := range testcases { | |||
test := test |
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.
Nice catch. I would also love this var to (and the range
var) to be called tc
for consistency's sake but I appreciate making tests consistent would've been a proper effort
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.
Yes, 💯. Both for the OCD side of me, but also because having a common pattern / naming helps with cognitive overload when reading code (when reading tc
you don't have to "think" what it is).
Probably best to do so in a one-time pass over all existing tests and update them.
|
reference: TestParseDockerRef: capture test in loop
reference: TestParseRepositoryInfo: use subtests
reference: add BenchmarkParse