Skip to content

Commit

Permalink
display go test error if there is an error when running go test
Browse files Browse the repository at this point in the history
At the moment its very basic and breaks spinner funcitonality but at
least the error is visible.
  • Loading branch information
michalfranc-form3 committed Apr 5, 2021
1 parent cc35ce0 commit 1575f63
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/app/rgt/commands/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"time"
)

//TODO: First run should happen at start - we dont need to wait for file change
//TODO: BUGFIX when there is no library and io cant run go test ./... then the screen is empty

//TODO: global configuration and per project configuration
Expand Down Expand Up @@ -60,7 +61,6 @@ var startCmd = &cobra.Command{
if event.Op&fsnotify.Write == fsnotify.Write {
//TODO: only watch on golang files and configure ability to ignore files
lastFileWritten = event.Name

// We want to start goroutine block it for 1-2-3 seconds
// And then listen to files - there might be many events for 1 file
// We are only interested in one last one
Expand Down Expand Up @@ -97,6 +97,8 @@ var startCmd = &cobra.Command{
log.Fatalf("incorrect test runner specified '%s' supported [go, gotestsum]", goTestRunner)
}

// Make sure we get the error
cmd.Stderr = os.Stderr
out, _ := cmd.Output()
s.Stop()
fmt.Println(string(out))
Expand Down

0 comments on commit 1575f63

Please sign in to comment.