Skip to content

Commit f4463c0

Browse files
feat(e2e): --keep-alive flag + CI frontend smoke step
- solana_e2e_local.sh: E2E_KEEP_ALIVE=1 / --keep-alive — on SUCCESS stop the committee processes but leave the validator + ledger up, so the demo frontend (jito-ncn-program frontend/) or its Playwright smoke can read the settled story from the live RPC; failure path unchanged - solana-e2e.yml: run the script with --keep-alive and add a final step that runs frontend/smoke.mjs from the NCN clone the script already maintains (headless Playwright: state PDA decode, sha256-verified story render, real program ids, zero console errors) against the still-live validator; skips gracefully until smoke.mjs lands on jito-ncn-program main; screenshot uploaded as artifact
1 parent 49903e9 commit f4463c0

2 files changed

Lines changed: 60 additions & 1 deletion

File tree

.github/workflows/solana-e2e.yml

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,45 @@ jobs:
7373
path: ~/.cache/solana-e2e-src
7474
key: solana-e2e-src-${{ runner.os }}-${{ env.AGAVE_VERSION }}-358fbc3c20d947c977a136808f9fbf7f070e478b
7575

76+
# --keep-alive: on success the committee processes stop but the
77+
# validator stays up, so the frontend smoke below can read the settled
78+
# story from the live RPC. The runner tears everything down at job end.
7679
- name: Run the one-command e2e
77-
run: bash scripts/solana_e2e_local.sh
80+
run: bash scripts/solana_e2e_local.sh --keep-alive
81+
82+
# Frontend smoke (Track K): headless Playwright drives the demo page in
83+
# BreadchainCoop/jito-ncn-program frontend/ against the validator the
84+
# previous step left running, asserting the REAL settled story renders
85+
# (state PDA decode, sha256-verified story from the buffer account, real
86+
# program ids, zero console errors). The frontend lives in the NCN
87+
# clone the e2e script already maintains; skip gracefully until
88+
# frontend/smoke.mjs is on that repo's main.
89+
- name: Frontend smoke (Playwright reads the settled story)
90+
run: |
91+
NCN_SRC="${XDG_CACHE_HOME:-$HOME/.cache}/solana-e2e-src/jito-ncn-program"
92+
SMOKE="$NCN_SRC/frontend/smoke.mjs"
93+
CONFIG="$GITHUB_WORKSPACE/.solana-e2e/out/frontend-config.json"
94+
if [[ ! -f "$SMOKE" ]]; then
95+
echo "frontend/smoke.mjs not on jito-ncn-program main yet — skipping"
96+
exit 0
97+
fi
98+
if [[ ! -f "$CONFIG" ]]; then
99+
echo "no frontend-config.json (LLM leg skipped?) — skipping"
100+
exit 0
101+
fi
102+
mkdir -p /tmp/pw && cd /tmp/pw
103+
npm init -y > /dev/null
104+
npm install playwright > /dev/null
105+
npx playwright install --with-deps chromium
106+
node "$SMOKE" "$CONFIG" --screenshot /tmp/pw/frontend-live.png
107+
108+
- name: Upload frontend smoke screenshot
109+
if: always()
110+
uses: actions/upload-artifact@v4
111+
with:
112+
name: frontend-live-screenshot
113+
path: /tmp/pw/frontend-live.png
114+
if-no-files-found: ignore
78115

79116
- name: Upload logs on failure
80117
if: failure()

scripts/solana_e2e_local.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,21 @@
4040
# E2E_KEEP_LEDGER=1 keep the ledger dir on exit (large!)
4141
# E2E_TICKS_PER_SLOT validator ticks per slot (default 16)
4242
# E2E_LLM=0 skip the LLM settlement leg
43+
# E2E_KEEP_ALIVE=1 (or --keep-alive) on SUCCESS: stop the committee
44+
# processes but leave the validator + ledger up, so
45+
# the frontend (or the Playwright smoke) can read the
46+
# settled story from the live RPC afterwards
4347

4448
set -euo pipefail
4549

50+
for arg in "$@"; do
51+
case "$arg" in
52+
--keep-alive) E2E_KEEP_ALIVE=1 ;;
53+
*) echo "unknown argument: $arg" >&2; exit 2 ;;
54+
esac
55+
done
56+
E2E_KEEP_ALIVE="${E2E_KEEP_ALIVE:-0}"
57+
4658
# ---------------------------------------------------------------------------
4759
# Pins — single source of truth for source provenance
4860
# ---------------------------------------------------------------------------
@@ -84,6 +96,16 @@ fail() { echo -e "${RED}[e2e] $*${NC}"; exit 1; }
8496
PIDS=()
8597
cleanup() {
8698
local code=$?
99+
if [[ $code -eq 0 && "$E2E_KEEP_ALIVE" == "1" ]]; then
100+
say "keep-alive: stopping committee processes, leaving the validator up"
101+
for pid in "${PIDS[@]:-}"; do kill "$pid" 2>/dev/null || true; done
102+
pkill -f "counter-solana-node --key-file $OUT" 2>/dev/null || true
103+
pkill -f "counter-solana-router --key-file $OUT" 2>/dev/null || true
104+
ok "validator still running at $RPC_URL (ledger: $LEDGER)"
105+
ok "frontend config: $OUT/frontend-config.json"
106+
ok "teardown: pkill -f 'solana-test-validator --ledger $LEDGER'; rm -rf '$LEDGER'"
107+
exit 0
108+
fi
87109
say "cleanup (exit $code)"
88110
for pid in "${PIDS[@]:-}"; do kill "$pid" 2>/dev/null || true; done
89111
pkill -f "counter-solana-node --key-file $OUT" 2>/dev/null || true

0 commit comments

Comments
 (0)