Skip to content

Commit

Permalink
dump logs only on test failure or test_log_collect=true
Browse files Browse the repository at this point in the history
  • Loading branch information
Tofel committed Dec 11, 2024
1 parent effcb0b commit 387ae23
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion integration-tests/ccip-tests/testsetups/ccip.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 387ae23

Please sign in to comment.