From 2a9522a432563e8fb2c6adecaae4f1bf8c6223b2 Mon Sep 17 00:00:00 2001 From: Juan Manuel Perez Date: Thu, 3 Oct 2024 12:27:32 +0200 Subject: [PATCH] debug --- tests/mssql_test.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tests/mssql_test.go b/tests/mssql_test.go index 0b997f1..8621f8a 100644 --- a/tests/mssql_test.go +++ b/tests/mssql_test.go @@ -3,9 +3,11 @@ package tests import ( + "bytes" "flag" "fmt" "os" + "os/exec" "testing" "time" @@ -54,6 +56,27 @@ func waitForMSSQLIsUpAndRunning(maxTries int) bool { }) if err != nil { log.Warn(err.Error()) + + mssql_command := []string{"docker", "compose", "logs", "mssql"} + mssql_cmd := exec.Command(mssql_command[0], mssql_command[1:]...) + var mssql_out bytes.Buffer + mssql_cmd.Stdout = &mssql_out + mssql_cmd.Stderr = &mssql_out + + nri_mssql_command := []string{"docker", "compose", "logs", "nri_mssql"} + nri_mssql_cmd := exec.Command(nri_mssql_command[0], nri_mssql_command[1:]...) + var nri_mssql_out bytes.Buffer + nri_mssql_cmd.Stdout = &nri_mssql_out + nri_mssql_cmd.Stderr = &nri_mssql_out + + log.Info("mssql container logs") + _ = mssql_cmd.Run() + log.Info(mssql_out.String()) + + log.Info("nri_mssql container logs") + _ = nri_mssql_cmd.Run() + log.Info(nri_mssql_out.String()) + continue } if conn != nil { @@ -62,6 +85,7 @@ func waitForMSSQLIsUpAndRunning(maxTries int) bool { return true } } + return false }