Skip to content

Commit

Permalink
Adds container logs command for scheduler fail
Browse files Browse the repository at this point in the history
Signed-off-by: joshvanl <me@joshvanl.dev>
  • Loading branch information
JoshVanL committed Aug 16, 2024
1 parent 4014bb3 commit e601f43
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/e2e/standalone/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,18 @@ package standalone_test

import (
"bufio"
"context"
"fmt"
"io"
"os"
"os/exec"
"path/filepath"
"runtime"
"strings"
"testing"

"github.com/docker/docker/api/types"
dockerClient "github.com/docker/docker/client"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

Expand Down Expand Up @@ -137,6 +142,15 @@ func ensureDaprInstallation(t *testing.T) {
"--dashboard-version", daprDashboardVersion,
}
output, err := cmdInit(args...)
if err != nil {
cli, err := dockerClient.NewClientWithOpts(dockerClient.FromEnv)
require.NoError(t, err)
reader, err := cli.ContainerLogs(context.Background(), "dapr_scheduler", types.ContainerLogsOptions{ShowStdout: true, ShowStderr: true})
require.NoError(t, err)
b, err := io.ReadAll(reader)
require.NoError(t, err)
fmt.Printf(">>%s\n", b)
}
require.NoError(t, err, "failed to install dapr:%v", output)
} else if err != nil {
// Some other error occurred.
Expand Down

0 comments on commit e601f43

Please sign in to comment.