Skip to content

Commit b5ea001

Browse files
authored
[chore] reduce log output from passing tests (#37)
The advantage of using `ntest.BufferedLogger()` over dropping `-v` from `go test` is that we want to see which tests are skipped and `go test` (no `-v`) doesn't show you what was skipped.
1 parent c247d0c commit b5ea001

6 files changed

Lines changed: 8 additions & 8 deletions

File tree

consumer_group_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ func TestBroadcastGroupRefresh(t *testing.T) {
108108
if os.Getenv("EVENTS_KAFKA_BROKERS") == "" {
109109
t.Skipf("%s requires kafka brokers", t.Name())
110110
}
111-
ntest.RunTest(t,
111+
ntest.RunTest(ntest.BufferedLogger(t),
112112
CommonInjectors,
113113
nject.Provide("nodb", func() *NoDB {
114114
return nil // Pass nil connection to trigger no-database behavior

eventnodb/shared_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ func TestSharedEventNoDB(t *testing.T) {
5252
if os.Getenv("EVENTS_KAFKA_BROKERS") == "" {
5353
t.Skipf("%s requires kafka brokers", t.Name())
5454
}
55-
ntest.RunParallelMatrix(t,
55+
ntest.RunParallelMatrix(ntest.BufferedLogger(t),
5656
chain,
5757
eventtest.GenerateSharedTestMatrix[eventmodels.BinaryEventID, *eventnodb.NoDBTx, *eventnodb.NoDB](),
5858
)

eventpg/shared_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ func pgconn(db *sql.DB) *DBType {
8383
type LibraryType = events.Library[eventmodels.StringEventID, *eventdb.ExampleBasicTX, *eventpg.Connection[*eventdb.ExampleBasicTX, eventdb.ExampleBasicDB]]
8484

8585
func TestSharedEventPG(t *testing.T) {
86-
ntest.RunParallelMatrix(t,
86+
ntest.RunParallelMatrix(ntest.BufferedLogger(t),
8787
chain,
8888
eventtest.GenerateSharedTestMatrix[eventmodels.StringEventID, *eventdb.ExampleBasicTX, *eventpg.Connection[*eventdb.ExampleBasicTX, eventdb.ExampleBasicDB]](),
8989
)

events2/shared_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,15 +104,15 @@ func s2conn(db *sql.DB) *DBType {
104104
type LibraryType = events.Library[eventmodels.BinaryEventID, *eventdb.ExampleBasicTX, *events2.Connection[*eventdb.ExampleBasicTX, eventdb.ExampleBasicDB]]
105105

106106
func TestSharedEventS2(t *testing.T) {
107-
ntest.RunParallelMatrix(t,
107+
ntest.RunParallelMatrix(ntest.BufferedLogger(t),
108108
chain,
109109
eventtest.GenerateSharedTestMatrix[eventmodels.BinaryEventID, *eventdb.ExampleBasicTX, *events2.Connection[*eventdb.ExampleBasicTX, eventdb.ExampleBasicDB]](),
110110
)
111111
}
112112

113113
func TestLockingLockOrDie(t *testing.T) {
114114
t.Parallel()
115-
ntest.RunTest(t, chain, func(
115+
ntest.RunTest(ntest.BufferedLogger(t), chain, func(
116116
t ntest.T,
117117
ctx context.Context,
118118
db *events2.Connection[*eventdb.ExampleBasicTX, eventdb.ExampleBasicDB],

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ require (
1111
github.com/lib/pq v1.10.9
1212
github.com/memsql/errors v0.2.0
1313
github.com/memsql/keyeddistributor v0.1.0
14-
github.com/memsql/ntest v0.5.0
14+
github.com/memsql/ntest v0.7.0
1515
github.com/muir/gwrap v0.4.0
1616
github.com/muir/libschema v0.6.1
1717
github.com/muir/nject/v2 v2.1.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ github.com/memsql/errors v0.2.0 h1:n1KKG0TRC0cqUmdropM9ygMDXbGORIN4HmbqU3y3SbM=
4242
github.com/memsql/errors v0.2.0/go.mod h1:82DslK+/CPzNprzYkjXk70ZHzzGCESIyv9PfH/hYcaQ=
4343
github.com/memsql/keyeddistributor v0.1.0 h1:JpouaTyKp8Q67vbcv/t6JCWWOazo2LQMf/S+yl0BMs4=
4444
github.com/memsql/keyeddistributor v0.1.0/go.mod h1:GD9Oam+jec0VPLp3fqKILCXTnykIGHK3crKtXS8Ju4Q=
45-
github.com/memsql/ntest v0.5.0 h1:FqS8XGLm0lzLKFdRXIl+hZw1FnPDvxCNB17TeBh2HZ8=
46-
github.com/memsql/ntest v0.5.0/go.mod h1:4qwQTVz/kYN+6tzgzkiDsWRucwCn2+KzCpwSsmWFt50=
45+
github.com/memsql/ntest v0.7.0 h1:I7DyHIvvCx+jGWEXQ1NOONng2BfhqCN3tBgLTu6ymJ8=
46+
github.com/memsql/ntest v0.7.0/go.mod h1:fRs4x6iD67RsQMra7lH2086F8Oi38WWkmNAo6B66T7s=
4747
github.com/memsql/refcountmap v0.1.1 h1:tcYPE9pRlVv7uwbDUY2E+sjhD/zBRRWvPQ0pz8IIujg=
4848
github.com/memsql/refcountmap v0.1.1/go.mod h1:kJR6RIBAI4iZgNo7hqQZZSmWWHNv+5t9X3RbOku86nk=
4949
github.com/muir/gwrap v0.4.0 h1:BfkdL6wxEv9Q7rdXoxz89+Wa65GZ9iNYPlCprL1sYXU=

0 commit comments

Comments
 (0)