mirror of
https://github.com/kevin-DL/revel-cmd.git
synced 2026-01-23 15:31:26 +00:00
fix : Failed to request test list when excepting status code 200
This commit is contained in:
@@ -3,9 +3,9 @@ package main
|
|||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/revel/revel"
|
|
||||||
"github.com/revel/cmd/harness"
|
"github.com/revel/cmd/harness"
|
||||||
"github.com/revel/modules/testrunner/app/controllers"
|
"github.com/revel/modules/testrunner/app/controllers"
|
||||||
|
"github.com/revel/revel"
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"net/http"
|
"net/http"
|
||||||
@@ -117,13 +117,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 {
|
||||||
|
if resp.StatusCode == 200 {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if i < 3 {
|
if i < 3 {
|
||||||
time.Sleep(3 * time.Second)
|
time.Sleep(3 * time.Second)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
if err != nil {
|
||||||
errorf("Failed to request test list: %s", err)
|
errorf("Failed to request test list: %s", err)
|
||||||
|
} else {
|
||||||
|
errorf("Failed to request test list: Not status code 200")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
defer resp.Body.Close()
|
defer resp.Body.Close()
|
||||||
json.NewDecoder(resp.Body).Decode(&testSuites)
|
json.NewDecoder(resp.Body).Decode(&testSuites)
|
||||||
|
|||||||
Reference in New Issue
Block a user