fffiloni commited on
Commit
b481880
·
verified ·
1 Parent(s): a62baed

Upload 133 files

Browse files
tests/test_v178_run_storage_eval_status_polish.py CHANGED
@@ -11,7 +11,7 @@ def test_run_storage_eval_disabled_copy_is_compact():
11
 
12
  def test_run_storage_eval_enabled_copy_is_compact_with_tooltip():
13
  js = (ROOT / 'web/static/app.js').read_text()
14
- assert 'Anonymous eval archive is on' in js
15
  assert 'ASF backend publishes anonymized eval records after user Jobs write local run evals.' in js
16
  assert 'Anonymous project eval archive enabled from' in js
17
 
 
11
 
12
  def test_run_storage_eval_enabled_copy_is_compact_with_tooltip():
13
  js = (ROOT / 'web/static/app.js').read_text()
14
+ assert "title.textContent=enabled?'Anonymous eval archive':'Anonymous eval archive'" in js
15
  assert 'ASF backend publishes anonymized eval records after user Jobs write local run evals.' in js
16
  assert 'Anonymous project eval archive enabled from' in js
17
 
tests/test_v182_run_storage_eval_archive_card.py CHANGED
@@ -3,7 +3,7 @@ from pathlib import Path
3
  ROOT = Path(__file__).resolve().parents[1]
4
 
5
 
6
- def test_eval_archive_has_dedicated_card_and_owner_actions():
7
  html = (ROOT / "web" / "index.html").read_text()
8
  assert 'id="evalArchiveCard"' in html
9
  assert 'id="evalArchiveTitle"' in html
@@ -32,9 +32,8 @@ def test_eval_archive_backend_has_permission_flags_and_disable_endpoint():
32
  assert "Only the instance owner" in cfg
33
 
34
 
35
- def test_eval_archive_card_css_is_spacious_not_pill_only():
36
  css = (ROOT / "web" / "static" / "app.css").read_text()
37
- assert ".eval-archive-card" in css
38
- assert "grid-template-columns:minmax(0,1fr) auto" in css
39
  assert ".eval-archive-actions" in css
40
  assert ".eval-feedback{display:block" in css
 
3
  ROOT = Path(__file__).resolve().parents[1]
4
 
5
 
6
+ def test_eval_archive_has_dedicated_panel_and_owner_actions():
7
  html = (ROOT / "web" / "index.html").read_text()
8
  assert 'id="evalArchiveCard"' in html
9
  assert 'id="evalArchiveTitle"' in html
 
32
  assert "Only the instance owner" in cfg
33
 
34
 
35
+ def test_eval_archive_panel_css_is_spacious_not_pill_only():
36
  css = (ROOT / "web" / "static" / "app.css").read_text()
37
+ assert ".eval-archive-panel" in css
 
38
  assert ".eval-archive-actions" in css
39
  assert ".eval-feedback{display:block" in css
tests/test_v183_eval_archive_observability_column.py ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from pathlib import Path
2
+
3
+ ROOT = Path(__file__).resolve().parents[1]
4
+
5
+
6
+ def test_eval_archive_panel_is_moved_below_run_stats_not_inside_run_storage():
7
+ html = (ROOT / "web" / "index.html").read_text()
8
+ storage_start = html.index('id="bucketSetupPanel"')
9
+ build_start = html.index('id="newBuildCard"')
10
+ assert 'id="evalArchiveCard"' not in html[storage_start:build_start]
11
+
12
+ stats = html.index('id="runStatsPanel"')
13
+ eval_panel = html.index('id="evalArchiveCard"')
14
+ billing = html.index('id="billingPanel"')
15
+ assert stats < eval_panel < billing
16
+ assert 'class="eval-archive-panel" id="evalArchiveCard"' in html
17
+ assert 'id="evalArchiveStateBadge"' in html
18
+
19
+
20
+ def test_eval_archive_render_uses_panel_class_and_state_badge():
21
+ js = (ROOT / "web" / "static" / "app.js").read_text()
22
+ assert "card.className='eval-archive-panel '" in js
23
+ assert "evalArchiveStateBadge" in js
24
+ assert "stateBadge.textContent=enabled?'On':'Off'" in js
25
+
26
+
27
+ def test_eval_archive_css_is_observability_panel_not_left_storage_pill():
28
+ css = (ROOT / "web" / "static" / "app.css").read_text()
29
+ assert "v183: Eval Archive moved to the observability column under Run Stats" in css
30
+ assert ".eval-archive-panel" in css
31
+ assert ".eval-archive-summary" in css
32
+ eval_css = css.split('/* v183: Eval Archive moved to the observability column under Run Stats */', 1)[1]
33
+ assert "grid-template-columns:minmax(0,1fr) auto" not in eval_css
tests/test_v185_model_prescan_all_states.py ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from pathlib import Path
2
+
3
+ ROOT = Path(__file__).resolve().parents[1]
4
+ APP_JS = (ROOT / "web" / "static" / "app.js").read_text()
5
+ APP_CSS = (ROOT / "web" / "static" / "app.css").read_text()
6
+
7
+
8
+ def test_prescan_renderer_supports_compact_transient_and_error_states():
9
+ assert "transient===true" in APP_JS
10
+ assert "verdict:'scanning'" in APP_JS
11
+ assert "verdict:'error'" in APP_JS
12
+ assert "prescan-spinner" in APP_JS
13
+ assert "The model pre-scan could not complete" in APP_JS
14
+
15
+
16
+ def test_prescan_renderer_keeps_all_verdicts_in_same_compact_system():
17
+ for verdict in ["safe", "caution", "risky", "unsupported", "scanning", "error"]:
18
+ assert f"{verdict}:" in APP_JS or f"verdict==='{verdict}'" in APP_JS
19
+ assert "prescan-compact-grid" in APP_JS
20
+ assert "prescan-pill-row" in APP_JS
21
+ assert "prescan-recommendation-line" in APP_JS
22
+
23
+
24
+ def test_prescan_css_has_state_specific_compact_surfaces():
25
+ for selector in [
26
+ ".model-prescan-card.required",
27
+ ".model-prescan-card.running",
28
+ ".model-prescan-card.warn",
29
+ ".model-prescan-card.error",
30
+ ".model-prescan-card.success",
31
+ ".prescan-pill.running",
32
+ ".prescan-recommendation-line.warn",
33
+ ".prescan-recommendation-line.error",
34
+ ]:
35
+ assert selector in APP_CSS
36
+ assert "@keyframes prescan-spin" in APP_CSS