chore: tidy up cli-advanced-e2e workflow (#4460)

chore: tidy up cli-advanced-e2e workflow
- we don't run agents in the cli-advanced-e2e test anymore since our
push for the updated CLI v4
- until we add agents back
(https://github.com/hyperlane-xyz/hyperlane-monorepo/issues/4070) or
migrate these tests entirely
(https://github.com/hyperlane-xyz/hyperlane-monorepo/issues/4417), we
should simplify the test
	- stop the agent prebuild to save precious cache space + ci cost
- reduces ci cost by switching simple ts tests to a standard github
runner
pull/4470/head
Paul Balaji 2 months ago committed by GitHub
parent a19e882fd3
commit b94a74534d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 81
      .github/workflows/test.yml
  2. 104
      typescript/cli/ci-advanced-test.sh

@ -282,59 +282,10 @@ jobs:
echo "All e2e-matrix jobs have completed."
# You can add additional commands here to report the result as needed
prebuild-cli-e2e:
runs-on: larger-runner
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.base_ref == 'main' || github.base_ref == 'cli-2.0') || github.event_name == 'merge_group'
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
submodules: recursive
- name: setup rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
- name: rust cache
uses: Swatinem/rust-cache@v2
with:
prefix-key: "v1-${{ runner.os }}-rust-cache"
shared-key: "cli-e2e"
workspaces: |
./rust
- name: Free disk space
run: |
# Based on https://github.com/actions/runner-images/issues/2840#issuecomment-790492173
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- name: Install mold linker
uses: rui314/setup-mold@v1
with:
mold-version: 2.0.0
make-default: true
- name: Build validator
run: cargo build --bin validator --features test-utils
working-directory: ./rust
env:
RUST_BACKTRACE: 'full'
- name: Build relayer
run: cargo build --bin relayer --features test-utils
working-directory: ./rust
env:
RUST_BACKTRACE: 'full'
cli-advanced-e2e:
runs-on: larger-runner
runs-on: ubuntu-latest
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.base_ref == 'main' || github.base_ref == 'cli-2.0') || github.event_name == 'merge_group'
needs: [yarn-build, prebuild-cli-e2e]
needs: [yarn-build]
strategy:
matrix:
include:
@ -354,34 +305,6 @@ jobs:
- name: foundry-install
uses: foundry-rs/foundry-toolchain@v1
- name: setup rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
- name: rust cache
uses: Swatinem/rust-cache@v2
with:
prefix-key: "v1-${{ runner.os }}-rust-cache"
shared-key: "cli-e2e"
workspaces: |
./rust
- name: Free disk space
run: |
# Based on https://github.com/actions/runner-images/issues/2840#issuecomment-790492173
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- name: Install mold linker
uses: rui314/setup-mold@v1
with:
mold-version: 2.0.0
make-default: true
- name: yarn-cache
uses: actions/cache@v4
with:

@ -34,12 +34,6 @@ _main() {
run_hyperlane_deploy_warp;
run_hyperlane_send_message;
# cd ./rust;
# run_validator;
# run_relayer;
# run_hyperlane_status;
kill_anvil;
echo "Done";
@ -260,104 +254,6 @@ run_hyperlane_send_message() {
echo "Message 2 ID: $MESSAGE2_ID"
}
run_validator() {
echo -e "\nPre-building validator with cargo"
cargo build --bin validator --features test-utils
# set some default agent env vars, used by both validators and relayer
export HYP_CHAINS_${CHAIN1_CAPS}_BLOCKS_REORGPERIOD=0
export HYP_CHAINS_${CHAIN1_CAPS}_CUSTOMRPCURLS="http://127.0.0.1:${CHAIN1_PORT}"
export HYP_CHAINS_${CHAIN2_CAPS}_BLOCKS_REORGPERIOD=0
export HYP_CHAINS_${CHAIN2_CAPS}_CUSTOMRPCURLS="http://127.0.0.1:${CHAIN2_PORT}"
VALIDATOR_PORT=9091
for CHAIN in ${CHAIN1} ${CHAIN2}
do
# don't need the second validator for pi<>core test
if [ "$CHAIN" == "$CHAIN2" ] && [ "$TEST_TYPE" == "$TEST_TYPE_PI_CORE" ]; then
echo "Skipping validator for $CHAIN2 due to $TEST_TYPE_PI_CORE test type"
continue
fi
VALIDATOR_PORT=$((VALIDATOR_PORT+1))
echo "Running validator on $CHAIN on port $VALIDATOR_PORT"
export CONFIG_FILES=/tmp/agent-config.json
export HYP_ORIGINCHAINNAME=${CHAIN}
export HYP_VALIDATOR_INTERVAL=1
export HYP_VALIDATOR_TYPE=hexKey
export HYP_VALIDATOR_KEY=0x2a871d0798f97d79848a013d4936a73bf4cc922c825d33c1cf7073dff6d409c6
export HYP_CHECKPOINTSYNCER_TYPE=localStorage
export HYP_CHECKPOINTSYNCER_PATH=/tmp/${CHAIN}/validator
export HYP_TRACING_LEVEL=debug
export HYP_TRACING_FMT=compact
export HYP_METRICSPORT=$VALIDATOR_PORT
cargo run --bin validator > /tmp/${CHAIN}/validator-logs.txt &
done
echo "Validator running, sleeping to let it sync"
# This needs to be long to allow time for the cargo build to finish
sleep 20
echo "Done sleeping"
for CHAIN in ${CHAIN1} ${CHAIN2}
do
# only have one validator announce in pi<>core test
if [ "$CHAIN" == "$CHAIN2" ] && [ "$TEST_TYPE" == "$TEST_TYPE_PI_CORE" ]; then
echo "Skipping validator for $CHAIN2 due to $TEST_TYPE_PI_CORE test type"
continue
fi
echo "Validator Announcement for ${CHAIN}:"
cat /tmp/${CHAIN}/validator/announcement.json
done
}
run_relayer() {
echo -e "\nPre-building relayer with cargo"
cargo build --bin relayer --features test-utils
echo "Running relayer"
export CONFIG_FILES=/tmp/agent-config.json
export HYP_RELAYCHAINS=${CHAIN1},${CHAIN2}
export HYP_ALLOWLOCALCHECKPOINTSYNCERS=true
export HYP_DB=/tmp/relayer
export HYP_GASPAYMENTENFORCEMENT='[{"type":"none"}]'
export HYP_CHAINS_${CHAIN1_CAPS}_SIGNER_TYPE=hexKey
export HYP_CHAINS_${CHAIN1_CAPS}_SIGNER_KEY=0xdbda1821b80551c9d65939329250298aa3472ba22feea921c0cf5d620ea67b97
export HYP_CHAINS_${CHAIN2_CAPS}_SIGNER_TYPE=hexKey
export HYP_CHAINS_${CHAIN2_CAPS}_SIGNER_KEY=0xdbda1821b80551c9d65939329250298aa3472ba22feea921c0cf5d620ea67b97
export HYP_METRICSPORT=9090
cargo run --bin relayer > /tmp/relayer/relayer-logs.txt &
# This needs to be long to allow time for the cargo build to finish
echo "Waiting for relayer..."
sleep 20
echo "Done running relayer, checking message delivery statuses"
}
run_hyperlane_status() {
for i in "1 $MESSAGE1_ID" "2 $MESSAGE2_ID"
do
set -- $i
echo "Checking delivery status of $1: $2"
yarn workspace @hyperlane-xyz/cli run hyperlane status \
--id $2 \
--destination ${CHAIN2} \
--registry $REGISTRY_PATH \
--overrides " " \
| tee /tmp/message-status-$1
if ! grep -q "$2 was delivered" /tmp/message-status-$1; then
echo "ERROR: Message $1 was not delivered"
exit 1
else
echo "Message $1 was delivered!"
fi
done
}
update_deployer_balance() {
OLD_BALANCE=$(cast balance $DEPLOYER --rpc-url http://127.0.0.1:${CHAIN1_PORT});
}

Loading…
Cancel
Save