Skip to content

Commit

Permalink
notify: include stdout/stderr for debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
dnephin committed Aug 27, 2023
1 parent 57554cb commit 6a73d4a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 19 deletions.
1 change: 1 addition & 0 deletions cmd/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ func postRunHook(opts *options, execution *testjson.Execution) error {
if len(command) == 0 {
return nil
}
log.Debugf("exec: %s", command)

cmd := exec.Command(command[0], command[1:]...)
cmd.Stdout = opts.stdout
Expand Down
8 changes: 5 additions & 3 deletions contrib/notify/notify_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,11 @@ func main() {
"-group", "gotestsum",
"-subtitle", subtitle,
}
log.Printf("terminal-notifier %#v", args)
err := exec.Command("terminal-notifier", args...).Run()
if err != nil {
cmd := exec.Command("terminal-notifier", args...)
log.Printf("%#v", cmd.Args)
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
if err := cmd.Run(); err != nil {
log.Fatalf("Failed to exec: %v", err)
}
}
Expand Down
13 changes: 5 additions & 8 deletions contrib/notify/notify_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,11 @@ func main() {
subtitle += fmt.Sprintf(", %d Skipped", skipped)
}

args := []string{
"--icon", icon,
title,
subtitle,
}
log.Printf("notify-send %#v", args)
err := exec.Command("notify-send", args...).Run()
if err != nil {
cmd := exec.Command("notify-send", "--icon", icon, title, subtitle)
log.Printf("%#v", cmd.Args)
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
if err := cmd.Run(); err != nil {
log.Fatalf("Failed to exec: %v", err)
}
}
Expand Down
13 changes: 5 additions & 8 deletions contrib/notify/notify_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,11 @@ func main() {
subtitle += fmt.Sprintf(", %d Skipped", skipped)
}

args := []string{
"-i", icon,
title,
subtitle,
}
log.Printf("notify-send %#v", args)
err := exec.Command("notify-send.exe", args...).Run()
if err != nil {
cmd := exec.Command("notify-send.exe", "-i", icon, title, subtitle)
log.Printf("%#v", cmd.Args)
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
if err := cmd.Run(); err != nil {
log.Fatalf("Failed to exec: %v", err)
}
}
Expand Down

0 comments on commit 6a73d4a

Please sign in to comment.