mirror of
https://github.com/krkn-chaos/krkn.git
synced 2026-08-25 09:27:36 +00:00
fix: improve logging clarity , reduce noise, fix log levels, and reword misleading messages (#1562)
* fix: improve logging clarity — reduce noise, fix log levels, and reword misleading messages - Move per-directory rollback WARNING to DEBUG; add single INFO summary - Change "No rollback context directories found" from WARNING to DEBUG - Change "Skip cleanup/execution" from WARNING to DEBUG - Fix misleading Cerberus "still failing" message: early-return when disabled, use correct log levels, remove inaccurate wording - Change "No error logs collected" from INFO to DEBUG - Reword "Detected distribution" to "Detected cluster platform" - Reword OCP metadata collection log for clarity Closes #1559 Signed-off-by: ddjain <darjain@redhat.com> Co-authored-by: Cursor <cursoragent@cursor.com> Signed-off-by: ddjain <darjain@redhat.com> Co-authored-by: Cursor <cursoragent@cursor.com> * fix: address review comments — fix tests, reword log messages - Add cerberus_enabled = True to 4 publish_kraken_status tests broken by early-return guard - Add new test for cerberus_disabled early-return path - Reword rollback skip summary to neutral wording - Remove capitalize() from platform detection log Signed-off-by: ddjain <darjain@redhat.com> Co-authored-by: Cursor <cursoragent@cursor.com> --------- Signed-off-by: ddjain <darjain@redhat.com> Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -160,9 +160,19 @@ class TestCerberusSetup(unittest.TestCase):
|
||||
|
||||
self.assertEqual(cm.exception.code, 1)
|
||||
|
||||
@patch('krkn.cerberus.setup.get_status')
|
||||
def test_publish_kraken_status_cerberus_disabled_skips(self, mock_get_status):
|
||||
"""Test publish_kraken_status returns immediately when cerberus is disabled"""
|
||||
cerberus_setup.cerberus_enabled = False
|
||||
|
||||
cerberus_setup.publish_kraken_status(0, 100)
|
||||
|
||||
mock_get_status.assert_not_called()
|
||||
|
||||
@patch('krkn.cerberus.setup.get_status')
|
||||
def test_publish_kraken_status_healthy_exit_on_failure_false(self, mock_get_status):
|
||||
"""Test publish_kraken_status when cluster is healthy and exit_on_failure is False"""
|
||||
cerberus_setup.cerberus_enabled = True
|
||||
cerberus_setup.exit_on_failure = False
|
||||
mock_get_status.return_value = True
|
||||
|
||||
@@ -173,6 +183,7 @@ class TestCerberusSetup(unittest.TestCase):
|
||||
@patch('krkn.cerberus.setup.get_status')
|
||||
def test_publish_kraken_status_healthy_exit_on_failure_true(self, mock_get_status):
|
||||
"""Test publish_kraken_status when cluster is healthy and exit_on_failure is True"""
|
||||
cerberus_setup.cerberus_enabled = True
|
||||
cerberus_setup.exit_on_failure = True
|
||||
mock_get_status.return_value = True
|
||||
|
||||
@@ -185,6 +196,7 @@ class TestCerberusSetup(unittest.TestCase):
|
||||
@patch('krkn.cerberus.setup.get_status')
|
||||
def test_publish_kraken_status_unhealthy_exit_on_failure_false(self, mock_get_status):
|
||||
"""Test publish_kraken_status when cluster is unhealthy and exit_on_failure is False"""
|
||||
cerberus_setup.cerberus_enabled = True
|
||||
cerberus_setup.exit_on_failure = False
|
||||
mock_get_status.return_value = False
|
||||
|
||||
@@ -195,6 +207,7 @@ class TestCerberusSetup(unittest.TestCase):
|
||||
@patch('krkn.cerberus.setup.get_status')
|
||||
def test_publish_kraken_status_unhealthy_exit_on_failure_true(self, mock_get_status):
|
||||
"""Test publish_kraken_status when cluster is unhealthy and exit_on_failure is True"""
|
||||
cerberus_setup.cerberus_enabled = True
|
||||
cerberus_setup.exit_on_failure = True
|
||||
mock_get_status.return_value = False
|
||||
|
||||
|
||||
Reference in New Issue
Block a user