Merge branch 'yuki2006-develop' into develop

This commit is contained in:
Jeevanandam M
2016-05-22 13:50:01 -07:00

View File

@@ -3,9 +3,6 @@ package main
import ( import (
"encoding/json" "encoding/json"
"fmt" "fmt"
"github.com/revel/cmd/harness"
"github.com/revel/modules/testrunner/app/controllers"
"github.com/revel/revel"
"io" "io"
"io/ioutil" "io/ioutil"
"net/http" "net/http"
@@ -13,6 +10,10 @@ import (
"path" "path"
"strings" "strings"
"time" "time"
"github.com/revel/cmd/harness"
"github.com/revel/modules/testrunner/app/controllers"
"github.com/revel/revel"
) )
var cmdTest = &Command{ var cmdTest = &Command{
@@ -117,13 +118,19 @@ You can add it to a run mode configuration with the following line:
) )
for i := 0; ; i++ { for i := 0; ; i++ {
if resp, err = http.Get(baseUrl + "/@tests.list"); err == nil { if resp, err = http.Get(baseUrl + "/@tests.list"); err == nil {
break if resp.StatusCode == http.StatusOK {
break
}
} }
if i < 3 { if i < 3 {
time.Sleep(3 * time.Second) time.Sleep(3 * time.Second)
continue continue
} }
errorf("Failed to request test list: %s", err) if err != nil {
errorf("Failed to request test list: %s", err)
} else {
errorf("Failed to request test list: non-200 response")
}
} }
defer resp.Body.Close() defer resp.Body.Close()
json.NewDecoder(resp.Body).Decode(&testSuites) json.NewDecoder(resp.Body).Decode(&testSuites)