mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-20 10:20:51 +00:00
test/integration/logs: replace assert.Contains
For long strings the output of assert.Contains is not very readable.
This commit is contained in:
parent
a862a269b0
commit
10c15d7a67
@ -19,6 +19,7 @@ package benchmark
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
@ -235,7 +236,10 @@ while true; do sleep 1; done
|
||||
|
||||
print(format)
|
||||
klog.Flush()
|
||||
assert.Equal(t, expected, buffer.String())
|
||||
|
||||
if !strings.Contains(buffer.String(), expected) {
|
||||
t.Errorf("Expected log output to contain:\n%s\nActual log output:\n%s\n", expected, buffer.String())
|
||||
}
|
||||
}
|
||||
|
||||
t.Run("printf", func(t *testing.T) {
|
||||
|
Loading…
Reference in New Issue
Block a user