Merged in bugfix/tests (pull request #107)
Fix Fullsuite * save * foundthefix.. * codeandrequire
This commit is contained in:
@@ -47,6 +47,7 @@ func createContainer(t testing.TB, ctx context.Context, cfg *containerConfig) (t
|
||||
"AWS_ENDPOINT_URL_SQS": cfg.Cfg.GetAWSEndpoint(),
|
||||
"AWS_ENDPOINT_URL_S3": cfg.Cfg.GetAWSEndpoint(),
|
||||
"AWS_S3_USE_PATH_STYLE": strconv.FormatBool(true),
|
||||
"LOG_LEVEL": "DEBUG",
|
||||
}
|
||||
if cfg.Env != nil {
|
||||
for k, v := range cfg.Env {
|
||||
@@ -79,14 +80,7 @@ func createContainer(t testing.TB, ctx context.Context, cfg *containerConfig) (t
|
||||
Started: true,
|
||||
})
|
||||
if err != nil {
|
||||
logs, _ := container.Logs(ctx)
|
||||
defer logs.Close()
|
||||
|
||||
scanner := bufio.NewScanner(logs)
|
||||
for scanner.Scan() {
|
||||
line := scanner.Text()
|
||||
slog.Error(line)
|
||||
}
|
||||
PrintContainerLogs(t, ctx, container)
|
||||
|
||||
require.NoError(t, err)
|
||||
}
|
||||
@@ -98,3 +92,18 @@ func createContainer(t testing.TB, ctx context.Context, cfg *containerConfig) (t
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func PrintContainerLogs(t testing.TB, ctx context.Context, container testcontainers.Container) {
|
||||
logs, err := container.Logs(ctx)
|
||||
defer func() {
|
||||
err := logs.Close()
|
||||
require.NoError(t, err)
|
||||
}()
|
||||
require.NoError(t, err)
|
||||
|
||||
scanner := bufio.NewScanner(logs)
|
||||
for scanner.Scan() {
|
||||
line := scanner.Text()
|
||||
slog.Error(line)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user