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
|
2019-03-14 19:41:05 -07:00
|
|
|
source ci/rust-version.sh stable
|
2019-05-03 10:40:02 -07:00
|
|
|
source scripts/ulimit-n.sh
|
2019-09-19 20:50:34 -07:00
|
|
|
_ cargo +$rust_stable build
|
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
|
|
|
|
|
2019-05-15 15:16:45 -07:00
|
|
|
runTest "basic" \
|
2019-01-21 09:43:04 -08:00
|
|
|
"ci/localnet-sanity.sh -i 128"
|
2019-01-18 12:11:12 -08:00
|
|
|
|
2019-05-15 15:16:45 -07:00
|
|
|
runTest "restart" \
|
2019-01-21 09:43:04 -08:00
|
|
|
"ci/localnet-sanity.sh -i 128 -k 16"
|
2019-01-18 12:11:12 -08:00
|
|
|
|
2019-05-15 15:16:45 -07:00
|
|
|
runTest "incremental restart, extra node" \
|
2019-01-22 22:47:58 -08:00
|
|
|
"ci/localnet-sanity.sh -i 128 -k 16 -R -x"
|