fffiloni commited on
Commit
c125d4e
·
verified ·
1 Parent(s): 1dc5495

Upload 64 files

Browse files
tests/test_custom_ui_shell.py CHANGED
@@ -38,7 +38,6 @@ def test_one_page_workspace_contains_core_sections():
38
  "New Build",
39
  "Active Run",
40
  "Runs Explorer",
41
- "Selected run",
42
  "Space Test",
43
  "Artifacts",
44
  ]:
@@ -57,13 +56,16 @@ def test_one_page_workspace_keeps_required_ids_for_live_bridge():
57
  "activityFeed",
58
  "runFilters",
59
  "runsTable",
60
- "selectedRunId",
 
 
 
61
  "artifactList",
62
  "reportPreview",
63
  "spaceTestPreview",
64
  "metricsList",
65
  "manualActionPanel",
66
- "selectedValidateBtn",
67
  "resumeLatestRun",
68
  ]
69
  for element_id in required_ids:
 
38
  "New Build",
39
  "Active Run",
40
  "Runs Explorer",
 
41
  "Space Test",
42
  "Artifacts",
43
  ]:
 
56
  "activityFeed",
57
  "runFilters",
58
  "runsTable",
59
+ "activeOpenSpace",
60
+ "activeOpenSettings",
61
+ "activePrefillSpaceTest",
62
+ "deleteActiveRun",
63
  "artifactList",
64
  "reportPreview",
65
  "spaceTestPreview",
66
  "metricsList",
67
  "manualActionPanel",
68
+ "deleteValidationRun",
69
  "resumeLatestRun",
70
  ]
71
  for element_id in required_ids:
tests/test_pass47_simple_spec_reset.py CHANGED
@@ -19,7 +19,7 @@ def test_new_build_panel_is_left_column_and_launch_focused():
19
 
20
  def test_runs_explorer_and_selected_run_are_integrated_on_same_page():
21
  html = Path("web/index.html").read_text(encoding="utf-8")
22
- for text in ["Runs Explorer", "Search runs by ID, model, or space", "Selected run", "Prefill Space Test"]:
23
  assert text in html
24
 
25
 
 
19
 
20
  def test_runs_explorer_and_selected_run_are_integrated_on_same_page():
21
  html = Path("web/index.html").read_text(encoding="utf-8")
22
+ for text in ["Runs Explorer", "Search runs by ID, model, or space", "Active Run", "Prefill Space Test"]:
23
  assert text in html
24
 
25
 
tests/test_v101_active_run_traces_dock.py ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from pathlib import Path
2
+
3
+
4
+ def test_active_run_contains_compact_trace_documents_dock():
5
+ html = Path("web/index.html").read_text(encoding="utf-8")
6
+ assert "id=\"runDocumentsDock\"" in html
7
+ assert "Run traces" in html
8
+ assert "RAW, redacted and key docs" in html
9
+
10
+
11
+ def test_trace_document_dock_is_not_a_full_artifact_explorer():
12
+ js = Path("web/static/runs.js").read_text(encoding="utf-8")
13
+ assert "pi_raw_trace" in js
14
+ assert "pi_redacted_trace" in js
15
+ assert "tests/generation_smoke.json" in js
16
+ assert "generated/TECHNICAL_BLOCKERS.json" in js
17
+ assert "deriveRunDocuments" in js
18
+ assert "renderRunDocuments" in js
19
+
20
+
21
+ def test_progress_payload_exposes_run_documents_for_live_dock():
22
+ app_py = Path("app.py").read_text(encoding="utf-8")
23
+ bucket_py = Path("src/bucket.py").read_text(encoding="utf-8")
24
+ assert "run_documents" in app_py
25
+ assert "def _run_document_links" in bucket_py
26
+ assert "traces/raw" in bucket_py
27
+ assert "traces/redacted" in bucket_py
tests/test_v60_cancel_persist_delete_run.py CHANGED
@@ -27,17 +27,19 @@ def test_selected_run_has_delete_button_and_frontend_delete_flow():
27
  html = Path("web/index.html").read_text(encoding="utf-8")
28
  runs = Path("web/static/runs.js").read_text(encoding="utf-8")
29
  api = Path("web/static/api.js").read_text(encoding="utf-8")
30
- assert 'id="deleteSelectedRun"' in html
31
- assert "Delete run from bucket" in html
 
32
  assert "async function deleteSelectedRun" in runs
33
  assert "/api/runs/${encodeURIComponent(runId)}" in runs
34
  assert "async function apiDelete" in api
35
 
36
 
37
- def test_active_run_still_only_has_cancel_button():
38
  html = Path("web/index.html").read_text(encoding="utf-8")
39
  active = html.split('id="activeRunPanel"', 1)[1].split('id="runsExplorerPanel"', 1)[0]
40
- assert 'id="cancelRun"' in active
 
41
  assert 'id="deleteSelectedRun"' not in active
