Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: support running extra checks on ARM #88966

Merged
merged 1 commit into from
Oct 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions build/teamcity/cockroach/ci/tests/acceptance.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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" \
Expand Down
8 changes: 7 additions & 1 deletion build/teamcity/cockroach/ci/tests/bench_impl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
10 changes: 8 additions & 2 deletions build/teamcity/cockroach/ci/tests/local_roachtest_impl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down