diff options
author | Pavel Zbitskiy <65323360+algorandskiy@users.noreply.github.com> | 2023-12-19 17:06:20 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-19 17:06:20 -0500 |
commit | 64f588912c37f8cad7c755a55007df754349a51b (patch) | |
tree | f5aacc63d2dc1bf5f8c1afbee3d51359be579779 | |
parent | 2b914fc68178a1e1f06bead42cbc88c24630b5ed (diff) |
tests: log all relay logs on e2e failure (#5881)
-rw-r--r-- | netdeploy/network.go | 10 | ||||
-rw-r--r-- | test/framework/fixtures/libgoalFixture.go | 9 |
2 files changed, 18 insertions, 1 deletions
diff --git a/netdeploy/network.go b/netdeploy/network.go index 4e86bd831..e4066e79b 100644 --- a/netdeploy/network.go +++ b/netdeploy/network.go @@ -169,6 +169,16 @@ func (n Network) PrimaryDataDir() string { panic(fmt.Errorf("neither relay directories nor node directories are defined for the network")) } +// RelayDataDirs returns an array of relay data directories (not the nodes) +func (n Network) RelayDataDirs() []string { + var directories []string + for _, dir := range n.cfg.RelayDirs { + directories = append(directories, n.getNodeFullPath(dir)) + } + sort.Strings(directories) + return directories +} + // NodeDataDirs returns an array of node data directories (not the relays) func (n Network) NodeDataDirs() []string { var directories []string diff --git a/test/framework/fixtures/libgoalFixture.go b/test/framework/fixtures/libgoalFixture.go index 3b54f9f7a..58ca1662b 100644 --- a/test/framework/fixtures/libgoalFixture.go +++ b/test/framework/fixtures/libgoalFixture.go @@ -317,7 +317,9 @@ func (f *LibGoalFixture) ShutdownImpl(preserveData bool) { f.NC.StopKMD() if preserveData { f.network.Stop(f.binDir) - f.dumpLogs(filepath.Join(f.PrimaryDataDir(), "node.log")) + for _, relayDir := range f.RelayDataDirs() { + f.dumpLogs(filepath.Join(relayDir, "node.log")) + } for _, nodeDir := range f.NodeDataDirs() { f.dumpLogs(filepath.Join(nodeDir, "node.log")) } @@ -365,6 +367,11 @@ func (f *LibGoalFixture) PrimaryDataDir() string { return f.network.PrimaryDataDir() } +// RelayDataDirs returns the relays data directories for the network (including the primary relay) +func (f *LibGoalFixture) RelayDataDirs() []string { + return f.network.RelayDataDirs() +} + // NodeDataDirs returns the (non-Primary) data directories for the network func (f *LibGoalFixture) NodeDataDirs() []string { return f.network.NodeDataDirs() |