42
  for removed in ['id="openArtifacts"', 'id="openRunState"', 'id="openRunReport"', 'id="openRunLogs"', 'id="openRunTraces"', 'id="openJob"', 'id="openSpace"', 'id="openSettings"']:
43
  assert removed not in active
 
27
  html = Path("web/index.html").read_text(encoding="utf-8")
28
  runs = Path("web/static/runs.js").read_text(encoding="utf-8")
29
  api = Path("web/static/api.js").read_text(encoding="utf-8")
30
+ assert 'id="deleteActiveRun"' in html
31
+ assert 'id="deleteValidationRun"' in html
32
+ assert "Delete run" in html
33
  assert "async function deleteSelectedRun" in runs
34
  assert "/api/runs/${encodeURIComponent(runId)}" in runs
35
  assert "async function apiDelete" in api
36
 
37
 
38
+ def test_active_run_has_central_actions_next_to_cancel_button():
39
  html = Path("web/index.html").read_text(encoding="utf-8")
40
  active = html.split('id="activeRunPanel"', 1)[1].split('id="runsExplorerPanel"', 1)[0]
41
+ for required in ['id="activeOpenSpace"', 'id="activeOpenSettings"', 'id="activeOpenJob"', 'id="activeOpenArtifacts"', 'id="activePrefillSpaceTest"', 'id="deleteActiveRun"', 'id="cancelRun"']:
42
+ assert required in active
43
  assert 'id="deleteSelectedRun"' not in active
44
  for removed in ['id="openArtifacts"', 'id="openRunState"', 'id="openRunReport"', 'id="openRunLogs"', 'id="openRunTraces"', 'id="openJob"', 'id="openSpace"', 'id="openSettings"']:
45
  assert removed not in active
tests/test_v62_progress_perf_clean_delete.py CHANGED
@@ -36,7 +36,7 @@ def test_delete_selected_run_clears_ui_and_refreshes_runs():
36
  assert "await apiDelete" in runs
37
  assert "await loadRuns(true)" in runs
38
  assert "resetRunDetails();" in runs
39
- assert "Delete run from bucket" in runs
40
 
41
 
42
  def test_app_version_v62():
 
36
  assert "await apiDelete" in runs
37
  assert "await loadRuns(true)" in runs
38
  assert "resetRunDetails();" in runs
39
+ assert "Delete run" in Path("web/index.html").read_text(encoding="utf-8")
40
 
41
 
42
  def test_app_version_v62():
tests/test_v64_delete_clean_events_timeline.py CHANGED
@@ -21,7 +21,8 @@ def test_reset_run_details_clears_active_run_panels():
21
  "progressPercent",
22
  "activityFeed",
23
  "artifactList",
24
- "deleteSelectedRun",
 
25
  "renderTimeline(DEFAULT_TIMELINE,'idle')",
26
  ]:
27
  assert token in reset
 
21
  "progressPercent",
22
  "activityFeed",
23
  "artifactList",
24
+ "deleteActiveRun",
25
+ "deleteValidationRun",
26
  "renderTimeline(DEFAULT_TIMELINE,'idle')",
27
  ]:
28
  assert token in reset
tests/test_v72_clear_modes_space_link_gating.py CHANGED
@@ -19,8 +19,8 @@ def test_space_and_settings_links_are_gated_until_space_creation_passed():
19
  assert "setGeneratedSpaceLinksEnabled" in app_js
20
  assert "spaceReady=runPassedSpaceCreation" in app_js
21
  assert "ready=typeof runPassedSpaceCreation" in runs_js
22
- assert "setLink('selectedOpenSpace',ready?summary.target_space_url:'')" in runs_js
23
- assert "setLink('selectedOpenSettings',ready&&summary.target_space_url" in runs_js
24
 
25
 
26
  def test_launch_result_removed_and_selected_links_are_still_gated():
@@ -28,8 +28,8 @@ def test_launch_result_removed_and_selected_links_are_still_gated():
28
  runs_js = Path("web/static/runs.js").read_text(encoding="utf-8")
29
  assert "launchResultPanel" not in html
30
  assert "Launch result" not in html
31
- assert "setLink('selectedOpenSpace',ready?summary.target_space_url:'')" in runs_js
32
- assert "setLink('selectedOpenSettings',ready&&summary.target_space_url" in runs_js
33
 
34
  def test_app_version_v72():
35
  assert '"version": "v94-timeline-keep-current-step-visible"' in Path("app.py").read_text(encoding="utf-8")
 
19
  assert "setGeneratedSpaceLinksEnabled" in app_js
20
  assert "spaceReady=runPassedSpaceCreation" in app_js
21
  assert "ready=typeof runPassedSpaceCreation" in runs_js
22
+ assert "setLink('activeOpenSpace',ready?summary.target_space_url:'')" in runs_js
23
+ assert "setLink('activeOpenSettings',ready&&summary.target_space_url" in runs_js
24
 
25
 
26
  def test_launch_result_removed_and_selected_links_are_still_gated():
 
