Skip to content
This repository has been archived by the owner on Apr 16, 2020. It is now read-only.

Add a warn-test flag to update #18

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,10 @@ var updateNextCmd = cli.Command{
Name: "no-test",
Usage: "skip testing phase",
},
cli.BoolFlag{
Name: "warn-test",
Usage: "only print a warning when a test fails",
},
},
Action: func(c *cli.Context) error {
ui, err := readUpdateProgress()
Expand Down Expand Up @@ -505,7 +509,7 @@ var updateNextCmd = cli.Command{
}

if changed {
err = checkPackage(dir, c.Bool("no-test"))
err = checkPackage(dir, c.Bool("no-test"), c.Bool("warn-test"))
if err != nil {
return err
}
Expand Down Expand Up @@ -729,7 +733,7 @@ func updatePackage(dir string, changes map[string]string) (bool, error) {
return true, nil
}

func checkPackage(dir string, notest bool) error {
func checkPackage(dir string, notest bool, softTestErr bool) error {
fmt.Println("> Running 'gx deps dupes'")
dupecmd := exec.Command("gx", "deps", "dupes")
dupecmd.Dir = dir
Expand Down Expand Up @@ -767,7 +771,11 @@ func checkPackage(dir string, notest bool) error {
gxtest.Stdout = os.Stdout
gxtest.Stderr = os.Stderr
if err := gxtest.Run(); err != nil {
return fmt.Errorf("error running tests: %s", err)
if !softTestErr {
return fmt.Errorf("error running tests: %s", err)
} else {
fmt.Printf("!! Error running tests: %s\n", err)
}
}
}

Expand Down