Closed kevinburke closed 7 years ago
Interfaces are always pointers already, so a *testing.TB would be like a **testing.T. If it's a concrete type you generally need to pass the pointer to satisfy the interface. Hope that makes sense.
On Mon, Dec 19, 2016 at 11:33 Casey W Crites notifications@github.com wrote:
@caseycrites commented on this pull request.
In test/factory/factory.go https://github.com/Shyp/rickover/pull/8#pullrequestreview-13624801:
@@ -63,7 +63,7 @@ func RandomId(prefix string) types.PrefixUUID {
}
}
-func CreateJob(t *testing.T, j models.Job) models.Job {
+func CreateJob(t testing.TB, j models.Job) models.Job {
How come testing.TB isn't passed by reference?
— You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub https://github.com/Shyp/rickover/pull/8#pullrequestreview-13624801, or mute the thread https://github.com/notifications/unsubscribe-auth/AAOSIwk9nOR7fANpxKoMvm75Z7nqoVlVks5rJtwDgaJpZM4LNLJb .
This lets us measure how fast jobs can be enqueued (about 0.8ms per run). Updates a bunch of testing.T to instead take the testing.TB interface, so we can pass a testing.B and have things still work. Adds a Make target for running benchmarks. Run the benchmarks in Travis CI, and specify the go_import_path so forks still build okay.