|
|
|
|
@ -190,8 +190,7 @@ func TestGetContainerLogs_MultipleContainers(t *testing.T) {
|
|
|
|
|
rt := &ReleaseTesting{Namespace: "default"}
|
|
|
|
|
|
|
|
|
|
var buf bytes.Buffer
|
|
|
|
|
err := rt.getContainerLogs(&buf, client, "test-pod")
|
|
|
|
|
require.NoError(t, err)
|
|
|
|
|
require.NoError(t, rt.getContainerLogs(&buf, client, "test-pod"))
|
|
|
|
|
output := buf.String()
|
|
|
|
|
assert.Contains(t, output, "POD LOGS: test-pod (main)")
|
|
|
|
|
assert.Contains(t, output, "POD LOGS: test-pod (sidecar)")
|
|
|
|
|
@ -217,8 +216,7 @@ func TestGetContainerLogs_WithInitContainers(t *testing.T) {
|
|
|
|
|
rt := &ReleaseTesting{Namespace: "default"}
|
|
|
|
|
|
|
|
|
|
var buf bytes.Buffer
|
|
|
|
|
err := rt.getContainerLogs(&buf, client, "test-pod")
|
|
|
|
|
require.NoError(t, err)
|
|
|
|
|
require.NoError(t, rt.getContainerLogs(&buf, client, "test-pod"))
|
|
|
|
|
output := buf.String()
|
|
|
|
|
// Init containers should appear before regular containers
|
|
|
|
|
assert.Contains(t, output, "POD LOGS: test-pod (init-setup)")
|
|
|
|
|
@ -230,8 +228,7 @@ func TestGetContainerLogs_PodNotFound(t *testing.T) {
|
|
|
|
|
rt := &ReleaseTesting{Namespace: "default"}
|
|
|
|
|
|
|
|
|
|
var buf bytes.Buffer
|
|
|
|
|
err := rt.getContainerLogs(&buf, client, "nonexistent-pod")
|
|
|
|
|
assert.ErrorContains(t, err, "unable to get pod nonexistent-pod")
|
|
|
|
|
assert.ErrorContains(t, rt.getContainerLogs(&buf, client, "nonexistent-pod"), "unable to get pod nonexistent-pod")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func TestGetContainerLogs_OutputHeaderFormat(t *testing.T) {
|
|
|
|
|
@ -252,8 +249,7 @@ func TestGetContainerLogs_OutputHeaderFormat(t *testing.T) {
|
|
|
|
|
rt := &ReleaseTesting{Namespace: "default"}
|
|
|
|
|
|
|
|
|
|
var buf bytes.Buffer
|
|
|
|
|
err := rt.getContainerLogs(&buf, client, "multi-test")
|
|
|
|
|
require.NoError(t, err)
|
|
|
|
|
require.NoError(t, rt.getContainerLogs(&buf, client, "multi-test"))
|
|
|
|
|
output := buf.String()
|
|
|
|
|
assert.Contains(t, output, "POD LOGS: multi-test (container-a)")
|
|
|
|
|
assert.Contains(t, output, "POD LOGS: multi-test (container-b)")
|
|
|
|
|
|