mirror of https://github.com/statping/statping
test wait time increased
parent
d29d134372
commit
fc5b33736a
|
@ -74,7 +74,7 @@ func TestExportCommand(t *testing.T) {
|
||||||
func TestUpdateCommand(t *testing.T) {
|
func TestUpdateCommand(t *testing.T) {
|
||||||
cmd := helperCommand(nil, "version")
|
cmd := helperCommand(nil, "version")
|
||||||
var got = make(chan string)
|
var got = make(chan string)
|
||||||
commandAndSleep(cmd, time.Duration(10*time.Second), got)
|
commandAndSleep(cmd, time.Duration(15*time.Second), got)
|
||||||
gg, _ := <-got
|
gg, _ := <-got
|
||||||
t.Log(gg)
|
t.Log(gg)
|
||||||
assert.Contains(t, gg, "Statup")
|
assert.Contains(t, gg, "Statup")
|
||||||
|
@ -92,7 +92,7 @@ func TestAssetsCommand(t *testing.T) {
|
||||||
func TestRunCommand(t *testing.T) {
|
func TestRunCommand(t *testing.T) {
|
||||||
cmd := helperCommand(nil, "run")
|
cmd := helperCommand(nil, "run")
|
||||||
var got = make(chan string)
|
var got = make(chan string)
|
||||||
commandAndSleep(cmd, time.Duration(5*time.Second), got)
|
commandAndSleep(cmd, time.Duration(15*time.Second), got)
|
||||||
gg, _ := <-got
|
gg, _ := <-got
|
||||||
t.Log(gg)
|
t.Log(gg)
|
||||||
assert.Contains(t, gg, "Running 1 time and saving to database...")
|
assert.Contains(t, gg, "Running 1 time and saving to database...")
|
||||||
|
|
|
@ -68,7 +68,6 @@ func sendErrorJson(err error, w http.ResponseWriter, r *http.Request) {
|
||||||
Status: "error",
|
Status: "error",
|
||||||
Error: err.Error(),
|
Error: err.Error(),
|
||||||
}
|
}
|
||||||
r.Body.Close()
|
|
||||||
w.Header().Set("Content-Type", "application/json")
|
w.Header().Set("Content-Type", "application/json")
|
||||||
json.NewEncoder(w).Encode(output)
|
json.NewEncoder(w).Encode(output)
|
||||||
}
|
}
|
||||||
|
@ -118,7 +117,6 @@ func sendJsonAction(obj interface{}, method string, w http.ResponseWriter, r *ht
|
||||||
Output: obj,
|
Output: obj,
|
||||||
}
|
}
|
||||||
|
|
||||||
r.Body.Close()
|
|
||||||
w.Header().Set("Content-Type", "application/json")
|
w.Header().Set("Content-Type", "application/json")
|
||||||
json.NewEncoder(w).Encode(output)
|
json.NewEncoder(w).Encode(output)
|
||||||
}
|
}
|
||||||
|
|
|
@ -460,7 +460,7 @@ func TestSaveSassHandler(t *testing.T) {
|
||||||
|
|
||||||
func TestReorderServiceHandler(t *testing.T) {
|
func TestReorderServiceHandler(t *testing.T) {
|
||||||
data := `[{id: 1, order: 3},{id: 2, order: 2},{id: 3, order: 1}]"`
|
data := `[{id: 1, order: 3},{id: 2, order: 2},{id: 3, order: 1}]"`
|
||||||
req, err := http.NewRequest("POST", "/services/reorder", strings.NewReader(data))
|
req, err := http.NewRequest("POST", "/api/services/reorder", strings.NewReader(data))
|
||||||
req.Header.Set("Content-Type", "application/json")
|
req.Header.Set("Content-Type", "application/json")
|
||||||
assert.Nil(t, err)
|
assert.Nil(t, err)
|
||||||
rr := httptest.NewRecorder()
|
rr := httptest.NewRecorder()
|
||||||
|
|
Loading…
Reference in New Issue