package main import ( "os" "path/filepath" "runtime" "strings" "testing" "time" ) // vLLM writes its log to stderr; `docker logs` passes that on to its own stderr, so both streams must come back. func TestDockerLogsKeepsStderr(t *testing.T) { if runtime.GOOS == "windows" { t.Skip("needs a shell script as a fake docker") } dir := t.TempDir() fake := "#!/bin/sh\necho out-line\necho 'ValueError: model not supported' >&2\n" if err := os.WriteFile(filepath.Join(dir, "docker"), []byte(fake), 0o755); err != nil { t.Fatal(err) } t.Setenv("PATH", dir+string(os.PathListSeparator)+os.Getenv("PATH")) out, err := dockerLogs(5*time.Second, "logs", "--tail", "5", "x") if err != nil || !strings.Contains(out, "out-line") || !strings.Contains(out, "model not supported") { t.Fatalf("got %q, %v", out, err) } }