Serial monitor redesign: Test box button, InfluxDB row in the checklist
- Test box: restart + start-up capture + online InfluxDB check (data newer than the restart), with a status strip; checklist and findings are the main view, live log / guided troubleshooting / box details are tabs, rarely used actions in a More menu - light palette on all systems (macOS dark mode made the colours unreadable) - new rule influx.invalid_value: -inf from a silent microphone makes InfluxDB reject every upload (HTTP 400); guide end names it - exclusive serial port on macOS/Linux: two tool windows no longer split the log between them - InfluxDB check: `since` filter, neutral wording when nothing new arrives Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
66cb804102
commit
bb933ff748
13 files changed
+422
-83
No files matched your search
@@ -19,3 +19,34 @@ def test_main_window_builds_with_all_tabs():
|
||||
assert "InfluxDB access..." in settings
|
||||
w.serial_tab.shutdown()
|
||||
app.processEvents()
|
||||
|
||||
|
||||
def test_serial_tab_checklist_and_test_strip():
|
||||
from PySide6.QtWidgets import QApplication
|
||||
|
||||
from kota_tech.core.logline import parse_line
|
||||
from kota_tech.service import influx
|
||||
from kota_tech.ui.main_window import INFLUX_ROW, MainWindow
|
||||
app = QApplication.instance() or QApplication([])
|
||||
w = MainWindow()
|
||||
st = w.serial_tab
|
||||
assert st.test_btn.text().endswith("Test box")
|
||||
assert [st.side_tabs.tabText(i) for i in range(st.side_tabs.count())] == \
|
||||
["Live log", "Guided troubleshooting", "Box details"]
|
||||
st.influx_config = lambda: None # no token (never touch real settings)
|
||||
rows = st._cloud_rows()
|
||||
assert rows[0][0] == "off" and "not set up" in rows[0][1]
|
||||
st.influx_config = lambda: influx.InfluxConfig("t") # pretend access is set up
|
||||
assert st._cloud_rows()[0] == ("pending", f"{INFLUX_ROW} - press Test box")
|
||||
st._on_influx(influx.InfluxCheck(influx.SENSORS_MISSING, "Status arrives, sensor data does not",
|
||||
details=["SEN66 (air quality): no data"]))
|
||||
rows = st._cloud_rows()
|
||||
assert rows[0][0] == "bad" and rows[1][0] == "note"
|
||||
st._engine.feed(parse_line("ESP-ROM:esp32s3-20210327"))
|
||||
st._diag_dirty = True
|
||||
st._refresh_diag()
|
||||
texts = [st.diag.milestones.item(i).text() for i in range(st.diag.milestones.count())]
|
||||
assert any(INFLUX_ROW in t for t in texts)
|
||||
assert "Test box" in st.test_status.text()
|
||||
st.shutdown()
|
||||
app.processEvents()
|
||||
Reference in new issue
Block a user