fix: keep maintenance results concise and catalog readable

This commit is contained in:
阿白叔 committed 2026-11-04 17:26:35 +08:00
1 parent 223655fe00
commit 2587d33c5a
5 files changed
+45 -18

No files matched your search

+6 -2
View File
@@ -75,8 +75,12 @@ def test_maintenance_summary_exposes_first_failure_reason(qtbot, tmp_path):
window._global_icdb_run = True
detail = 'MAINTENANCE_TARGET_UNCONFIRMED: PCB 引用与当前工程不一致'
window._batch_done(([VerifyResult('BLOCKED', stderr=detail, safe_to_continue=False)], tmp_path/'batch.log'))
assert detail in window.summary.text()
assert detail in window.status_label.text()
assert detail in window.summary.detailedText()
assert detail in window.output.toPlainText()
assert detail not in window.summary.text()
assert str(tmp_path) not in window.summary.text()
assert detail not in window.status_label.text()
assert '失败/受阻 1' in window.summary.text()
def test_safe_maintenance_reloads_authoritative_catalog_after_worker_finishes(qtbot, tmp_path, monkeypatch):
+10
View File
@@ -31,3 +31,13 @@ def test_long_status_does_not_expand_the_window(qtbot, tmp_path):
qtbot.wait(20)
assert window.height() <= 650
assert window.status_label.height() <= window.status_label.fontMetrics().lineSpacing() * 3 + 4
def test_failure_detail_keeps_catalog_name_readable(qtbot, tmp_path, monkeypatch):
from test_ui_filters import load_window
window = load_window(qtbot, tmp_path, monkeypatch)
window.resize(1000, 650); window.show()
window.cbb_table.item(0, 3).setText('BackAnnotate: ' + 'long exception ' * 100)
qtbot.wait(20)
assert window.cbb_table.columnWidth(0) >= 200
assert window.cbb_table.horizontalHeader().length() <= window.cbb_table.viewport().width()
+3 -3
View File
@@ -98,7 +98,7 @@ def test_global_icdb_progress_and_repair_summary(qtbot, tmp_path, monkeypatch):
assert window.icdb_progress.value() == 1
assert window.icdb_progress.maximum() == 1
assert '恢复备份待复核 1' in window.status_label.text()
assert window.summary.windowTitle() == '非 READY ICDB 检查与修复结果'
assert window.summary.windowTitle() == 'ICDB 维护结果'
reports = list((tmp_path/'reports').glob('icdb-*.json'))
assert len(reports) == 1
@@ -359,5 +359,5 @@ def test_batch_summary_exposes_failures_only_report(qtbot, tmp_path):
qtbot.addWidget(window)
report=tmp_path/'reports/batch-20260929-test.log'
window._batch_done(([VerifyResult('FAIL',stderr='Mentor error')],report))
assert '仅失败日志' in window.summary.text()
assert str(report.with_name('failures-20260929-test.log')) in window.summary.text()
assert '仅失败日志' in window.summary.detailedText()
assert str(report.with_name('failures-20260929-test.log')) in window.summary.detailedText()