|
@ -3,33 +3,47 @@ |
|
|
# This is a convenience script that takes a list of testnet manifests |
|
|
# This is a convenience script that takes a list of testnet manifests |
|
|
# as arguments and runs each one of them sequentially. If a testnet |
|
|
# as arguments and runs each one of them sequentially. If a testnet |
|
|
# fails, the container logs are dumped to stdout along with the testnet |
|
|
# fails, the container logs are dumped to stdout along with the testnet |
|
|
# manifest. |
|
|
|
|
|
|
|
|
# manifest, but the remaining testnets are still run. |
|
|
# |
|
|
# |
|
|
# This is mostly used to run generated networks in nightly CI jobs. |
|
|
# This is mostly used to run generated networks in nightly CI jobs. |
|
|
# |
|
|
# |
|
|
|
|
|
|
|
|
# Don't set -e, since we explicitly check status codes ourselves. |
|
|
|
|
|
set -u |
|
|
|
|
|
|
|
|
set -euo pipefail |
|
|
|
|
|
|
|
|
if [[ $# == 0 ]]; then |
|
|
if [[ $# == 0 ]]; then |
|
|
echo "Usage: $0 [MANIFEST...]" >&2 |
|
|
echo "Usage: $0 [MANIFEST...]" >&2 |
|
|
exit 1 |
|
|
exit 1 |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
FAILED=() |
|
|
|
|
|
|
|
|
for MANIFEST in "$@"; do |
|
|
for MANIFEST in "$@"; do |
|
|
START=$SECONDS |
|
|
START=$SECONDS |
|
|
echo "==> Running testnet $MANIFEST..." |
|
|
echo "==> Running testnet $MANIFEST..." |
|
|
./build/runner -f "$MANIFEST" |
|
|
|
|
|
|
|
|
|
|
|
if [[ $? -ne 0 ]]; then |
|
|
|
|
|
|
|
|
if ! ./build/runner -f "$MANIFEST"; then |
|
|
echo "==> Testnet $MANIFEST failed, dumping manifest..." |
|
|
echo "==> Testnet $MANIFEST failed, dumping manifest..." |
|
|
cat "$MANIFEST" |
|
|
cat "$MANIFEST" |
|
|
|
|
|
|
|
|
echo "==> Dumping container logs for $MANIFEST..." |
|
|
echo "==> Dumping container logs for $MANIFEST..." |
|
|
./build/runner -f "$MANIFEST" logs |
|
|
./build/runner -f "$MANIFEST" logs |
|
|
exit 1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo "==> Cleaning up failed testnet $MANIFEST..." |
|
|
|
|
|
./build/runner -f "$MANIFEST" cleanup |
|
|
|
|
|
|
|
|
|
|
|
FAILED+=("$MANIFEST") |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
echo "==> Completed testnet $MANIFEST in $(( SECONDS - START ))s" |
|
|
echo "==> Completed testnet $MANIFEST in $(( SECONDS - START ))s" |
|
|
echo "" |
|
|
echo "" |
|
|
done |
|
|
done |
|
|
|
|
|
|
|
|
|
|
|
if [[ ${#FAILED[@]} -ne 0 ]]; then |
|
|
|
|
|
echo "${#FAILED[@]} testnets failed:" |
|
|
|
|
|
for MANIFEST in "${FAILED[@]}"; do |
|
|
|
|
|
echo "- $MANIFEST" |
|
|
|
|
|
done |
|
|
|
|
|
exit 1 |
|
|
|
|
|
else |
|
|
|
|
|
echo "All testnets successful" |
|
|
|
|
|
fi |