From 387ae231ee376cfb9a2c65e38bc149e196f31a72 Mon Sep 17 00:00:00 2001 From: Bartek Tofel Date: Wed, 11 Dec 2024 16:15:57 +0100 Subject: [PATCH] dump logs only on test failure or test_log_collect=true --- integration-tests/ccip-tests/testsetups/ccip.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/integration-tests/ccip-tests/testsetups/ccip.go b/integration-tests/ccip-tests/testsetups/ccip.go index 5b87ed03b2..74fdd3c35b 100644 --- a/integration-tests/ccip-tests/testsetups/ccip.go +++ b/integration-tests/ccip-tests/testsetups/ccip.go @@ -1387,7 +1387,9 @@ func (o *CCIPTestSetUpOutputs) CreateEnvironment( t.Cleanup(func() { if configureCLNode { if ccipEnv.LocalCluster != nil { - flushClLogs(*lggr, ccipEnv.LocalCluster) + if t.Failed() || (ccipEnv.LocalCluster.TestConfig.GetLoggingConfig() != nil && ccipEnv.LocalCluster.TestConfig.GetLoggingConfig().TestLogCollect != nil && *ccipEnv.LocalCluster.TestConfig.GetLoggingConfig().TestLogCollect) { + flushClLogs(*lggr, ccipEnv.LocalCluster) + } err := ccipEnv.LocalCluster.Terminate() require.NoError(t, err, "Local cluster termination shouldn't fail")