Search code examples
testinggobenchmarking

Is there a way to run benchmarks with failing tests?


Is it expected that benchmarks don't run unless all tests in the package have passed.

I've looked at the testing package doc and the testing flags and I can't find it documented that benchmarks run only after all tests pass.

Is there a way to force benchmark functions to run even when some tests in the package have failed ?


Solution

  • You can skip the failing tests using the -run flag, or choose to run none at all

    go test -bench . -run NONE