diff --git a/build/teamcity/cockroach/ci/tests/acceptance.sh b/build/teamcity/cockroach/ci/tests/acceptance.sh index 18ca2c5c0e9e..ea73d240f1d5 100755 --- a/build/teamcity/cockroach/ci/tests/acceptance.sh +++ b/build/teamcity/cockroach/ci/tests/acceptance.sh @@ -6,8 +6,15 @@ dir="$(dirname $(dirname $(dirname $(dirname $(dirname "${0}")))))" source "$dir/teamcity-support.sh" source "$dir/teamcity-bazel-support.sh" # For run_bazel +if [[ "$(uname -m)" =~ (arm64|aarch64)$ ]]; then + export CROSSLINUX_CONFIG="crosslinuxarm" +else + export CROSSLINUX_CONFIG="crosslinux" +fi + tc_start_block "Build cockroach" -run_bazel /usr/bin/bash -c 'bazel build --config crosslinux --config ci //pkg/cmd/cockroach-short && cp $(bazel info bazel-bin --config crosslinux --config ci)/pkg/cmd/cockroach-short/cockroach-short_/cockroach-short /artifacts/cockroach && chmod a+w /artifacts/cockroach' +build_script='bazel build --config $1 --config ci //pkg/cmd/cockroach-short && cp $(bazel info bazel-bin --config $1 --config ci)/pkg/cmd/cockroach-short/cockroach-short_/cockroach-short /artifacts/cockroach && chmod a+w /artifacts/cockroach' +run_bazel /usr/bin/bash -c "$build_script" -- "$CROSSLINUX_CONFIG" tc_end_block "Build cockroach" export ARTIFACTSDIR=$PWD/artifacts/acceptance @@ -21,7 +28,7 @@ BAZCI=$(bazel info bazel-bin --config=ci)/pkg/cmd/bazci/bazci_/bazci $BAZCI --artifacts_dir=$PWD/artifacts -- \ test //pkg/acceptance:acceptance_test \ - --config=crosslinux --config=ci \ + --config=$CROSSLINUX_CONFIG --config=ci \ "--sandbox_writable_path=$ARTIFACTSDIR" \ "--test_tmpdir=$ARTIFACTSDIR" \ --test_arg=-l="$ARTIFACTSDIR" \ diff --git a/build/teamcity/cockroach/ci/tests/bench_impl.sh b/build/teamcity/cockroach/ci/tests/bench_impl.sh index 508649f13102..da513f574510 100755 --- a/build/teamcity/cockroach/ci/tests/bench_impl.sh +++ b/build/teamcity/cockroach/ci/tests/bench_impl.sh @@ -5,6 +5,12 @@ set -euo pipefail dir="$(dirname $(dirname $(dirname $(dirname $(dirname "${0}")))))" source "$dir/teamcity/util.sh" +if [[ "$(uname -m)" =~ (arm64|aarch64)$ ]]; then + export CROSSLINUX_CONFIG="crosslinuxarm" +else + export CROSSLINUX_CONFIG="crosslinux" +fi + # Enumerate test targets that have benchmarks. all_tests=$(bazel query 'kind(go_test, //pkg/...)' --output=label) pkgs=$(git grep -l '^func Benchmark' -- 'pkg/*_test.go' | rev | cut -d/ -f2- | rev | sort | uniq) @@ -21,7 +27,7 @@ do tc_start_block "Bench $target" # We need the `test_sharding_strategy` flag or else the benchmarks will # fail to run sharded tests like //pkg/sql/importer:importer_test. - bazel run --config=test --config=crosslinux --config=ci --test_sharding_strategy=disabled $target -- \ + bazel run --config=test --config=$CROSSLINUX_CONFIG --config=ci --test_sharding_strategy=disabled $target -- \ -test.bench=. -test.benchtime=1ns -test.short -test.run=- tc_end_block "Bench $target" done diff --git a/build/teamcity/cockroach/ci/tests/local_roachtest_impl.sh b/build/teamcity/cockroach/ci/tests/local_roachtest_impl.sh index 91a5f5b3ac71..65027e10b649 100755 --- a/build/teamcity/cockroach/ci/tests/local_roachtest_impl.sh +++ b/build/teamcity/cockroach/ci/tests/local_roachtest_impl.sh @@ -2,11 +2,17 @@ set -euo pipefail -bazel build --config=crosslinux --config=ci //pkg/cmd/cockroach-short \ +if [[ "$(uname -m)" =~ (arm64|aarch64)$ ]]; then + export CROSSLINUX_CONFIG="crosslinuxarm" +else + export CROSSLINUX_CONFIG="crosslinux" +fi + +bazel build --config=$CROSSLINUX_CONFIG --config=ci //pkg/cmd/cockroach-short \ //pkg/cmd/roachtest \ //pkg/cmd/workload -BAZEL_BIN=$(bazel info bazel-bin --config=crosslinux --config=ci) +BAZEL_BIN=$(bazel info bazel-bin --config=$CROSSLINUX_CONFIG --config=ci) $BAZEL_BIN/pkg/cmd/roachtest/roachtest_/roachtest run acceptance kv/splits cdc/bank \ --local \ --parallelism=1 \