Merged in bugfix/tests (pull request #107)

Fix Fullsuite

* save

* foundthefix..

* codeandrequire
This commit is contained in:
Michael McGuinness
2025-03-19 11:54:14 +00:00
parent 3dd0c718cd
commit 1587da9d11
101 changed files with 977 additions and 910 deletions
+17 -8
View File
@@ -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)
}
}