Skip to content

Commit

Permalink
Run more tests in parallel.
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisHines committed Jul 15, 2016
1 parent 9e6a0a9 commit 6aa1e99
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions log/json_logger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ func (textstringer) String() string {
}

func TestJSONLoggerStringValue(t *testing.T) {
t.Parallel()
tests := []struct {
v interface{}
expected string
Expand Down
1 change: 1 addition & 0 deletions log/log_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ func TestContextMissingValue(t *testing.T) {
// whether Context.Log is called via an interface typed variable or a concrete
// typed variable.
func TestContextStackDepth(t *testing.T) {
t.Parallel()
fn := fmt.Sprintf("%n", stack.Caller(0))

var output []interface{}
Expand Down
1 change: 1 addition & 0 deletions log/logfmt_logger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
)

func TestLogfmtLogger(t *testing.T) {
t.Parallel()
buf := &bytes.Buffer{}
logger := log.NewLogfmtLogger(buf)

Expand Down
1 change: 1 addition & 0 deletions log/nop_logger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
)

func TestNopLogger(t *testing.T) {
t.Parallel()
logger := log.NewNopLogger()
if err := logger.Log("abc", 123); err != nil {
t.Error(err)
Expand Down
1 change: 1 addition & 0 deletions log/sync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
)

func TestSwapLogger(t *testing.T) {
t.Parallel()
var logger log.SwapLogger

// Zero value does not panic or error.
Expand Down
6 changes: 4 additions & 2 deletions log/value_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
)

func TestValueBinding(t *testing.T) {
t.Parallel()
var output []interface{}

logger := log.Logger(log.LoggerFunc(func(keyvals ...interface{}) error {
Expand All @@ -33,7 +34,7 @@ func TestValueBinding(t *testing.T) {
if want, have := start.Add(time.Second), timestamp; want != have {
t.Errorf("output[1]: want %v, have %v", want, have)
}
if want, have := "value_test.go:28", fmt.Sprint(output[3]); want != have {
if want, have := "value_test.go:29", fmt.Sprint(output[3]); want != have {
t.Errorf("output[3]: want %s, have %s", want, have)
}

Expand All @@ -46,12 +47,13 @@ func TestValueBinding(t *testing.T) {
if want, have := start.Add(2*time.Second), timestamp; want != have {
t.Errorf("output[1]: want %v, have %v", want, have)
}
if want, have := "value_test.go:41", fmt.Sprint(output[3]); want != have {
if want, have := "value_test.go:42", fmt.Sprint(output[3]); want != have {
t.Errorf("output[3]: want %s, have %s", want, have)
}
}

func TestValueBinding_loggingZeroKeyvals(t *testing.T) {
t.Parallel()
var output []interface{}

logger := log.Logger(log.LoggerFunc(func(keyvals ...interface{}) error {
Expand Down

0 comments on commit 6aa1e99

Please sign in to comment.