@@ -1301,70 +1301,6 @@ def test_update_reconcile_completion_status(
13011301 check_status (dm , cr , ready_reason , updating_reason , completion_state )
13021302
13031303
1304- @pytest .mark .parametrize (
1305- ["log_level" , "should_include_graph" ],
1306- [
1307- ["debug4" , True ],
1308- ["debug3" , False ],
1309- ["debug2" , False ],
1310- ["debug" , False ],
1311- ["info" , False ],
1312- ],
1313- )
1314- def test_update_reconcile_completion_status_dependency_graph_by_log_level (
1315- log_level , should_include_graph
1316- ):
1317- """Test that dependency_graph is only included in status when log level is debug4"""
1318- # Local
1319- from oper8 .dag import Graph
1320-
1321- # Setup CR with log level annotation
1322- cr = setup_cr ()
1323- cr ["metadata" ]["annotations" ] = {
1324- constants .LOG_DEFAULT_LEVEL_NAME : log_level ,
1325- }
1326-
1327- # Create a graph with nodes
1328- graph = Graph ()
1329- node_a = Node ("A" )
1330- node_b = Node ("B" )
1331- graph .add_node (node_a )
1332- graph .add_node (node_b )
1333- graph .add_node_dependency (node_a , node_b )
1334-
1335- completion_state = CompletionState (verified_nodes = [node_a , node_b ])
1336-
1337- dm = MockDeployManager (resources = [cr ])
1338- rm = ReconcileManager (deploy_manager = dm )
1339- session = setup_session (full_cr = cr , deploy_manager = dm )
1340- # Access the private __graph attribute
1341- session ._Session__graph = graph
1342-
1343- # Configure logging with the specified level
1344- alog .configure (default_level = log_level )
1345-
1346- rm ._update_reconcile_completion_status (session , completion_state )
1347-
1348- # Check the status
1349- obj = dm .get_obj (
1350- kind = cr .kind ,
1351- name = cr .metadata .name ,
1352- namespace = cr .metadata .namespace ,
1353- api_version = cr .apiVersion ,
1354- )
1355- assert obj is not None
1356- assert obj .get ("status" )
1357-
1358- component_status = obj ["status" ].get (status .COMPONENT_STATUS )
1359- assert component_status is not None
1360-
1361- if should_include_graph :
1362- assert status .COMPONENT_STATUS_DEPENDENCY_GRAPH in component_status
1363- assert component_status [status .COMPONENT_STATUS_DEPENDENCY_GRAPH ] == str (graph )
1364- else :
1365- assert status .COMPONENT_STATUS_DEPENDENCY_GRAPH not in component_status
1366-
1367-
13681304###############
13691305## _update_error_status ##
13701306###############
0 commit comments