Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

testing/firo: harness tweaks #2494

Merged
merged 1 commit into from
Sep 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 18 additions & 3 deletions dex/testing/firo/electrum.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,12 @@ ELECTRUM_DIR=${ASSET_DIR}/client
REPO_DIR=${ELECTRUM_DIR}/electrum-repo
WALLET_DIR=${ELECTRUM_DIR}/wallet
NET_DIR=${WALLET_DIR}/regtest
HARNESS_DIR=~/dextest/firo/harness-ctl

# startup options
# CLI, DAEMON, GUI (Default start as CLI)
STARTUP=CLI
# To change the mode, run with e.g.
# STARTUP=DAEMON ./electrum.sh
ELECTRUM_REGTEST_ARGS="--regtest --dir=${WALLET_DIR}"
WALLET_PASSWORD="abc"

Expand All @@ -54,8 +56,11 @@ fi

git remote -v

git fetch --depth 1 origin ${COMMIT}
git reset --hard FETCH_HEAD
CURRENT_COMMIT=$(git rev-parse HEAD)
if [ ! "${CURRENT_COMMIT}" == "${COMMIT}" ]; then
git fetch --depth 1 origin ${COMMIT}
git reset --hard FETCH_HEAD
fi

if [ ! -d "${ELECTRUM_DIR}/venv" ]; then
# The venv interpreter will be this python version, e.g. python3.10
Expand Down Expand Up @@ -110,6 +115,13 @@ rpcpassword=pass
rpcbind=127.0.0.1:${RPCPORT}
EOF

cat > "${HARNESS_DIR}/electrum-cli" <<EOF
source ${ELECTRUM_DIR}/venv/bin/activate
PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python ${REPO_DIR}/electrum-firo ${ELECTRUM_REGTEST_ARGS} "\$@" --password=${WALLET_PASSWORD}
deactivate
EOF
chmod +x "${HARNESS_DIR}/electrum-cli"

if [ "${STARTUP}" == "GUI" ];
then
echo "Starting GUI wallet"
Expand All @@ -126,5 +138,8 @@ else
else
echo "Starting CLI wallet"
./electrum-firo ${ELECTRUM_REGTEST_ARGS} -v daemon
# Run
# ./electrum-cli load_wallet
# from the firo harness-ctl directory.
fi
fi
2 changes: 2 additions & 0 deletions dex/testing/firo/test/electrumx_network_test.go
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test is apparently finicky anyway. Failing with

electrumx_network_test.go:102: dial tcp: lookup electrumx.firo.org: i/o timeout

Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// This code is available on the terms of the project LICENSE.md file,
// also available online at https://blueoakcouncil.org/license/1.0.0.

//go:build live

// Connects to one ElectrumX-Firo testnet server and one ElectrumX-Firo
// mainnet server and tests a subset of electrumx-firo commands.
//
Expand Down
1 change: 1 addition & 0 deletions run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ go test -c -o /dev/null -tags rpclive ./client/asset/eth
go test -c -o /dev/null -tags harness ./client/asset/zec
go test -c -o /dev/null -tags harness ./client/asset/dash
go test -c -o /dev/null -tags harness ./client/asset/firo
go test -c -o /dev/null -tags live ./dex/testing/firo/test
go test -c -o /dev/null -tags dcrlive ./server/asset/dcr
go test -c -o /dev/null -tags btclive ./server/asset/btc
go test -c -o /dev/null -tags ltclive ./server/asset/ltc
Expand Down