github.com/cockroachdb/cockroach@v20.2.0-alpha.1+incompatible/build/teamcity-acceptance.sh (about) 1 #!/usr/bin/env bash 2 3 set -euo pipefail 4 5 source "$(dirname "${0}")/teamcity-support.sh" 6 7 tc_prepare 8 9 tc_start_block "Prepare environment for acceptance tests" 10 # The log files that should be created by -l below can only 11 # be created if the parent directory already exists. Ensure 12 # that it exists before running the test. 13 export TMPDIR=$PWD/artifacts/acceptance 14 mkdir -p "$TMPDIR" 15 # Disable global -json flag. 16 type=$(GOFLAGS=; go env GOOS) 17 tc_end_block "Prepare environment for acceptance tests" 18 19 tc_start_block "Compile CockroachDB" 20 # Buffer noisy output and only print it on failure. 21 run pkg/acceptance/prepare.sh &> artifacts/acceptance-compile.log || (cat artifacts/acceptance-compile.log && false) 22 rm artifacts/acceptance-compile.log 23 run ln -s cockroach-linux-2.6.32-gnu-amd64 cockroach # For the tests that run without Docker. 24 tc_end_block "Compile CockroachDB" 25 26 tc_start_block "Compile acceptance tests" 27 run build/builder.sh mkrelease "$type" -Otarget testbuild TAGS=acceptance PKG=./pkg/acceptance 28 tc_end_block "Compile acceptance tests" 29 30 tc_start_block "Run acceptance tests" 31 run cd pkg/acceptance 32 # run_text_test needs ./artifacts to be the artifacts folder. 33 ln -s ../../artifacts artifacts 34 # NB: json has to be enabled when building the test binary, 35 # which makes this harder to get right than is worth it. 36 run_text_test github.com/cockroachdb/cockroach/pkg/acceptance env TZ=America/New_York stdbuf -eL -oL ./acceptance.test -l "$TMPDIR" -test.v -test.timeout 30m 37 run cd ../.. 38 tc_end_block "Run acceptance tests"