Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci-ready.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ jobs:
tests/apps/test_profile_story_checks.py::test_profile_and_trace_shortcuts_open_recorded_evidence \
tests/apps/test_knowledge_navigation_browser.py \
tests/apps/test_round_decisions_browser.py \
tests/apps/test_dashboard_experiments_browser.py \
tests/apps/dashboard/test_dashboard_experiments_browser.py \
tests/apps/test_result_delivery.py::test_offline_html_remains_readable_without_scripts_or_network \
--junitxml="$RUNNER_TEMP/dashboard-browser-results.xml"
- name: Retain browser test results
Expand Down
4 changes: 2 additions & 2 deletions docs/dashboard/dashboard-experiments.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,11 @@ three reference roles, a maximize metric, and a partial story.
```bash
python tests/fixtures/dashboard_experiments.py /tmp/dashboard-experiment-example
# Open /tmp/dashboard-experiment-example/dashboard.html locally.
pytest tests/apps/test_dashboard_experiments.py tests/apps/test_dashboard_external.py
pytest tests/apps/dashboard/test_dashboard_experiments.py tests/apps/dashboard/test_dashboard_external.py
# Optional real Chromium tests, including both layouts' actual loopback refresh:
python -m pip install playwright
python -m playwright install chromium
pytest tests/apps/test_dashboard_experiments_browser.py
pytest tests/apps/dashboard/test_dashboard_experiments_browser.py
```

[English screenshot](../assets/dashboard-experiments-en.png) ·
Expand Down
2 changes: 1 addition & 1 deletion tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Windows can collect the suite and run the portable parallel-round cases with
`python -m pytest tests/harness/test_parallel_round.py::TestPortableParallelRound`.
Parallel-round execution tests that need POSIX directory descriptors run on Linux.

- [Apps](apps/) covers the CLI, integrations, application workflows, and result views.
- [Apps](apps/) covers the CLI, integrations, application workflows, and result views such as the [dashboard](apps/dashboard/).
- [Benchmark](benchmark/) covers task preparation, measurements, and evaluators.
- [Campaigns](campaigns/) covers model-specific workloads, adapters, and archived campaigns.
- [Contracts](contracts/) covers shared types, schemas, and evidence paths.
Expand Down
1 change: 1 addition & 0 deletions tests/apps/dashboard/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Tests for the Apps dashboard."""
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ def test_profile_layout_preserves_partial_summary_and_keyboard_drilldown(


def test_profile_home_shows_absolute_trend_and_links_exact_round(browser, tmp_path):
from tests.apps.test_dashboard_data import candidate, run, write_json
from .test_dashboard_data import candidate, run, write_json

write_json(tmp_path / "campaign.json", {
"campaign_id": "paired", "review_layout": "profile_first",
Expand Down Expand Up @@ -274,7 +274,7 @@ def test_profile_home_shows_absolute_trend_and_links_exact_round(browser, tmp_pa


def test_mixed_profile_keeps_native_paired_reference(browser, tmp_path):
from tests.apps.test_dashboard_data import candidate, run, write_json
from .test_dashboard_data import candidate, run, write_json

write_json(tmp_path / "campaign.json", {
"campaign_id": "mixed", "review_layout": "profile_first",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,14 @@

import pytest

from inferrsi.apps import views
from inferrsi.apps.cli import main
from inferrsi.apps.views import dashboard_live
from inferrsi.apps.views.dashboard import write_dashboard
from inferrsi.apps.views.dashboard_live import DashboardServer

TEMPLATE = Path(views.__file__).with_name("template.html")


@pytest.fixture
def dashboard_server(tmp_path):
Expand Down Expand Up @@ -147,7 +150,6 @@ def test_compact_live_transport_interns_repeated_context_without_changing_legacy

@pytest.mark.skipif(shutil.which("node") is None, reason="Node.js is needed for the UI regression")
def test_compact_contexts_are_restored_exactly_in_the_browser():
template = Path(__file__).parents[2] / "src/inferrsi/apps/views/template.html"
script = r"""
const fs = require('node:fs'), assert = require('node:assert/strict');
const html = fs.readFileSync(process.argv[1], 'utf8');
Expand All @@ -166,7 +168,7 @@ def test_compact_contexts_are_restored_exactly_in_the_browser():
{optimization_trace:{context:{text:{$context:0}}}}]}));
assert.deepEqual(restore({candidates:[]}), {candidates:[]});
"""
subprocess.run([shutil.which("node"), "-e", script, str(template)], check=True,
subprocess.run([shutil.which("node"), "-e", script, str(TEMPLATE)], check=True,
capture_output=True, text=True)


Expand Down Expand Up @@ -226,7 +228,6 @@ def test_live_cli_rejects_incompatible_flags(tmp_path):

@pytest.mark.skipif(shutil.which("node") is None, reason="Node.js is needed for the UI regression")
def test_live_selection_matches_identity_after_rows_change():
template = Path(__file__).parents[2] / "src/inferrsi/apps/views/template.html"
script = r"""
const fs = require('node:fs'), assert = require('node:assert/strict');
const html = fs.readFileSync(process.argv[1], 'utf8');
Expand All @@ -246,5 +247,5 @@ def test_live_selection_matches_identity_after_rows_change():
{candidate_id:'a', run_id:'y', round:2}];
assert.equal(find(a), -1); // Ambiguous identities never select another row.
"""
subprocess.run([shutil.which("node"), "-e", script, str(template)], check=True,
subprocess.run([shutil.which("node"), "-e", script, str(TEMPLATE)], check=True,
capture_output=True, text=True)
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@

import pytest

from inferrsi.apps import views

NODE = shutil.which("node")
TEMPLATES = Path(__file__).parents[2] / "src/inferrsi/apps/views"
TEMPLATES = Path(views.__file__).parent
pytestmark = pytest.mark.skipif(NODE is None, reason="Node.js is needed for dashboard UI scripts")


Expand Down
Loading