Skip to content

Commit

Permalink
build: run four nodes in acceptance tests
Browse files Browse the repository at this point in the history
This is required for

cockroachdb#17272

and merits a separate review.
  • Loading branch information
tbg committed Jul 31, 2017
1 parent fcbbb9a commit cd4f85c
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 7 deletions.
9 changes: 6 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ TAGS :=
TESTS :=.## Tests to run for use with `make test`.
BENCHES :=## Benchmarks to run for use with `make bench`.
FILES :=## Space delimited list of logic test files to run, for make testlogic.
TESTTIMEOUT := 4m
RACETIMEOUT := 15m
BENCHTIMEOUT := 5m
TESTTIMEOUT := 4m## Test timeout to use for regular tests.
RACETIMEOUT := 15m## Test timeout to use for race tests.
ACCEPTANCETIMEOUT := 30m## Test timeout to use for acceptance tests.
BENCHTIMEOUT := 5m## Test timeout to use for benchmarks.
TESTFLAGS :=## Extra flags to pass to the go test runner, e.g. "-v --vmodule=raft=1"
STRESSFLAGS :=## Extra flags to pass to `stress` during `make stress`.
DUPLFLAGS := -t 100
Expand Down Expand Up @@ -268,6 +269,8 @@ upload-coverage: $(BOOTSTRAP_TARGET)
@build/upload-coverage.sh

.PHONY: acceptance
acceptance: TESTTIMEOUT := $(ACCEPTANCETIMEOUT)
acceptance: export TESTTIMEOUT := $(TESTTIMEOUT)
acceptance: ## Run acceptance tests.
@pkg/acceptance/run.sh

Expand Down
2 changes: 1 addition & 1 deletion build/teamcity-acceptance.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ export TMPDIR=$PWD/artifacts/acceptance

build/builder.sh make TYPE=release-linux-gnu testbuild TAGS=acceptance PKG=./pkg/acceptance
cd pkg/acceptance
./acceptance.test -nodes 3 -l "$TMPDIR" -test.v -test.timeout 10m 2>&1 | tee "$TMPDIR/acceptance.log" | go-test-teamcity
./acceptance.test -nodes 4 -l "$TMPDIR" -test.v -test.timeout 10m 2>&1 | tee "$TMPDIR/acceptance.log" | go-test-teamcity
2 changes: 1 addition & 1 deletion build/teamcity-publish-artifacts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ if [[ "$TC_BUILD_BRANCH" != *alpha* ]] && [ "$TEAMCITY_BUILDCONF_NAME" == 'Publi
docker build --tag=$image:{latest,"$TC_BUILD_BRANCH"} build/deploy

build/builder.sh make TYPE=release-linux-gnu testbuild TAGS=acceptance PKG=./pkg/acceptance
(cd pkg/acceptance && ./acceptance.test -i $image -b /cockroach/cockroach -nodes 3 -test.v -test.timeout -5m)
(cd pkg/acceptance && ./acceptance.test -i $image -b /cockroach/cockroach -nodes 4 -test.v -test.timeout -5m)

sed "s/<EMAIL>/$DOCKER_EMAIL/;s/<AUTH>/$DOCKER_AUTH/" < build/.dockercfg.in > ~/.dockercfg
docker push "$image:latest"
Expand Down
1 change: 1 addition & 0 deletions build/variables.mk
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# DO NOT EDIT!
define VALID_VARS
.DEFAULT_GOAL
ACCEPTANCETIMEOUT
ARCHIVE
ARCHIVE_BASE
BENCHES
Expand Down
2 changes: 1 addition & 1 deletion pkg/acceptance/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ set -euxo pipefail
mkdir -p artifacts/acceptance
export TMPDIR=$PWD/artifacts/acceptance

make test PKG=./pkg/acceptance TAGS=acceptance TESTFLAGS="${TESTFLAGS--v -nodes 3} -l $TMPDIR"
make test PKG=./pkg/acceptance TESTTIMEOUT="${TESTTIMEOUT-30m}" TAGS=acceptance TESTFLAGS="${TESTFLAGS--v -nodes 4} -l $TMPDIR"
2 changes: 1 addition & 1 deletion pkg/acceptance/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func init() {
}

var flagDuration = flag.Duration("d", cluster.DefaultDuration, "duration to run the test")
var flagNodes = flag.Int("nodes", 3, "number of nodes")
var flagNodes = flag.Int("nodes", 4, "number of nodes")
var flagStores = flag.Int("stores", 1, "number of stores to use for each node")
var flagRemote = flag.Bool("remote", false, "run the test using terrafarm instead of docker")
var flagCwd = flag.String("cwd", "../cloud/aws", "directory to run terraform from")
Expand Down

0 comments on commit cd4f85c

Please sign in to comment.