File size: 1,419 Bytes
737d608
 
 
 
 
 
 
 
 
 
 
 
6c2d9a7
737d608
 
6c2d9a7
 
 
 
 
737d608
 
 
 
 
 
6c2d9a7
 
 
 
 
737d608
 
 
da65740
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
from pathlib import Path


def test_worker_streams_pi_output_while_running():
    worker = Path("src/worker_payload.py").read_text(encoding="utf-8")
    assert "def run_cmd_streaming" in worker
    assert '"logs" / "pi_live_output.txt"' in worker
    assert "Pi is still working" in worker
    assert "sync_pi_traces(run_dir" in worker
    assert "run_cmd_streaming(" in worker


def test_progress_endpoint_no_longer_exposes_pi_stdout_payload():
    bucket = Path("src/bucket.py").read_text(encoding="utf-8")
    app = Path("app.py").read_text(encoding="utf-8")
    assert '"pi_live_log": _safe_read_text' not in bucket
    assert '"pi_output_log": _safe_read_text' not in bucket
    assert "include_heavy: bool = True" in bucket
    assert "include_job_logs: bool = False" in app
    assert '"pi_live_log"' not in app


def test_ui_has_pi_live_trace_panel_and_renderer():
    html = Path("web/index.html").read_text(encoding="utf-8")
    js = Path("web/static/progress.js").read_text(encoding="utf-8")
    css = Path("web/static/app.css").read_text(encoding="utf-8")
    assert 'id="piTracePanel"' not in html
    assert "Pi process stdout" not in html
    assert "function renderPiLiveTrace" not in js
    assert "p.pi_live_log" not in js
    assert ".pi-trace-output" not in css


def test_app_version_v57():
    assert '"version": "v70-progress-resume-events-latency"' in Path("app.py").read_text(encoding="utf-8")