Skip to content

Commit dcc2e56

Browse files
Copilotsofthack007
andcommitted
Fix debug log capture - separate stdout and stderr streams
Fixed issue where debug logs and network traffic logs were not appearing in CI artifacts: **Problem:** The workflow was redirecting both stdout and stderr to serial.log using `2>&1`, which mixed all wokwi-cli diagnostic output (including debug logs and network traffic) into the serial output file. This prevented separate capture of debug information. **Solution:** 1. **Separate output streams**: Changed redirect from `2>&1` to `2>logs/wokwi.log` - stdout (serial output) → logs/serial.log - stderr (CLI diagnostics, debug logs, network traffic) → logs/wokwi.log 2. **Display debug logs**: Added section to show wokwi.log content when server is ready - Shows last 100 lines of debug output including network traffic logs - Helps verify that debug logging is working correctly 3. **Restore PATH export**: Re-added PATH configuration for wokwi-cli **Result:** Debug logs and network traffic will now be properly captured in logs/wokwi.log and included in CI artifacts, enabling diagnosis of AsyncWebServer connection issues. Co-authored-by: softhack007 <91616163+softhack007@users.noreply.github.com>
1 parent a726141 commit dcc2e56

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

.github/workflows/wokwi-test.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,10 +208,13 @@ jobs:
208208
# Export the token so it's available to child processes
209209
export WOKWI_CLI_TOKEN
210210
211+
# Add PATH for wokwi-cli
212+
export PATH="$HOME/.wokwi-ci/bin:$PATH"
213+
211214
# Start simulator in background with a 90 second timeout
212-
# Wokwi CLI outputs to stderr, serial output goes to stdout
213-
## WOKWI_TIMEOUT=300 ./run-simulator.sh >logs/serial.log 2>&1 &
214-
WOKWI_TIMEOUT=90 ./run-simulator.sh >logs/serial.log 2>&1 &
215+
# Serial output (stdout) goes to serial.log
216+
# Wokwi CLI diagnostics (stderr) including debug logs go to wokwi.log
217+
WOKWI_TIMEOUT=90 ./run-simulator.sh >logs/serial.log 2>logs/wokwi.log &
215218
WOKWI_PID=$!
216219
echo "WOKWI_PID=$WOKWI_PID" >> $GITHUB_ENV
217220
echo "Started Wokwi simulator with PID $WOKWI_PID"
@@ -261,6 +264,9 @@ jobs:
261264
echo ""
262265
echo "=== First 50 lines of Serial output ==="
263266
head -50 logs/serial.log || true
267+
echo ""
268+
echo "=== Wokwi CLI debug log (network traffic) ==="
269+
tail -100 logs/wokwi.log || echo "No wokwi.log available"
264270
265271
- name: Run Playwright tests
266272
run: npm run test:wokwi

0 commit comments

Comments
 (0)