Check log level before dumping resp (#1243)
* Check log level before dumping resp * Sleep longer in func tests Signed-off-by: Shivam Sandbhor <shivam.sandbhor@gmail.com>
This commit is contained in:
parent
5c7c12c62d
commit
76e3612088
|
@ -84,6 +84,7 @@ func (c *ApiClient) Do(ctx context.Context, req *http.Request, v interface{}) (*
|
||||||
return newResponse(resp), err
|
return newResponse(resp), err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if log.GetLevel() >= log.DebugLevel {
|
||||||
for k, v := range resp.Header {
|
for k, v := range resp.Header {
|
||||||
log.Debugf("[headers] %s : %s", k, v)
|
log.Debugf("[headers] %s : %s", k, v)
|
||||||
}
|
}
|
||||||
|
@ -92,6 +93,7 @@ func (c *ApiClient) Do(ctx context.Context, req *http.Request, v interface{}) (*
|
||||||
if err == nil {
|
if err == nil {
|
||||||
log.Debugf("Response: %s", string(dump))
|
log.Debugf("Response: %s", string(dump))
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
response := newResponse(resp)
|
response := newResponse(resp)
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,7 @@ ${CSCLI} version || fail "cannot run cscli version"
|
||||||
|
|
||||||
## alerts
|
## alerts
|
||||||
# alerts list at startup should just return one entry : community pull
|
# alerts list at startup should just return one entry : community pull
|
||||||
sleep 5
|
sleep 40
|
||||||
${CSCLI} alerts list -ojson | ${JQ} '. | length >= 1' || fail "expected at least one entry from cscli alerts list"
|
${CSCLI} alerts list -ojson | ${JQ} '. | length >= 1' || fail "expected at least one entry from cscli alerts list"
|
||||||
## capi
|
## capi
|
||||||
${CSCLI} capi status || fail "capi status should be ok"
|
${CSCLI} capi status || fail "capi status should be ok"
|
||||||
|
|
Loading…
Reference in a new issue