add -v to testrunner, and less output in happy path
This commit is contained in:
1 parent
cc7b781bb3
commit
5a37f652c2
1 file changed
+10
-2
@@ -31,6 +31,7 @@ var (
|
|||||||
|
|
||||||
useScheduler = false
|
useScheduler = false
|
||||||
runParallel = false
|
runParallel = false
|
||||||
|
verbose = false
|
||||||
|
|
||||||
consoleLock = sync.Mutex{}
|
consoleLock = sync.Mutex{}
|
||||||
)
|
)
|
||||||
@@ -103,8 +104,10 @@ func (t test) run(hosts []string) bool {
|
|||||||
} else {
|
} else {
|
||||||
fmt.Printf("%s>>> Test %s finished with success after %0.1f secs%s\n", succ, t.name, duration, reset)
|
fmt.Printf("%s>>> Test %s finished with success after %0.1f secs%s\n", succ, t.name, duration, reset)
|
||||||
}
|
}
|
||||||
fmt.Print(out.String())
|
if err != nil || verbose {
|
||||||
fmt.Println()
|
fmt.Print(out.String())
|
||||||
|
fmt.Println()
|
||||||
|
}
|
||||||
consoleLock.Unlock()
|
consoleLock.Unlock()
|
||||||
|
|
||||||
if err != nil && useScheduler {
|
if err != nil && useScheduler {
|
||||||
@@ -237,8 +240,13 @@ func sequential(ts tests, hosts []string) bool {
|
|||||||
func main() {
|
func main() {
|
||||||
mflag.BoolVar(&useScheduler, []string{"scheduler"}, false, "Use scheduler to distribute tests across shards")
|
mflag.BoolVar(&useScheduler, []string{"scheduler"}, false, "Use scheduler to distribute tests across shards")
|
||||||
mflag.BoolVar(&runParallel, []string{"parallel"}, false, "Run tests in parallel on hosts where possible")
|
mflag.BoolVar(&runParallel, []string{"parallel"}, false, "Run tests in parallel on hosts where possible")
|
||||||
|
mflag.BoolVar(&verbose, []string{"v"}, false, "Print output from all tests (Also enabled via DEBUG=1)")
|
||||||
mflag.Parse()
|
mflag.Parse()
|
||||||
|
|
||||||
|
if len(os.Getenv("DEBUG")) > 0 {
|
||||||
|
verbose = true
|
||||||
|
}
|
||||||
|
|
||||||
tests, err := getTests(mflag.Args())
|
tests, err := getTests(mflag.Args())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Printf("Error parsing tests: %v\n", err)
|
fmt.Printf("Error parsing tests: %v\n", err)
|
||||||
|
|||||||
Reference in new issue
Block a user