Skip to content

Commit

Permalink
Parallelize some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
abhinav committed Aug 15, 2022
1 parent 1a7cb65 commit 391e7b0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions zapcore/level_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,10 @@ func TestLevelOf(t *testing.T) {
}

for _, tt := range tests {
tt := tt
t.Run(tt.desc, func(t *testing.T) {
t.Parallel()

assert.Equal(t, tt.want, LevelOf(tt.give), "Reported level did not match.")
})
}
Expand Down
3 changes: 3 additions & 0 deletions zapcore/sampler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,10 @@ func TestSampler(t *testing.T) {
func TestLevelOfSampler(t *testing.T) {
levels := []Level{DebugLevel, InfoLevel, WarnLevel, ErrorLevel, DPanicLevel, PanicLevel, FatalLevel}
for _, lvl := range levels {
lvl := lvl
t.Run(lvl.String(), func(t *testing.T) {
t.Parallel()

sampler, _ := fakeSampler(lvl, time.Minute, 2, 3)
assert.Equal(t, lvl, LevelOf(sampler), "Sampler level did not match.")
})
Expand Down
3 changes: 3 additions & 0 deletions zapcore/tee_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,10 @@ func TestLevelOfTee(t *testing.T) {
}

for _, tt := range tests {
tt := tt
t.Run(tt.desc, func(t *testing.T) {
t.Parallel()

core := NewTee(tt.give...)
assert.Equal(t, tt.want, LevelOf(core), "Level of Tee core did not match.")
})
Expand Down

0 comments on commit 391e7b0

Please sign in to comment.