Fix test command

This commit is contained in:
kolaente 2020-08-31 18:37:34 +02:00
parent 681e5f2955
commit 994a59f1f7
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 6 additions and 8 deletions

View File

@ -135,11 +135,14 @@ func runAndStreamOutput(cmd string, args ...string) {
reader := bufio.NewReader(stdout)
line, err := reader.ReadString('\n')
for err == nil {
fmt.Println(line)
fmt.Print(line)
line, err = reader.ReadString('\n')
}
c.Wait()
if err := c.Wait(); err != nil {
fmt.Printf("Error: %s", err)
os.Exit(1)
}
}
// Clean all build, executable and bindata files.
@ -161,14 +164,9 @@ func Clean() error {
func Test() {
// We run everything sequentially and not in parallel to prevent issues with real test databases
// VIKUNJA_SERVICE_ROOTPATH=$(shell pwd) go test $(GOFLAGS) -p 1 -cover -coverprofile cover.out $(PACKAGES)
args := []string{"test", Goflags[0], "-p 1"}
args := []string{"test", Goflags[0], "-p", "1"}
args = append(args, ApiPackages...)
runAndStreamOutput("go", args...)
//for _, a := range ApiPackages {
// args[len(args)-1] = a
// runAndStreamOutput("go", args...)
//}
}
func TestCoverage() {