Skip to content

Commit 7aece7c

Browse files
lukemarsdenclaude
andcommitted
feat: log Zed binary commit hash at test start
Extracts the ZED_COMMIT_SHA baked into the binary at compile time and logs it prominently. This is the definitive proof of what source the binary was built from. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 6e21281 commit 7aece7c

1 file changed

Lines changed: 21 additions & 8 deletions

File tree

crates/external_websocket_sync/e2e-test/run_e2e.sh

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -108,14 +108,27 @@ if [ ! -f "$MOCK_SERVER" ]; then
108108
exit 1
109109
fi
110110

111-
echo "[setup] Zed binary: $ZED_BINARY"
112-
echo "[setup] md5: $(md5sum "$ZED_BINARY" 2>/dev/null | cut -c1-32)"
113-
echo "[setup] size: $(stat -c '%s' "$ZED_BINARY" 2>/dev/null) bytes"
114-
echo "[setup] mtime: $(stat -c '%y' "$ZED_BINARY" 2>/dev/null | cut -d. -f1)"
115-
echo "[setup] ThreadLoadError in source (expected 1): $(strings "$ZED_BINARY" | grep -c 'ThreadLoadError' 2>/dev/null || echo unknown)"
116-
echo "[setup] 'creating new thread as fallback' present: $(strings "$ZED_BINARY" | grep -c 'creating new thread as fallback' 2>/dev/null || echo unknown)"
117-
echo "[setup] Mock server: $MOCK_SERVER"
118-
echo "[setup] md5: $(md5sum "$MOCK_SERVER" 2>/dev/null | cut -c1-32)"
111+
echo ""
112+
echo "============================================"
113+
echo " BINARY VERSIONS"
114+
echo "============================================"
115+
# Extract the ZED_COMMIT_SHA baked into the binary at compile time (set via
116+
# .drone.yml: export ZED_COMMIT_SHA=$(git rev-parse HEAD)). This is the
117+
# definitive proof of what source the binary was built from.
118+
# The sha is a 40-char hex string embedded as a string literal.
119+
ZED_BUILT_SHA=$(strings "$ZED_BINARY" 2>/dev/null | grep -oP '(?<=starting zed version [^,]*, sha )[0-9a-f]{40}' || true)
120+
if [ -z "$ZED_BUILT_SHA" ]; then
121+
# Fallback: find any 40-char hex that looks like a git sha
122+
ZED_BUILT_SHA=$(strings "$ZED_BINARY" 2>/dev/null | grep -oE '\b[0-9a-f]{40}\b' | head -1 || true)
123+
fi
124+
echo " Zed binary: $ZED_BINARY"
125+
echo " Zed commit SHA: ${ZED_BUILT_SHA:-NOT BAKED IN (local dev build?)}"
126+
echo " Zed md5: $(md5sum "$ZED_BINARY" 2>/dev/null | cut -c1-32)"
127+
echo " Zed size: $(stat -c '%s' "$ZED_BINARY" 2>/dev/null) bytes"
128+
echo " Go test server: $MOCK_SERVER"
129+
echo " Go server md5: $(md5sum "$MOCK_SERVER" 2>/dev/null | cut -c1-32)"
130+
echo "============================================"
131+
echo ""
119132

120133
echo "[setup] Zed binary: $ZED_BINARY"
121134
echo "[setup] Mock server: $MOCK_SERVER"

0 commit comments

Comments
 (0)