d43a86c4bd
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>
49 lines
1.2 KiB
Go
49 lines
1.2 KiB
Go
package e2e
|
|
|
|
import (
|
|
"encoding/json"
|
|
"fmt"
|
|
"os"
|
|
"path/filepath"
|
|
"time"
|
|
)
|
|
|
|
// agentDebugLog appends one NDJSON line for debug-mode hypothesis testing.
|
|
// Best-effort only — never fails the suite. Also prints to stderr so GitHub
|
|
// Actions captures the evidence when there is no local log file.
|
|
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
|
|
}
|
|
fmt.Fprintf(os.Stderr, "DEBUG816647 %s\n", b)
|
|
b = append(b, '\n')
|
|
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
|
|
}
|