mirror of https://github.com/k3s-io/k3s
commit
7dc73a34ac
|
@ -77,9 +77,9 @@ func main() {
|
||||||
u.Add(1)
|
u.Add(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
w := sync.WaitGroup{}
|
results := make(chan error)
|
||||||
for _, h := range strings.Split(*hosts, ",") {
|
hs := strings.Split(*hosts, ",")
|
||||||
w.Add(1)
|
for _, h := range hs {
|
||||||
go func(host string) {
|
go func(host string) {
|
||||||
out, err := runTests(host)
|
out, err := runTests(host)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -87,7 +87,7 @@ func main() {
|
||||||
} else {
|
} else {
|
||||||
glog.Infof("Success Finished Host %s Test Suite %s", host, out)
|
glog.Infof("Success Finished Host %s Test Suite %s", host, out)
|
||||||
}
|
}
|
||||||
w.Done()
|
results <- err
|
||||||
}(h)
|
}(h)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,9 +96,19 @@ func main() {
|
||||||
WaitForUser()
|
WaitForUser()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Wait for the tests to finish
|
// Wait for all tests to complete and check for failures
|
||||||
w.Wait()
|
errCount := 0
|
||||||
glog.Infof("Done")
|
for i := 0; i < len(hs); i++ {
|
||||||
|
if <-results != nil {
|
||||||
|
errCount++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set the exit code if there were failures
|
||||||
|
if errCount > 0 {
|
||||||
|
glog.Errorf("Failure: %d errors encountered.", errCount)
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func WaitForUser() {
|
func WaitForUser() {
|
||||||
|
|
Loading…
Reference in New Issue