solana/ci/iterations-localnet.sh

62 lines
1.1 KiB
Bash
Raw Normal View History

2019-01-13 10:47:10 -08:00
#!/usr/bin/env bash
set -e
2019-01-21 09:43:04 -08:00
testCmd="$*"
genPipeline=false
2019-01-13 10:47:10 -08:00
cd "$(dirname "$0")/.."
# Clear cached json keypair files
rm -rf "$HOME/.config/solana"
source ci/_
export RUST_BACKTRACE=1
export RUSTFLAGS="-D warnings"
export PATH=$PWD/target/debug:$PATH
export USE_INSTALL=1
2019-01-21 09:43:04 -08:00
if [[ -n $BUILDKITE && -z $testCmd ]]; then
genPipeline=true
echo "
steps:
"
fi
build() {
$genPipeline && return
source ci/rust-version.sh stable
source scripts/ulimit-n.sh
_ cargo +$rust_stable build --all
2019-01-21 09:43:04 -08:00
}
runTest() {
declare runTestName="$1"
declare runTestCmd="$2"
if $genPipeline; then
echo "
- command: \"$0 '$runTestCmd'\"
name: \"$runTestName\"
2019-01-22 09:35:03 -08:00
timeout_in_minutes: 45
2019-01-21 09:43:04 -08:00
"
return
fi
if [[ -n $testCmd && "$testCmd" != "$runTestCmd" ]]; then
echo Skipped "$runTestName"...
return
fi
#shellcheck disable=SC2068 # Don't want to double quote $runTestCmd
$runTestCmd
}
build
runTest "Leader rotation on" \
"ci/localnet-sanity.sh -i 128"
2019-01-22 22:47:58 -08:00
runTest "Leader rotation on, restart" \
2019-01-21 09:43:04 -08:00
"ci/localnet-sanity.sh -i 128 -k 16"
2019-01-22 22:47:58 -08:00
runTest "Leader rotation on, incremental restart, extra node" \
"ci/localnet-sanity.sh -i 128 -k 16 -R -x"