chore: only generate test result on specific branches (#27591)
* chore: only generate test result on specific branches * lint
This commit is contained in:
parent
269eb519dd
commit
8c1093534e
|
@ -20,7 +20,7 @@ else
|
|||
SUCCESS=false
|
||||
fi
|
||||
|
||||
if [[ "$BUILDKITE_BRANCH" == 'master' && -f "results.json" ]]; then
|
||||
if [[ -n $BUILDKITE && -f "results.json" ]]; then
|
||||
# prepare result file
|
||||
awk '/{ "type": .* }/' results.json > sanitized-results.json
|
||||
|
||||
|
|
|
@ -38,11 +38,35 @@ NPROC=$(nproc)
|
|||
JOBS=$((JOBS>NPROC ? NPROC : JOBS))
|
||||
|
||||
|
||||
# get channel info
|
||||
eval "$(ci/channel-info.sh)"
|
||||
|
||||
need_to_generate_test_result() {
|
||||
local branches=(
|
||||
"$EDGE_CHANNEL"
|
||||
"$BETA_CHANNEL"
|
||||
"$STABLE_CHANNEL"
|
||||
)
|
||||
|
||||
for n in "${branches[@]}";
|
||||
do
|
||||
if [[ "$CI_BRANCH" == "$n" ]]; then
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
echo "Executing $testName"
|
||||
case $testName in
|
||||
test-stable)
|
||||
if need_to_generate_test_result; then
|
||||
_ "$cargo" stable test --jobs "$JOBS" --all --tests --exclude solana-local-cluster ${V:+--verbose} -- -Z unstable-options --format json --report-time | tee results.json
|
||||
exit_if_error "${PIPESTATUS[0]}"
|
||||
else
|
||||
_ "$cargo" stable test --jobs "$JOBS" --all --tests --exclude solana-local-cluster ${V:+--verbose} -- --nocapture
|
||||
fi
|
||||
;;
|
||||
test-stable-bpf)
|
||||
# Clear the C dependency files, if dependency moves these files are not regenerated
|
||||
|
@ -64,10 +88,16 @@ test-stable-bpf)
|
|||
|
||||
# BPF C program system tests
|
||||
_ make -C programs/bpf/c tests
|
||||
if need_to_generate_test_result; then
|
||||
_ "$cargo" stable test \
|
||||
--manifest-path programs/bpf/Cargo.toml \
|
||||
--no-default-features --features=bpf_c,bpf_rust -- -Z unstable-options --format json --report-time | tee results.json
|
||||
exit_if_error "${PIPESTATUS[0]}"
|
||||
else
|
||||
_ "$cargo" stable test \
|
||||
--manifest-path programs/bpf/Cargo.toml \
|
||||
--no-default-features --features=bpf_c,bpf_rust -- --nocapture
|
||||
fi
|
||||
|
||||
# BPF Rust program unit tests
|
||||
for bpf_test in programs/bpf/rust/*; do
|
||||
|
@ -100,11 +130,18 @@ test-stable-bpf)
|
|||
|
||||
# BPF program instruction count assertion
|
||||
bpf_target_path=programs/bpf/target
|
||||
if need_to_generate_test_result; then
|
||||
_ "$cargo" stable test \
|
||||
--manifest-path programs/bpf/Cargo.toml \
|
||||
--no-default-features --features=bpf_c,bpf_rust assert_instruction_count \
|
||||
-- -Z unstable-options --format json --report-time |& tee results.json
|
||||
awk '!/{ "type": .* }/' results.json >"${bpf_target_path}"/deploy/instuction_counts.txt
|
||||
else
|
||||
_ "$cargo" stable test \
|
||||
--manifest-path programs/bpf/Cargo.toml \
|
||||
--no-default-features --features=bpf_c,bpf_rust assert_instruction_count \
|
||||
-- --nocapture &> "${bpf_target_path}"/deploy/instuction_counts.txt
|
||||
fi
|
||||
|
||||
bpf_dump_archive="bpf-dumps.tar.bz2"
|
||||
rm -f "$bpf_dump_archive"
|
||||
|
@ -129,32 +166,52 @@ test-stable-perf)
|
|||
fi
|
||||
|
||||
_ "$cargo" stable build --bins ${V:+--verbose}
|
||||
if need_to_generate_test_result; then
|
||||
_ "$cargo" stable test --package solana-perf --package solana-ledger --package solana-core --lib ${V:+--verbose} -- -Z unstable-options --format json --report-time | tee results.json
|
||||
exit_if_error "${PIPESTATUS[0]}"
|
||||
else
|
||||
_ "$cargo" stable test --package solana-perf --package solana-ledger --package solana-core --lib ${V:+--verbose} -- --nocapture
|
||||
fi
|
||||
_ "$cargo" stable run --manifest-path poh-bench/Cargo.toml ${V:+--verbose} -- --hashes-per-tick 10
|
||||
;;
|
||||
test-local-cluster)
|
||||
_ "$cargo" stable build --release --bins ${V:+--verbose}
|
||||
if need_to_generate_test_result; then
|
||||
_ "$cargo" stable test --release --package solana-local-cluster --test local_cluster ${V:+--verbose} -- --test-threads=1 -Z unstable-options --format json --report-time | tee results.json
|
||||
exit_if_error "${PIPESTATUS[0]}"
|
||||
else
|
||||
_ "$cargo" stable test --release --package solana-local-cluster --test local_cluster ${V:+--verbose} -- --nocapture --test-threads=1
|
||||
fi
|
||||
exit 0
|
||||
;;
|
||||
test-local-cluster-flakey)
|
||||
_ "$cargo" stable build --release --bins ${V:+--verbose}
|
||||
if need_to_generate_test_result; then
|
||||
_ "$cargo" stable test --release --package solana-local-cluster --test local_cluster_flakey ${V:+--verbose} -- --test-threads=1 -Z unstable-options --format json --report-time | tee results.json
|
||||
exit_if_error "${PIPESTATUS[0]}"
|
||||
else
|
||||
_ "$cargo" stable test --release --package solana-local-cluster --test local_cluster_flakey ${V:+--verbose} -- --nocapture --test-threads=1
|
||||
fi
|
||||
exit 0
|
||||
;;
|
||||
test-local-cluster-slow-1)
|
||||
_ "$cargo" stable build --release --bins ${V:+--verbose}
|
||||
if need_to_generate_test_result; then
|
||||
_ "$cargo" stable test --release --package solana-local-cluster --test local_cluster_slow_1 ${V:+--verbose} -- --test-threads=1 -Z unstable-options --format json --report-time | tee results.json
|
||||
exit_if_error "${PIPESTATUS[0]}"
|
||||
else
|
||||
_ "$cargo" stable test --release --package solana-local-cluster --test local_cluster_slow_1 ${V:+--verbose} -- --nocapture --test-threads=1
|
||||
fi
|
||||
exit 0
|
||||
;;
|
||||
test-local-cluster-slow-2)
|
||||
_ "$cargo" stable build --release --bins ${V:+--verbose}
|
||||
if need_to_generate_test_result; then
|
||||
_ "$cargo" stable test --release --package solana-local-cluster --test local_cluster_slow_2 ${V:+--verbose} -- --test-threads=1 -Z unstable-options --format json --report-time | tee results.json
|
||||
exit_if_error "${PIPESTATUS[0]}"
|
||||
else
|
||||
_ "$cargo" stable test --release --package solana-local-cluster --test local_cluster_slow_2 ${V:+--verbose} -- --nocapture --test-threads=1
|
||||
fi
|
||||
exit 0
|
||||
;;
|
||||
test-wasm)
|
||||
|
|
Loading…
Reference in New Issue