mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Merge pull request #20660 from thockin/e2e-also-log-fails
Logf() failures for nicer logs
This commit is contained in:
commit
62e0eed21c
@ -252,16 +252,24 @@ func nowStamp() string {
|
|||||||
return time.Now().Format(time.StampMilli)
|
return time.Now().Format(time.StampMilli)
|
||||||
}
|
}
|
||||||
|
|
||||||
func Logf(format string, a ...interface{}) {
|
func logf(level string, format string, args ...interface{}) {
|
||||||
fmt.Fprintf(GinkgoWriter, nowStamp()+": INFO: "+format+"\n", a...)
|
fmt.Fprintf(GinkgoWriter, nowStamp()+": "+level+": "+format+"\n", args...)
|
||||||
}
|
}
|
||||||
|
|
||||||
func Failf(format string, a ...interface{}) {
|
func Logf(format string, args ...interface{}) {
|
||||||
Fail(nowStamp()+": "+fmt.Sprintf(format, a...), 1)
|
logf("INFO", format, args...)
|
||||||
|
}
|
||||||
|
|
||||||
|
func Failf(format string, args ...interface{}) {
|
||||||
|
msg := fmt.Sprintf(format, args...)
|
||||||
|
logf("FAIL", msg)
|
||||||
|
Fail(nowStamp()+": "+msg, 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
func Skipf(format string, args ...interface{}) {
|
func Skipf(format string, args ...interface{}) {
|
||||||
Skip(nowStamp() + ": " + fmt.Sprintf(format, args...))
|
msg := fmt.Sprintf(format, args...)
|
||||||
|
logf("SKIP", msg)
|
||||||
|
Skip(nowStamp() + ": " + msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
func SkipUnlessNodeCountIsAtLeast(minNodeCount int) {
|
func SkipUnlessNodeCountIsAtLeast(minNodeCount int) {
|
||||||
|
Loading…
Reference in New Issue
Block a user