@@ -24,7 +24,7 @@ def test_no_problematic_shards(self):
24
24
with patch ("cratedb_toolkit.admin.xmover.util.database.CrateDBClient" , return_value = self .mock_client ):
25
25
result = self .runner .invoke (cli , ["problematic-translogs" , "--size-mb" , "300" ])
26
26
27
- assert result .exit_code == 0
27
+ assert result .exit_code == 0 , result . output
28
28
assert "No replica shards found" in result .output
29
29
assert "300MB" in result .output
30
30
@@ -40,7 +40,7 @@ def test_non_partitioned_table_command_generation(self):
40
40
with patch ("cratedb_toolkit.admin.xmover.util.database.CrateDBClient" , return_value = self .mock_client ):
41
41
result = self .runner .invoke (cli , ["problematic-translogs" , "--size-mb" , "300" ])
42
42
43
- assert result .exit_code == 0
43
+ assert result .exit_code == 0 , result . output
44
44
assert "Found 2 shards with problematic translogs" in result .output
45
45
# Check that the query results table is shown
46
46
assert "Problematic Replica Shards" in result .output
@@ -65,7 +65,7 @@ def test_partitioned_table_command_generation(self):
65
65
with patch ("cratedb_toolkit.admin.xmover.util.database.CrateDBClient" , return_value = self .mock_client ):
66
66
result = self .runner .invoke (cli , ["problematic-translogs" , "--size-mb" , "400" ])
67
67
68
- assert result .exit_code == 0
68
+ assert result .exit_code == 0 , result . output
69
69
assert "Found 1 shards with problematic translogs" in result .output
70
70
# Check that the query results table is shown
71
71
assert "Problematic Replica Shards" in result .output
@@ -89,7 +89,7 @@ def test_mixed_partitioned_non_partitioned(self):
89
89
with patch ("cratedb_toolkit.admin.xmover.util.database.CrateDBClient" , return_value = self .mock_client ):
90
90
result = self .runner .invoke (cli , ["problematic-translogs" , "--size-mb" , "200" ])
91
91
92
- assert result .exit_code == 0
92
+ assert result .exit_code == 0 , result . output
93
93
assert "Found 3 shards with problematic translogs" in result .output
94
94
# Check that the query results table is shown
95
95
assert "Problematic Replica Shards" in result .output
@@ -141,7 +141,7 @@ def test_cancel_flag_user_confirmation_no(self):
141
141
):
142
142
result = self .runner .invoke (cli , ["problematic-translogs" , "--cancel" ])
143
143
144
- assert result .exit_code == 0
144
+ assert result .exit_code == 0 , result . output
145
145
assert "Operation cancelled by user" in result .output
146
146
# Should only be called once for the initial query, not for execution
147
147
assert self .mock_client .execute_query .call_count == 1
@@ -157,7 +157,7 @@ def test_cancel_flag_user_confirmation_yes(self):
157
157
), patch ("time.sleep" ): # Mock sleep to speed up test
158
158
result = self .runner .invoke (cli , ["problematic-translogs" , "--cancel" ])
159
159
160
- assert result .exit_code == 0
160
+ assert result .exit_code == 0 , result . output
161
161
assert "Executing ALTER commands" in result .output
162
162
assert "Command 1 executed successfully" in result .output
163
163
assert "Successful: 1" in result .output
@@ -178,7 +178,7 @@ def test_execution_failure_handling(self):
178
178
), patch ("time.sleep" ):
179
179
result = self .runner .invoke (cli , ["problematic-translogs" , "--cancel" ])
180
180
181
- assert result .exit_code == 0
181
+ assert result .exit_code == 0 , result . output
182
182
assert "Command 1 failed: Shard not found" in result .output
183
183
assert "Failed: 1" in result .output
184
184
assert "Successful: 0" in result .output
@@ -191,7 +191,7 @@ def test_database_error_handling(self):
191
191
with patch ("cratedb_toolkit.admin.xmover.util.database.CrateDBClient" , return_value = self .mock_client ):
192
192
result = self .runner .invoke (cli , ["problematic-translogs" ])
193
193
194
- assert result .exit_code == 0
194
+ assert result .exit_code == 0 , result . output
195
195
assert "Error analyzing problematic translogs" in result .output
196
196
assert "Connection failed" in result .output
197
197
@@ -203,7 +203,7 @@ def test_default_size_mb(self):
203
203
with patch ("cratedb_toolkit.admin.xmover.util.database.CrateDBClient" , return_value = self .mock_client ):
204
204
result = self .runner .invoke (cli , ["problematic-translogs" ])
205
205
206
- assert result .exit_code == 0
206
+ assert result .exit_code == 0 , result . output
207
207
assert "300MB" in result .output
208
208
209
209
# Verify query was called with default value
0 commit comments