28
  runs_js = Path("web/static/runs.js").read_text(encoding="utf-8")
29
  assert "launchResultPanel" not in html
30
  assert "Launch result" not in html
31
+ assert "setLink('activeOpenSpace',ready?summary.target_space_url:'')" in runs_js
32
+ assert "setLink('activeOpenSettings',ready&&summary.target_space_url" in runs_js
33
 
34
  def test_app_version_v72():
35
  assert '"version": "v94-timeline-keep-current-step-visible"' in Path("app.py").read_text(encoding="utf-8")
tests/test_v96_validation_runs_space_test_tab.py ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from pathlib import Path
2
+
3
+ ROOT = Path(__file__).resolve().parents[1]
4
+
5
+
6
+ def read(path: str) -> str:
7
+ return (ROOT / path).read_text(encoding="utf-8")
8
+
9
+
10
+ def test_validation_runs_are_detected_and_open_space_test_tab_without_active_polling():
11
+ js = read("web/static/runs.js")
12
+ app = read("web/static/app.js")
13
+ assert "function isValidationRunDetail" in app
14
+ assert "validate_existing_space" in app
15
+ assert "showValidationRunDetail(detail)" in js
16
+ assert "startPolling(runId);renderRunDetail(detail)" in js
17
+ validation_branch = js.split("if(isValidationRunDetail(detail))", 1)[1].split("return}", 1)[0]
18
+ assert "startPolling" not in validation_branch
19
+ assert "setBuildModeInspecting" not in validation_branch
20
+
21
+
22
+ def test_space_test_tab_has_dedicated_validation_progress_and_latency():
23
+ html = read("web/index.html")
24
+ app = read("web/static/app.js")
25
+ css = read("web/static/app.css")
26
+ assert "spaceTestProgressFill" in html
27
+ assert "spaceTestProgressPercent" in html
28
+ assert "spaceTestTimeline" in html
29
+ assert "spaceTestLatency" in html
30
+ assert "function validationProgressPercent" in app
31
+ assert "renderValidationTimeline(data)" in app
32
+ assert "smoke.latency_seconds" in app
33
+ assert ".validation-progress-bar" in css
34
+ assert ".validation-step" in css
35
+
36
+
37
+ def test_generated_space_links_are_unlocked_once_space_creation_passed_without_touching_validation_links():
38
+ app = read("web/static/app.js")
39
+ assert "spaceLinksUnlockedFor" in app
40
+ assert "state.spaceLinksUnlockedFor=runForLinks" in app
41
+ assert "state.spaceLinksUnlockedFor===runForLinks" in app
42
+ assert "['activeOpenSpace','openSpace','launchOpenSpace']" in app
43
+ assert "deleteValidationRun" not in app.split("function setGeneratedSpaceLinksEnabled", 1)[1].split("}", 1)[0]
44
+
45
+
46
+ def test_finished_timeline_does_not_leave_partial_group_running():
47
+ progress = read("web/static/progress.js")
48
+ assert "terminalSuccess" in progress
49
+ assert "status=terminalSuccess?'done':'running'" in progress
tests/test_v98_run_health_insights.py ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from pathlib import Path
2
+
3
+ ROOT = Path(__file__).resolve().parents[1]
4
+
5
+ def read(path: str) -> str:
6
+ return (ROOT / path).read_text(encoding="utf-8")
7
+
8
+
9
+ def test_run_health_panel_replaces_selected_run_detail_below_explorer():
10
+ html = read("web/index.html")
11
+ css = read("web/static/app.css")
12
+ assert 'id="runHealthPanel"' in html
13
+ assert 'id="runHealthList"' in html
14
+ assert 'id="runHealthBadge"' in html
15
+ assert "Run Health" in html
16
+ assert "run-health-card" in css
17
+ assert "v98 run health summary" in css
18
+
19
+
20
+ def test_run_health_is_cache_driven_and_clickable_without_detail_panel():
21
+ js = read("web/static/runs.js")
22
+ assert "function renderRunHealth" in js
23
+ assert "Latest build" in js
24
+ assert "Latest validation" in js
25
+ assert "Current activity" in js
26
+ assert "Recent issues" in js
27
+ assert "data-health-run" in js
28
+ assert "selectRun(row.dataset.healthRun)" in js
29
+ assert "renderRunHealth();document.querySelectorAll('.run-row[data-run]')" in js
30
+
31
+
32
+ def test_run_health_routes_builds_and_validations_to_existing_tabs():
33
+ js = read("web/static/runs.js")
34
+ app = read("web/static/app.js")
35
+ assert "isValidationRunSummary" in js
36
+ assert "isValidationRunDetail({summary:run" in js
37
+ assert "if(isValidationRunDetail(detail)){showValidationRunDetail(detail)" in js.replace(" ", "")
38
+ assert "switchCenterTab('active');setBuildModeInspecting(runId);startPolling(runId)" in js
39
+ assert "function showValidationRunDetail" in app
40
+ assert "switchCenterTab('validate')" in app