Skip to content

testing: no specific message if a benchmark is skipped #14799

@pierrre

Description

@pierrre
  1. What version of Go are you using (go version)?
    1.6 linux/amd64
  2. What did you do?
    Skip a benchmark *testing.B
  3. What did you expect to see?
    It should display a message, like *testing.T
  4. What did you see instead?
    This is from my project.
    It skips tests and benchmark if there is no Redis server listening on the default port.
    As you can see, there are "SKIP" messages if a test is skipped, but only the error message if a benchmark is skipped.
➜  ~ go test -v -bench=. github.com/pierrre/imageserver/cache/redis
=== RUN   TestGetSet
--- SKIP: TestGetSet (0.00s)
    redis_test.go:115: dial tcp [::1]:6379: getsockopt: connection refused
=== RUN   TestGetMiss
--- SKIP: TestGetMiss (0.00s)
    redis_test.go:115: dial tcp [::1]:6379: getsockopt: connection refused
=== RUN   TestGetErrorAddress
--- PASS: TestGetErrorAddress (0.00s)
=== RUN   TestSetErrorAddress
--- PASS: TestSetErrorAddress (0.00s)
=== RUN   TestGetErrorUnmarshal
--- SKIP: TestGetErrorUnmarshal (0.00s)
    redis_test.go:115: dial tcp [::1]:6379: getsockopt: connection refused
=== RUN   TestSetErrorMarshal
--- SKIP: TestSetErrorMarshal (0.00s)
    redis_test.go:115: dial tcp [::1]:6379: getsockopt: connection refused
PASS
BenchmarkGetSizeSmall-8                0             0 ns/op
--- BENCH: BenchmarkGetSizeSmall-8
    redis_test.go:115: dial tcp [::1]:6379: getsockopt: connection refused
BenchmarkGetSizeMedium-8               0             0 ns/op
--- BENCH: BenchmarkGetSizeMedium-8
    redis_test.go:115: dial tcp [::1]:6379: getsockopt: connection refused
BenchmarkGetSizeLarge-8                0             0 ns/op
--- BENCH: BenchmarkGetSizeLarge-8
    redis_test.go:115: dial tcp [::1]:6379: getsockopt: connection refused
BenchmarkGetSizeHuge-8                 0             0 ns/op
--- BENCH: BenchmarkGetSizeHuge-8
    redis_test.go:115: dial tcp [::1]:6379: getsockopt: connection refused
BenchmarkGetParallelism1-8             0             0 ns/op
--- BENCH: BenchmarkGetParallelism1-8
    redis_test.go:115: dial tcp [::1]:6379: getsockopt: connection refused
BenchmarkGetParallelism2-8             0             0 ns/op
--- BENCH: BenchmarkGetParallelism2-8
    redis_test.go:115: dial tcp [::1]:6379: getsockopt: connection refused
BenchmarkGetParallelism4-8             0             0 ns/op
--- BENCH: BenchmarkGetParallelism4-8
    redis_test.go:115: dial tcp [::1]:6379: getsockopt: connection refused
BenchmarkGetParallelism8-8             0             0 ns/op
--- BENCH: BenchmarkGetParallelism8-8
    redis_test.go:115: dial tcp [::1]:6379: getsockopt: connection refused
BenchmarkGetParallelism16-8            0             0 ns/op
--- BENCH: BenchmarkGetParallelism16-8
    redis_test.go:115: dial tcp [::1]:6379: getsockopt: connection refused
BenchmarkGetParallelism32-8            0             0 ns/op
--- BENCH: BenchmarkGetParallelism32-8
    redis_test.go:115: dial tcp [::1]:6379: getsockopt: connection refused
BenchmarkGetParallelism64-8            0             0 ns/op
--- BENCH: BenchmarkGetParallelism64-8
    redis_test.go:115: dial tcp [::1]:6379: getsockopt: connection refused
BenchmarkGetParallelism128-8           0             0 ns/op
--- BENCH: BenchmarkGetParallelism128-8
    redis_test.go:115: dial tcp [::1]:6379: getsockopt: connection refused
ok      github.com/pierrre/imageserver/cache/redis  0.014s

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions