From 5c4c87e57b4bd4aff0a7b82973fc445ba77dd892 Mon Sep 17 00:00:00 2001 From: Alfonso Acosta Date: Thu, 13 Jun 2024 21:46:47 +0200 Subject: [PATCH] Debug RPC container --- cmd/soroban-rpc/internal/test/integration.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cmd/soroban-rpc/internal/test/integration.go b/cmd/soroban-rpc/internal/test/integration.go index 13779378..9594d560 100644 --- a/cmd/soroban-rpc/internal/test/integration.go +++ b/cmd/soroban-rpc/internal/test/integration.go @@ -334,8 +334,12 @@ func (i *Test) runComposeCommand(args ...string) { i.t.Log("Running", cmd.Env, cmd.Args) out, innerErr := cmd.Output() - if exitErr, ok := innerErr.(*exec.ExitError); ok { + exitErr, ok := innerErr.(*exec.ExitError) + // TODO: make this cleaner + if ok || args[0] == "logs" { fmt.Printf("stdout:\n%s\n", string(out)) + } + if ok { fmt.Printf("stderr:\n%s\n", string(exitErr.Stderr)) } @@ -456,6 +460,7 @@ func (i *Test) StopRPC() { i.daemon = nil } if i.rpcContainerVersion != "" { + i.runComposeCommand("logs", "rpc") i.runComposeCommand("down", "rpc", "-v") } }