Skip to content

Commit

Permalink
dev: skip running tests as part of dev bench
Browse files Browse the repository at this point in the history
Slipped in as part of cockroachdb#76189. Before this patch we were unintentionally
running all unit tests in whatever package was targeted. To repro, try:

    dev bench pkg/server -f='BenchmarkSetupSpanForIncomingRPC'

Release note: None
  • Loading branch information
irfansharif authored and RajivTS committed Mar 6, 2022
1 parent c9b5dbb commit f9643c4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions pkg/cmd/dev/bench.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ func (d *dev) bench(cmd *cobra.Command, commandLine []string) error {
args = append(args, "--nocache_test_results")
}

args = append(args, "--test_arg", "-test.run=-")
if filter == "" {
args = append(args, "--test_arg", "-test.bench=.")
} else {
Expand Down
8 changes: 4 additions & 4 deletions pkg/cmd/dev/testdata/datadriven/bench
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
dev bench pkg/spanconfig/...
----
bazel test pkg/spanconfig/...:all --test_arg -test.bench=. --test_output errors
bazel test pkg/spanconfig/...:all --test_arg -test.run=- --test_arg -test.bench=. --test_output errors

dev bench pkg/sql/parser --filter=BenchmarkParse
----
bazel test pkg/sql/parser:all --test_arg -test.bench=BenchmarkParse --test_output errors
bazel test pkg/sql/parser:all --test_arg -test.run=- --test_arg -test.bench=BenchmarkParse --test_output errors

dev bench pkg/bench -f=BenchmarkTracing/1node/scan/trace=off --count=2 --bench-time=10x --bench-mem
----
bazel test pkg/bench:all --test_arg -test.bench=BenchmarkTracing/1node/scan/trace=off --test_arg -test.count=2 --test_arg -test.benchtime=10x --test_arg -test.benchmem --test_output errors
bazel test pkg/bench:all --test_arg -test.run=- --test_arg -test.bench=BenchmarkTracing/1node/scan/trace=off --test_arg -test.count=2 --test_arg -test.benchtime=10x --test_arg -test.benchmem --test_output errors

dev bench pkg/spanconfig/spanconfigkvsubscriber -f=BenchmarkSpanConfigDecoder --cpus=10 --ignore-cache -v --timeout=50s
----
bazel test --local_cpu_resources=10 --test_timeout=50 pkg/spanconfig/spanconfigkvsubscriber:all --nocache_test_results --test_arg -test.bench=BenchmarkSpanConfigDecoder --test_arg -test.v --test_output all
bazel test --local_cpu_resources=10 --test_timeout=50 pkg/spanconfig/spanconfigkvsubscriber:all --nocache_test_results --test_arg -test.run=- --test_arg -test.bench=BenchmarkSpanConfigDecoder --test_arg -test.v --test_output all

0 comments on commit f9643c4

Please sign in to comment.