-
Notifications
You must be signed in to change notification settings - Fork 310
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
ci: 🚭 fix summonerd smoke tests #4358
Merged
+37
−11
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
f8694d9
pd: 🐣 `tokio::spawn()` spawns onto current async runtime
cratelyn 48259cb
flake: ⭕ add `cometbft` to packages list
cratelyn c48d2f4
gitignore: 😯 ignore `phase1.bin` generated by summoner test
cratelyn 306efec
ci: 🚀 ergonomic changes for `smoke-summoner.sh`
cratelyn c92fc0e
ci: 📞 `smoke-summoner.sh` signal handling fixes
cratelyn 3998da3
pcli: 🐛 add `memo_return_address` to ceremony
cratelyn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cratelyn marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,22 @@ | ||
#!/bin/bash | ||
# Run e2e summoner ceremony in CI | ||
#!/usr/bin/env bash | ||
|
||
# This script runs an end-to-end test of the summoner ceremony in CI. | ||
|
||
set -euo pipefail | ||
|
||
# This script also runs the devnet. The reason for this is that if testnet | ||
# preview is redeployed during the run of this script, the script will fail | ||
# as the chain ID will be different. | ||
|
||
# If `SUMMONER_SMOKE_RESET=1` is set, automatically reset the testnet data | ||
# directory, and clear the summonerd directory. This is helpful if running this | ||
# test in a loop with e.g. `entr` or `cargo watch`. | ||
if [[ "${SUMMONER_SMOKE_RESET:-0}" -eq '1' ]] ; then | ||
cargo run --release --bin pd -- testnet unsafe-reset-all | ||
rm -rf /tmp/summonerd | ||
rm -rf /tmp/account1 | ||
fi | ||
|
||
cratelyn marked this conversation as resolved.
Show resolved
Hide resolved
|
||
# Fail fast if testnet dir exists, otherwise `cargo run ...` will block | ||
# for a while, masking the error. | ||
if [[ -d ~/.penumbra/testnet_data ]] ; then | ||
|
@@ -14,6 +25,21 @@ if [[ -d ~/.penumbra/testnet_data ]] ; then | |
exit 1 | ||
fi | ||
|
||
# Fail fast if `/tmp/` directories created by this test already exist. | ||
# Otherwise, this test may be inheriting stale state from a previous run. | ||
if [[ -d /tmp/summonerd ]] ; then | ||
>&2 echo "ERROR: summonerd directory exists at /tmp/summonerd" | ||
>&2 echo "Not removing this directory automatically; to remove, run: rm -rf /tmp/summonerd/" | ||
exit 1 | ||
fi | ||
if [[ -d /tmp/account1 ]] ; then | ||
>&2 echo "ERROR: account1 directory exists at /tmp/account1" | ||
>&2 echo "Not removing this directory automatically; to remove, run: rm -rf /tmp/account1/" | ||
exit 1 | ||
fi | ||
|
||
# Fail fast if `cometbft` is not in the $PATH, we are missing software to | ||
# run this smoke test. | ||
if ! hash cometbft > /dev/null 2>&1 ; then | ||
>&2 echo "ERROR: cometbft not found in PATH" | ||
>&2 echo "See install guide: https://guide.penumbra.zone/main/pd/build.html" | ||
|
@@ -41,7 +67,7 @@ cargo run --quiet --release --bin pd -- start --home "${HOME}/.penumbra/testnet_ | |
pd_pid="$!" | ||
|
||
# Ensure processes are cleaned up after script exits, regardless of status. | ||
trap 'kill -9 "$cometbft_pid" "$pd_pid"' EXIT | ||
trap 'kill -9 "$cometbft_pid" "$pd_pid"' EXIT INT | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you for the super detailed commit messages. 🙏 |
||
echo "Waiting $TESTNET_BOOTTIME seconds for network to boot..." | ||
sleep "$TESTNET_BOOTTIME" | ||
|
@@ -67,7 +93,7 @@ echo "Starting phase 1 run..." | |
cargo run --quiet --release --bin summonerd -- start --phase 1 --storage-dir /tmp/summonerd --fvk $SUMMONER_FVK --node http://127.0.0.1:8080 --bind-addr 127.0.0.1:8082 & | ||
phase1_pid="$!" | ||
# If script ends early, ensure phase 1 is halted. | ||
trap 'kill -9 "$phase1_pid"' EXIT | ||
trap 'kill -9 "$cometbft_pid" "$pd_pid" "$phase1_pid"' EXIT INT | ||
|
||
echo "Setting up test accounts..." | ||
# We are returning 0 always here because the backup wallet file does not respect the location of | ||
|
@@ -97,7 +123,7 @@ echo "Starting phase 2 run..." | |
cargo run --quiet --release --bin summonerd -- start --phase 2 --storage-dir /tmp/summonerd --fvk $SUMMONER_FVK --node http://127.0.0.1:8080 --bind-addr 127.0.0.1:8082 & | ||
phase2_pid="$!" | ||
# If script ends early, ensure phase 2 is halted. | ||
trap 'kill -9 "$phase2_pid"' EXIT | ||
trap 'kill -9 "$cometbft_pid" "$pd_pid" "$phase1_pid" "$phase2_pid' EXIT INT | ||
|
||
echo "Phase 2 contributions..." | ||
cargo run --quiet --release --bin pcli -- --home /tmp/account1 ceremony contribute --coordinator-url http://127.0.0.1:8082 --coordinator-address $SUMMONER_ADDRESS --phase 2 --bid 10penumbra | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the fix 🩹
everything else in this branch is tweaks to facilitate debugging, and confirming this does in fact fix the issue.