Skip to content

Commit

Permalink
test: echo proposal name in run scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
turadg committed Feb 5, 2024
1 parent eb8b626 commit 287277a
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 22 deletions.
16 changes: 10 additions & 6 deletions packages/synthetic-chain/upgrade-test-scripts/run_eval.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,31 @@ set -e

source ./env_setup.sh

PROPOSAL_PATH=$1
PROPOSAL=$1
if [ -z "$PROPOSAL" ]; then
echo "Must specify what proposal to use"
exit 1
fi

startAgd

echo "Agd started. Running CoreEval submission."
cd /usr/src/proposals/"$PROPOSAL_PATH/" || exit
echo "[$PROPOSAL] Agd started. Running CoreEval submission."
cd /usr/src/proposals/"$PROPOSAL/" || exit

# eval_submission doesn't really need to be .ts but it imports .ts files
tsx --version || npm install --global tsx

if [ -f "eval.sh" ]; then
# this is what the script used to do. Also allows a proposal to override how they are eval-ed
echo "Running eval.sh"
echo "[$PROPOSAL] Running eval.sh"
./eval.sh
else
# newer proposals declare a submission
echo "Running proposal declared in package.json"
echo "[$PROPOSAL] Running proposal declared in package.json"
# copy to run in the proposal package so the dependencies can be resolved
cp /usr/src/upgrade-test-scripts/eval_submission.ts .
./eval_submission.ts
fi

echo "Eval completed. Running 10 blocks and exiting."
echo "[$PROPOSAL] Eval completed. Running 10 blocks and exiting."
waitForBlock 10
14 changes: 9 additions & 5 deletions packages/synthetic-chain/upgrade-test-scripts/run_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,18 @@ set -e

source ./env_setup.sh

PROPOSAL_PATH=$1
PROPOSAL=$1
if [ -z "$PROPOSAL" ]; then
echo "Must specify what proposal to use"
exit 1
fi

echo "[$PROPOSAL_PATH] Starting agd"
echo "[$PROPOSAL] Starting agd"

startAgd

echo "[$PROPOSAL_PATH] Running test.sh."
cd /usr/src/proposals/"$PROPOSAL_PATH/" || exit
echo "[$PROPOSAL] Running test.sh."
cd /usr/src/proposals/"$PROPOSAL/" || exit
./test.sh

echo "[$PROPOSAL_PATH] Testing completed."
echo "[$PROPOSAL] Testing completed."
22 changes: 11 additions & 11 deletions packages/synthetic-chain/upgrade-test-scripts/run_use.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,31 @@

set -e

ID=$1
if [ -z "$ID" ]; then
PROPOSAL=$1
if [ -z "$PROPOSAL" ]; then
echo "Must specify what proposal to use"
exit 1
fi
PROPOSAL_PATH="/usr/src/proposals/$ID/"
PROPOSAL_PROPOSAL="/usr/src/proposals/$PROPOSAL/"

if [ ! -d "$PROPOSAL_PATH" ]; then
echo "Proposal $ID does not exist"
if [ ! -d "$PROPOSAL_PROPOSAL" ]; then
echo "Proposal $PROPOSAL does not exist"
exit 1
fi

if [ ! -f "$PROPOSAL_PATH/use.sh" ]; then
echo "Proposal $ID does not have a use.sh. Skipping."
if [ ! -f "$PROPOSAL_PROPOSAL/use.sh" ]; then
echo "Proposal $PROPOSAL does not have a use.sh. Skipping."
exit 0
fi

source ./env_setup.sh

echo "Starting agd in the background."
echo "[$PROPOSAL] Starting agd in the background."
startAgd

echo "Agd started. Running use.sh."
cd "$PROPOSAL_PATH"
echo "[$PROPOSAL] Agd started. Running use.sh."
cd "$PROPOSAL_PROPOSAL"
./use.sh

echo "Actions completed. Running for a few blocks and exiting."
echo "[$PROPOSAL] Actions completed. Running for a few blocks and exiting."
waitForBlock 5

0 comments on commit 287277a

Please sign in to comment.