test(e2e): instrument hostname gate and startup for CI debug
test / test (push) Has been cancelled

Capture docker inspect, /data modes, supervisorctl, and entrypoint markers
on failure (stderr DEBUG816647 lines + debug-816647.log) so release CI can
show why valid_hostname_starts / startup_processes_running die with empty logs.

Co-Authored-By: Composer <noreply@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
mixeme
2026-08-09 08:51:18 +03:00
parent 231d341d0d
commit 8f4d29f584
3 changed files with 150 additions and 3 deletions
+46
View File
@@ -0,0 +1,46 @@
package e2e
import (
"encoding/json"
"os"
"path/filepath"
"time"
)
// agentDebugLog appends one NDJSON line for debug-mode hypothesis testing.
// Best-effort only — never fails the suite.
func agentDebugLog(hypothesisID, location, message string, data map[string]any) {
// #region agent log
payload := map[string]any{
"sessionId": "816647",
"hypothesisId": hypothesisID,
"location": location,
"message": message,
"data": data,
"timestamp": time.Now().UnixMilli(),
"runId": "pre-fix",
}
b, err := json.Marshal(payload)
if err != nil {
return
}
b = append(b, '\n')
// Prefer repo-root log (workspace); also try cwd-relative for CI artifacts.
paths := []string{
filepath.Join("..", "..", "debug-816647.log"),
"debug-816647.log",
}
if wd, err := os.Getwd(); err == nil {
paths = append([]string{filepath.Join(wd, "..", "..", "debug-816647.log")}, paths...)
}
for _, p := range paths {
f, err := os.OpenFile(p, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0o644)
if err != nil {
continue
}
_, _ = f.Write(b)
_ = f.Close()
return
}
// #endregion
}