Skip to content

Commit f16045b

Browse files
committed
Fix smoke test: Actually fail when Spring crashes
The test was declaring victory even when Spring crashed! Fixed by: 1. Check infolog exists (fail if missing) 2. Search infolog for crash signatures (CrashHandler, Aborted, Segmentation) 3. **Require** LuaUI to load (fail if not found) 4. Check RmlUi messages (warning only, not fatal yet) 5. Only pass if exit code is 0 or 124 (timeout) Before: Crashes declared as "✓ PASSED" - WRONG! After: Crashes detected and test fails - CORRECT! The old logic was backwards - it would pass on any crash that happened quickly. Now it actually validates success criteria.
1 parent 9e16caf commit f16045b

File tree

1 file changed

+51
-29
lines changed

1 file changed

+51
-29
lines changed

.github/workflows/smoke-test.yml

Lines changed: 51 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -162,46 +162,68 @@ jobs:
162162
timeout 10s xvfb-run -a -s "-screen 0 1024x768x24" \
163163
./spring --write-dir $(pwd)/test-data script.txt || EXIT_CODE=$?
164164
165+
echo ""
166+
echo "=== Exit Code Analysis ==="
167+
echo "Spring exit code: ${EXIT_CODE:-0}"
168+
165169
# Exit codes:
166-
# 0 = clean exit (unlikely in 10s)
167-
# 124 = timeout (expected - means it ran without crashing)
168-
# Other = crash/error
170+
# 0 = clean exit
171+
# 124 = timeout (expected - means it ran for 10s without crashing)
172+
# 134 = SIGABRT (6+128) - crash!
173+
# Other non-zero = various crashes
169174
170175
echo ""
171-
echo "=== Checking for RmlUi initialization in logs ==="
172-
if [ -f test-data/infolog.txt ]; then
173-
if grep -i "rmlui" test-data/infolog.txt; then
174-
echo "✓ RmlUi messages found in infolog"
175-
else
176-
echo "⚠ No RmlUi messages found in infolog"
177-
fi
178-
179-
if grep -i "luaui.*loaded\|loading luaui" test-data/infolog.txt; then
180-
echo "✓ LuaUI loaded successfully"
181-
else
182-
echo "⚠ Could not confirm LuaUI loaded"
183-
fi
176+
echo "=== Validating Success Criteria ==="
177+
178+
# Check if infolog exists
179+
if [ ! -f test-data/infolog.txt ]; then
180+
echo "✗ FAIL: No infolog.txt generated - Spring didn't start"
181+
exit 1
182+
fi
183+
184+
# Check for crash in infolog
185+
if grep -q "CrashHandler.*Error.*Aborted\|CrashHandler.*Error.*Segmentation" test-data/infolog.txt; then
186+
echo "✗ FAIL: Spring crashed (found crash in infolog)"
187+
echo ""
188+
echo "=== Last 100 lines of infolog.txt ==="
189+
tail -100 test-data/infolog.txt
190+
exit 1
184191
fi
185-
echo ""
186192
193+
# Check if LuaUI loaded
194+
if ! grep -q "LuaUI.*Loaded\|Loading LuaUI" test-data/infolog.txt; then
195+
echo "✗ FAIL: LuaUI did not load"
196+
echo ""
197+
echo "=== Last 100 lines of infolog.txt ==="
198+
tail -100 test-data/infolog.txt
199+
exit 1
200+
fi
201+
echo "✓ LuaUI loaded successfully"
202+
203+
# Check for RmlUi initialization (optional warning if missing)
204+
if grep -q -i "rmlui" test-data/infolog.txt; then
205+
echo "✓ RmlUi messages found in infolog"
206+
else
207+
echo "⚠ Warning: No RmlUi messages found (might not be fatal)"
208+
fi
209+
210+
# Only accept exit codes 0 or 124 (timeout)
187211
if [ "${EXIT_CODE:-0}" -eq 124 ]; then
188-
echo "✓ SpringBoard started successfully and ran for 10 seconds"
189-
echo "✓ Smoke test PASSED (with LuaUI + RmlUi)"
212+
echo ""
213+
echo "✓ SpringBoard ran for full 10 seconds without crashing"
214+
echo "✓ SMOKE TEST PASSED"
190215
exit 0
191216
elif [ "${EXIT_CODE:-0}" -eq 0 ]; then
217+
echo ""
192218
echo "✓ SpringBoard exited cleanly"
193-
echo "✓ Smoke test PASSED"
219+
echo "✓ SMOKE TEST PASSED"
194220
exit 0
195221
else
196-
echo "✗ SpringBoard crashed with exit code: ${EXIT_CODE}"
197-
echo "✗ Smoke test FAILED"
198-
199-
# Show infolog if available
200-
if [ -f test-data/infolog.txt ]; then
201-
echo "=== Last 100 lines of infolog.txt ==="
202-
tail -100 test-data/infolog.txt
203-
fi
204-
222+
echo ""
223+
echo "✗ FAIL: Spring exited with code ${EXIT_CODE} (expected 0 or 124)"
224+
echo ""
225+
echo "=== Last 100 lines of infolog.txt ==="
226+
tail -100 test-data/infolog.txt
205227
exit 1
206228
fi
207229

0 commit comments

Comments
 (0)