Skip to content

Commit

Permalink
revert extra changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ceyonur committed Sep 20, 2023
1 parent df09c06 commit 6855a96
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 62 deletions.
Binary file removed build/avalanche-network-runner
Binary file not shown.
130 changes: 68 additions & 62 deletions scripts/tests.e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,28 @@ DEFAULT_VERSION_2=v1.10.9
DEFAULT_SUBNET_EVM_VERSION=v0.5.5

if [ $# == 0 ]; then
VERSION_1=$DEFAULT_VERSION_1
VERSION_2=$DEFAULT_VERSION_2
SUBNET_EVM_VERSION=$DEFAULT_SUBNET_EVM_VERSION
VERSION_1=$DEFAULT_VERSION_1
VERSION_2=$DEFAULT_VERSION_2
SUBNET_EVM_VERSION=$DEFAULT_SUBNET_EVM_VERSION
else
VERSION_1=$1
if [[ -z "${VERSION_1}" ]]; then
echo "Missing version argument!"
echo "Usage: ${0} [VERSION_1] [VERSION_2] [SUBNET_EVM_VERSION]" >>/dev/stderr
exit 255
fi
VERSION_2=$2
if [[ -z "${VERSION_2}" ]]; then
echo "Missing version argument!"
echo "Usage: ${0} [VERSION_1] [VERSION_2] [SUBNET_EVM_VERSION]" >>/dev/stderr
exit 255
fi
SUBNET_EVM_VERSION=$3
if [[ -z "${SUBNET_EVM_VERSION}" ]]; then
echo "Missing version argument!"
echo "Usage: ${0} [VERSION_1] [VERSION_2] [SUBNET_EVM_VERSION]" >>/dev/stderr
exit 255
fi
VERSION_1=$1
if [[ -z "${VERSION_1}" ]]; then
echo "Missing version argument!"
echo "Usage: ${0} [VERSION_1] [VERSION_2] [SUBNET_EVM_VERSION]" >> /dev/stderr
exit 255
fi
VERSION_2=$2
if [[ -z "${VERSION_2}" ]]; then
echo "Missing version argument!"
echo "Usage: ${0} [VERSION_1] [VERSION_2] [SUBNET_EVM_VERSION]" >> /dev/stderr
exit 255
fi
SUBNET_EVM_VERSION=$3
if [[ -z "${SUBNET_EVM_VERSION}" ]]; then
echo "Missing version argument!"
echo "Usage: ${0} [VERSION_1] [VERSION_2] [SUBNET_EVM_VERSION]" >> /dev/stderr
exit 255
fi
fi

echo "Running e2e tests with:"
Expand All @@ -56,46 +56,51 @@ export CGO_CFLAGS="-O -D__BLST_PORTABLE__"
############################
AVALANCHEGO_REPO=/tmp/avalanchego-repo/

if [ ! -d $AVALANCHEGO_REPO ]; then
git clone https://github.com/ava-labs/avalanchego/ $AVALANCHEGO_REPO
if [ ! -d $AVALANCHEGO_REPO ]
then
git clone https://github.com/ava-labs/avalanchego/ $AVALANCHEGO_REPO
fi

VERSION_1_DIR=/tmp/avalanchego-${VERSION_1}/
if [ ! -f ${VERSION_1_DIR}/avalanchego ]; then
echo building avalanchego $VERSION_1
rm -rf ${VERSION_1_DIR}
mkdir -p ${VERSION_1_DIR}
cd $AVALANCHEGO_REPO
git checkout $VERSION_1
./scripts/build.sh
cp -r build/* ${VERSION_1_DIR}
if [ ! -f ${VERSION_1_DIR}/avalanchego ]
then
echo building avalanchego $VERSION_1
rm -rf ${VERSION_1_DIR}
mkdir -p ${VERSION_1_DIR}
cd $AVALANCHEGO_REPO
git checkout $VERSION_1
./scripts/build.sh
cp -r build/* ${VERSION_1_DIR}
fi

VERSION_2_DIR=/tmp/avalanchego-${VERSION_2}/
if [ ! -f ${VERSION_2_DIR}/avalanchego ]; then
echo building avalanchego $VERSION_2
rm -rf ${VERSION_2_DIR}
mkdir -p ${VERSION_2_DIR}
cd $AVALANCHEGO_REPO
git checkout $VERSION_2
./scripts/build.sh
cp -r build/* ${VERSION_2_DIR}
if [ ! -f ${VERSION_2_DIR}/avalanchego ]
then
echo building avalanchego $VERSION_2
rm -rf ${VERSION_2_DIR}
mkdir -p ${VERSION_2_DIR}
cd $AVALANCHEGO_REPO
git checkout $VERSION_2
./scripts/build.sh
cp -r build/* ${VERSION_2_DIR}
fi

SUBNET_EVM_REPO=/tmp/subnet-evm-repo/
if [ ! -d $SUBNET_EVM_REPO ]; then
git clone https://github.com/ava-labs/subnet-evm/ $SUBNET_EVM_REPO
if [ ! -d $SUBNET_EVM_REPO ]
then
git clone https://github.com/ava-labs/subnet-evm/ $SUBNET_EVM_REPO
fi

SUBNET_EVM_VERSION_DIR=/tmp/subnet-evm-${SUBNET_EVM_VERSION}/
if [ ! -f $VERSION_1_DIR/plugins/srEXiWaHuhNyGwPUi444Tu47ZEDwxTWrbQiuD7FmgSAQ6X7Dy ]; then
echo building subnet-evm $SUBNET_EVM_VERSION
rm -rf ${SUBNET_EVM_VERSION_DIR}
mkdir -p ${SUBNET_EVM_VERSION_DIR}
cd $SUBNET_EVM_REPO
git checkout $SUBNET_EVM_VERSION
# NOTE: We are copying the subnet-evm binary here to a plugin hardcoded as srEXiWaHuhNyGwPUi444Tu47ZEDwxTWrbQiuD7FmgSAQ6X7Dy which corresponds to the VM name `subnetevm` used as such in the test
./scripts/build.sh $VERSION_1_DIR/plugins/srEXiWaHuhNyGwPUi444Tu47ZEDwxTWrbQiuD7FmgSAQ6X7Dy
if [ ! -f $VERSION_1_DIR/plugins/srEXiWaHuhNyGwPUi444Tu47ZEDwxTWrbQiuD7FmgSAQ6X7Dy ]
then
echo building subnet-evm $SUBNET_EVM_VERSION
rm -rf ${SUBNET_EVM_VERSION_DIR}
mkdir -p ${SUBNET_EVM_VERSION_DIR}
cd $SUBNET_EVM_REPO
git checkout $SUBNET_EVM_VERSION
# NOTE: We are copying the subnet-evm binary here to a plugin hardcoded as srEXiWaHuhNyGwPUi444Tu47ZEDwxTWrbQiuD7FmgSAQ6X7Dy which corresponds to the VM name `subnetevm` used as such in the test
./scripts/build.sh $VERSION_1_DIR/plugins/srEXiWaHuhNyGwPUi444Tu47ZEDwxTWrbQiuD7FmgSAQ6X7Dy
fi

############################
Expand All @@ -118,26 +123,27 @@ killall avalanche-network-runner || true

echo "launch local test cluster in the background"
bin/avalanche-network-runner \
server \
--log-level debug \
--port=":8080" \
--snapshots-dir=$snapshots_dir \
--grpc-gateway-port=":8081" &
server \
--log-level debug \
--port=":8080" \
--snapshots-dir=$snapshots_dir \
--grpc-gateway-port=":8081" &
#--disable-nodes-output \
PID=${!}

function cleanup() {
function cleanup()
{
echo "shutting down network runner"
kill ${PID}
}
trap cleanup EXIT

echo "running e2e tests"
./tests/e2e/e2e.test \
--ginkgo.v \
--ginkgo.fail-fast \
--log-level debug \
--grpc-endpoint="0.0.0.0:8080" \
--grpc-gateway-endpoint="0.0.0.0:8081" \
--avalanchego-path-1=${VERSION_1_DIR}/avalanchego \
--avalanchego-path-2=${VERSION_2_DIR}/avalanchego
--ginkgo.v \
--ginkgo.fail-fast \
--log-level debug \
--grpc-endpoint="0.0.0.0:8080" \
--grpc-gateway-endpoint="0.0.0.0:8081" \
--avalanchego-path-1=${VERSION_1_DIR}/avalanchego \
--avalanchego-path-2=${VERSION_2_DIR}/avalanchego

0 comments on commit 6855a96

Please sign in to comment.