Update log message
This commit is contained in:
Родитель
0d21157c91
Коммит
7b6158603e
|
@ -155,3 +155,7 @@ func (c *Config) buildTargetMap() {
|
|||
c.targetMap[section] = true
|
||||
}
|
||||
}
|
||||
|
||||
func (c *Config) IsBrowserMode() bool {
|
||||
return c.Exec == ""
|
||||
}
|
||||
|
|
|
@ -76,7 +76,7 @@ func RunClientSpec(c *config.Config) error {
|
|||
return err
|
||||
}
|
||||
|
||||
if c.Exec != "" {
|
||||
if !c.IsBrowserMode() {
|
||||
start := time.Now()
|
||||
s.Test(c)
|
||||
end := time.Now()
|
||||
|
@ -90,7 +90,6 @@ func RunClientSpec(c *config.Config) error {
|
|||
log.SetIndentLevel(0)
|
||||
log.Println(fmt.Sprintf("Finished in %.4f seconds", d.Seconds()))
|
||||
reporter.PrintSummaryForClient(s)
|
||||
|
||||
} else {
|
||||
// Block running
|
||||
log.Println("--exec is not defined, enable BROWSER mode")
|
||||
|
|
|
@ -81,6 +81,11 @@ func (server *Server) Close() {
|
|||
}
|
||||
|
||||
func (server *Server) handleConn(conn *Conn, tc *ClientTestCase) {
|
||||
if server.config.IsBrowserMode() {
|
||||
// Only log here when browser mode
|
||||
log.Println(groupNames(tc.Parent))
|
||||
}
|
||||
|
||||
start := time.Now()
|
||||
|
||||
err := conn.Handshake()
|
||||
|
@ -100,10 +105,12 @@ func (server *Server) handleConn(conn *Conn, tc *ClientTestCase) {
|
|||
// Ensure that connection had been closed
|
||||
go closeConn(conn, request.StreamID)
|
||||
|
||||
log.ResetLine()
|
||||
|
||||
tr := NewClientTestResult(tc, err, end.Sub(start))
|
||||
tr.Print()
|
||||
|
||||
if server.config.IsBrowserMode() {
|
||||
// Only log here when browser mode
|
||||
tr.Print()
|
||||
}
|
||||
|
||||
if tc.Result != nil {
|
||||
tc.Parent.IncRecursive(tc.Result.Failed, tc.Result.Skipped, -1)
|
||||
|
@ -113,6 +120,14 @@ func (server *Server) handleConn(conn *Conn, tc *ClientTestCase) {
|
|||
tc.Parent.IncRecursive(tc.Result.Failed, tc.Result.Skipped, 1)
|
||||
}
|
||||
|
||||
func groupNames(tg *ClientTestGroup) string {
|
||||
if tg.IsRoot() {
|
||||
return tg.Title()
|
||||
}
|
||||
parentGroupNames := groupNames(tg.Parent)
|
||||
return fmt.Sprintf("%s -> %s", parentGroupNames, tg.Title())
|
||||
}
|
||||
|
||||
func closeConn(conn *Conn, lastStreamID uint32) {
|
||||
if !conn.Closed {
|
||||
conn.WriteGoAway(lastStreamID, http2.ErrCodeNo, make([]byte, 0))
|
||||
|
|
|
@ -162,6 +162,10 @@ func (tc *ClientTestCase) Test(c *config.Config) error {
|
|||
select {
|
||||
case <-done:
|
||||
// command failed with non-zero exit code is accept
|
||||
if tc.Result != nil {
|
||||
log.ResetLine()
|
||||
tc.Result.Print()
|
||||
}
|
||||
return nil
|
||||
case <-time.After(time.Duration(3) * time.Second):
|
||||
return ErrTimeout
|
||||
|
|
Загрузка…
Ссылка в новой задаче