github.com/cockroachdb/cockroach@v20.2.0-alpha.1+incompatible/build/teamcity-local-roachtest.sh (about) 1 #!/usr/bin/env bash 2 3 set -euo pipefail 4 5 source "$(dirname "${0}")/teamcity-support.sh" 6 7 tc_start_block "Prepare environment" 8 # Grab a testing license good for one hour. 9 COCKROACH_DEV_LICENSE=$(curl -f "https://register.cockroachdb.com/api/prodtest") 10 run mkdir -p artifacts 11 maybe_ccache 12 tc_end_block "Prepare environment" 13 14 tc_start_block "Compile CockroachDB" 15 # Buffer noisy output and only print it on failure. 16 run build/builder.sh make build &> artifacts/roachtests-compile.log || (cat artifacts/roachtests-compile.log && false) 17 rm artifacts/roachtests-compile.log 18 tc_end_block "Compile CockroachDB" 19 20 tc_start_block "Compile roachprod/workload/roachtest" 21 run build/builder.sh make bin/roachprod bin/workload bin/roachtest 22 tc_end_block "Compile roachprod/workload/roachtest" 23 24 tc_start_block "Run local roachtests" 25 # TODO(peter,dan): curate a suite of the tests that works locally. 26 # NB: roachtest has its own teamcity output format and posts issues (whenever 27 # GITHUB_API_TOKEN) is set, so it doesn't fit into the streamlined process 28 # around the run_json_test helper. 29 build/builder.sh env \ 30 COCKROACH_DEV_LICENSE="${COCKROACH_DEV_LICENSE}" \ 31 GITHUB_API_TOKEN="${GITHUB_API_TOKEN-}" \ 32 BUILD_VCS_NUMBER="${BUILD_VCS_NUMBER-}" \ 33 TC_BUILD_ID="${TC_BUILD_ID-}" \ 34 TC_SERVER_URL="${TC_SERVER_URL-}" \ 35 TC_BUILD_BRANCH="${TC_BUILD_BRANCH-}" \ 36 stdbuf -oL -eL \ 37 ./bin/roachtest run acceptance kv/splits cdc/bank \ 38 --local \ 39 --parallelism=1 \ 40 --cockroach "cockroach" \ 41 --roachprod "bin/roachprod" \ 42 --workload "bin/workload" \ 43 --artifacts artifacts \ 44 --teamcity 45 tc_end_block "Run local roachtests"