Skip to content

Commit f93be63

Browse files
committed
ci(system-test): add workflow-layer fallback for missing stest-up.sh
Wrap the stest-up.sh invocation in an existence check, and fall back to the legacy inline `cp config + nohup java -jar + poll 8090` path if scripts/stest-up.sh is absent in the checked-out system-test branch. Same for the stest-down.sh teardown step. This handles the scenario where merge order across the three involved repos (tron-deployment / system-test / java-tron) skews — e.g., the java-tron workflow change lands upstream before the system-test scripts/ commit does. Without this fallback, every java-tron PR's CI would go red until system-test catches up. With it, CI gracefully degrades to the pre-trond bring-up path. Combined with the script-layer fallback inside stest-up.sh (which handles trond release URL failures), there are now two independent safety nets: Layer 1 (this step): stest-up.sh missing → legacy nohup Layer 2 (stest-up.sh): trond release unreachable → nohup Both layers ultimately land at the same end-state: java-tron started on /usr/bin/java JDK 8, HTTP 8090 reachable, ready for stest TestNG. Log capture also covers both modes: journalctl + node.log (trond), fullnode.log (legacy). Plan: keep the fallback through Phase B and the upstream PR cycle; remove it in a follow-up PR once the trond-mode path is consistently green across all three repos.
1 parent dcd9076 commit f93be63

1 file changed

Lines changed: 56 additions & 14 deletions

File tree

.github/workflows/system-test.yml

Lines changed: 56 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,47 @@ jobs:
6161
working-directory: java-tron
6262
run: ./gradlew clean build -x test --no-daemon
6363

64-
# Phase A note: trond release URL points at the warku123 fork
65-
# while the system-test integration is in review. The Phase B
66-
# switchover commit will repoint to
67-
# tronprotocol/tron-deployment after upstream merge + release.
68-
- name: Bring up the stest single-SR via trond
64+
# Phase A note: trond release URL inside stest-up.sh defaults to
65+
# the warku123 fork; will be repointed to tronprotocol after
66+
# upstream merge + release.
67+
#
68+
# Two-layer fallback for resilience to cross-repo merge-order
69+
# skew:
70+
# - workflow layer (this step): if scripts/stest-up.sh is
71+
# absent (system-test PR not merged yet but java-tron PR
72+
# was), fall back to the legacy inline nohup path.
73+
# - script layer (inside stest-up.sh): if trond release URL
74+
# is unreachable / sha256 mismatch, fall back to nohup
75+
# java -jar with the bundled config.
76+
#
77+
# Either path lands at the same state (HTTP 8090 reachable +
78+
# node minting blocks), so the stest gradle step works.
79+
- name: Bring up the stest single-SR
6980
env:
7081
STEST_JAR: ${{ github.workspace }}/java-tron/build/libs/FullNode.jar
71-
run: bash system-test/scripts/stest-up.sh
82+
run: |
83+
if [ -x system-test/scripts/stest-up.sh ]; then
84+
echo "[bring-up] using system-test/scripts/stest-up.sh"
85+
bash system-test/scripts/stest-up.sh
86+
else
87+
echo "[bring-up] stest-up.sh not found in system-test checkout"
88+
echo "[bring-up] falling back to inline nohup java -jar"
89+
cp system-test/testcase/src/test/resources/config-system-test.conf java-tron/
90+
cd java-tron
91+
nohup java -jar build/libs/FullNode.jar --witness \
92+
-c config-system-test.conf > fullnode.log 2>&1 &
93+
for i in $(seq 1 60); do
94+
if curl -s --fail "http://localhost:8090/wallet/getblockbynum?num=1" \
95+
> /dev/null 2>&1; then
96+
echo "[bring-up] FullNode ready after $((i*5))s (legacy path)"
97+
exit 0
98+
fi
99+
sleep 5
100+
done
101+
echo "[bring-up] FullNode failed to start within 5 minutes (legacy path)"
102+
tail -50 fullnode.log
103+
exit 1
104+
fi
72105
73106
- name: Run system tests
74107
working-directory: system-test
@@ -81,25 +114,34 @@ jobs:
81114
./gradlew clean --no-daemon
82115
./gradlew --info stest --no-daemon
83116
84-
- name: Capture node log + journal
117+
- name: Capture node logs
85118
if: always()
86119
run: |
87120
mkdir -p logs
88-
# trond writes the FullNode stdout/stderr through systemd's
89-
# journal; dump the full journal for the unit so post-mortem
90-
# works without ssh access to the runner.
91-
sudo journalctl -u tron-stest-singlenode --no-pager -o short-iso > logs/journal.log 2>&1 || true
92-
# If a node.log exists in the install path (some trond
93-
# invocations write directly), capture that too.
121+
# trond mode: systemd journal for the unit
122+
sudo journalctl -u tron-stest-singlenode --no-pager -o short-iso \
123+
> logs/journal.log 2>&1 || true
124+
# trond mode: trond fallback writes node.log directly to install_path
125+
# fallback mode: stest-up.sh writes node.log to install_path
94126
sudo cp /opt/tron/stest-singlenode/node.log logs/node.log 2>/dev/null || true
127+
# legacy inline path: java-tron/fullnode.log
128+
cp java-tron/fullnode.log logs/fullnode.log 2>/dev/null || true
95129
sudo chown -R "$USER:$USER" logs/
96130
ls -lah logs/
97131
98132
- name: Tear down stest deployment
99133
if: always()
100134
env:
101135
STEST_KEEP_DATA: ""
102-
run: bash system-test/scripts/stest-down.sh
136+
run: |
137+
# Mirror the workflow-layer fallback in the bring-up step:
138+
# only call stest-down.sh if it exists. Legacy-path nodes
139+
# die with the runner VM so no explicit teardown is needed.
140+
if [ -x system-test/scripts/stest-down.sh ]; then
141+
bash system-test/scripts/stest-down.sh
142+
else
143+
echo "[teardown] stest-down.sh not found; skipping (legacy path)"
144+
fi
103145
104146
- name: Upload trond + node logs
105147
if: always()

0 commit comments

Comments
 (0)