-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Expand file tree
/
Copy pathflake-summary.sh
More file actions
52 lines (45 loc) · 1.84 KB
/
Copy pathflake-summary.sh
File metadata and controls
52 lines (45 loc) · 1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
# Collate high-signal iOS e2e flake markers from CI step logs on disk.
set -uo pipefail
OUT="${RNFB_FLAKE_SUMMARY_OUT:-flake-summary.txt}"
DETOX_LOG="${RNFB_DETOX_LOG:-}"
{
echo "flake-summary generated $(date -u +%Y-%m-%dT%H:%M:%SZ)"
echo ""
summarize() {
local label="$1"
local file="$2"
if [[ ! -f "$file" ]]; then
echo "=== ${label}: (missing ${file}) ==="
echo ""
return
fi
echo "=== ${label}: ${file} ($(wc -l <"$file" | tr -d ' ') lines) ==="
rg -n \
'\[jet-ws\]|\[rnfb-e2e\]|\[jet-coverage\]|\[rnfb-lifecycle\]|RETRYABLE_DISCONNECT|reconnect_recovered|FrontBoard|FBSOpenApplication|coverage-ready|retry-eligibility|install-state|terminateApp|launchApp failure|Jet attempt|FAIL e2e|orchestrate-state|Child process terminated|log stream restarted|\[load-settle\]' \
"$file" 2>/dev/null | tail -200 || true
echo ""
}
summarize "detox-log" "${DETOX_LOG}"
summarize "sim-app-log" "sim-app.log"
summarize "resource-monitor" "resource-monitor.log"
summarize "resource-monitor-android" "resource-monitor-android.log"
summarize "metro-log" "metro.log"
echo "=== disconnect_context vs resource-monitor load ==="
if [[ -f "${DETOX_LOG}" ]]; then
rg -n '\[jet-ws\] disconnect_context' "${DETOX_LOG}" 2>/dev/null | tail -20 || true
fi
if [[ -f "resource-monitor.log" ]]; then
echo "--- resource-monitor load around disconnect (last 80 load lines) ---"
rg -n 'load averages|^\[resource-monitor\] ps-empty' resource-monitor.log 2>/dev/null | tail -80 || true
fi
echo ""
echo "=== log stream death markers ==="
for f in sim-app.log; do
if [[ -f "$f" ]]; then
rg -n 'Child process terminated|log stream restarted' "$f" 2>/dev/null | tail -20 || true
fi
done
echo ""
} >"$OUT"
echo "[flake-summary] wrote ${OUT} ($(wc -l <"$OUT" | tr -d ' ') lines)"