reference: rewrite test to use sub-tests, add benchmark#3883
Conversation
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
BenchmarkParse
BenchmarkParse-10 12696 93805 ns/op 9311 B/op 185 allocs/op
PASS
Signed-off-by: Sebastiaan van Stijn <[email protected]>
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. |
| }, | ||
| } | ||
| for _, test := range testcases { | ||
| test := test |
There was a problem hiding this comment.
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.
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