Skip to content

Commit

Permalink
chore(bench): allow configuring count
Browse files Browse the repository at this point in the history
Signed-off-by: Tomasz Janiszewski <tomek@redhat.com>
  • Loading branch information
janisz committed Nov 3, 2023
1 parent 129f5ca commit 0eeb37f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Makefile
Expand Up @@ -6,6 +6,7 @@ TESTFLAGS=-race -p 4
BASE_DIR=$(CURDIR)
BENCHTIME ?= 1x
BENCHTIMEOUT ?= 20m
BENCHCOUNT ?= 1

ifeq (,$(findstring podman,$(shell docker --version 2>/dev/null)))
# Podman DTRT by running processes unprivileged in containers,
Expand Down Expand Up @@ -512,7 +513,7 @@ go-postgres-unit-tests: build-prep test-prep
go-postgres-bench-tests: build-prep test-prep
@# The -p 1 passed to go test is required to ensure that tests of different packages are not run in parallel, so as to avoid conflicts when interacting with the DB.
set -o pipefail ; \
CGO_ENABLED=1 GODEBUG=cgocheck=2 MUTEX_WATCHDOG_TIMEOUT_SECS=30 ROX_POSTGRES_DATASTORE=true GOTAGS=$(GOTAGS),test,sql_integration scripts/go-test.sh -p 1 -run=nonthing -bench=. -benchtime=$(BENCHTIME) -benchmem -timeout $(BENCHTIMEOUT) -v \
CGO_ENABLED=1 GODEBUG=cgocheck=2 MUTEX_WATCHDOG_TIMEOUT_SECS=30 ROX_POSTGRES_DATASTORE=true GOTAGS=$(GOTAGS),test,sql_integration scripts/go-test.sh -p 1 -run=nonthing -bench=. -benchtime=$(BENCHTIME) -benchmem -timeout $(BENCHTIMEOUT) -count $(BENCHCOUNT) -v \
$(shell git grep -rl "testing.B" central pkg migrator tools | sed -e 's@^@./@g' | xargs -n 1 dirname | sort | uniq | xargs go list -tags sql_integration | grep -v '^github.com/stackrox/rox/tests$$' | grep -Ev $(UNIT_TEST_IGNORE)) \
| tee $(GO_TEST_OUTPUT_PATH)

Expand Down
2 changes: 2 additions & 0 deletions go.mod
Expand Up @@ -193,7 +193,9 @@ require (
github.com/distribution/reference v0.5.0 // indirect
github.com/docker/cli v24.0.6+incompatible // indirect
github.com/docker/docker-credential-helpers v0.7.0 // indirect
github.com/docker/go-connections v0.4.0 // indirect
github.com/docker/go-metrics v0.0.1 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/docker/libtrust v0.0.0-20160708172513-aabc10ec26b7 // indirect
github.com/doug-martin/goqu/v8 v8.6.0 // indirect
github.com/dsnet/compress v0.0.2-0.20210315054119-f66993602bf5 // indirect
Expand Down

0 comments on commit 0eeb37f

Please sign in to comment.