Skip to content

tests(dashboard): [#306] added test coverage for the metric detail route - #310

Merged
ApusBerliozi merged 3 commits into
pyfenn:mainfrom
AaronProbha18:tests/metric-details
Aug 10, 2026
Merged

tests(dashboard): [#306] added test coverage for the metric detail route#310
ApusBerliozi merged 3 commits into
pyfenn:mainfrom
AaronProbha18:tests/metric-details

Conversation

@AaronProbha18

@AaronProbha18 AaronProbha18 commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Fixes: #306

Changes

  • Added TestSessionMetricDetailPage to tests/unit/dashboard/test_api.py, covering the session_metric_detail route added in the prior sub-issue.
  • 200 + content coverage: valid metric URL returns 200 (test_returns_200_for_known_metric), and the embedded metrics JSON blob is scoped to just that metric's points rather than the full unfiltered list (test_content_includes_correct_point_values), plus a breadcrumb-link check back to the parent session (test_content_includes_breadcrumb_to_session).
  • 404 coverage: unknown metric name, unknown session, unknown project, and a metric name requested on a session with zero recorded metrics (test_returns_404_for_unknown_metric, test_returns_404_for_unknown_session, test_returns_404_for_unknown_project, test_returns_404_for_metric_on_session_with_no_metrics).
  • Auth coverage: unauthenticated request to the detail route redirects to /connect (test_requires_authentication), consistent with the parent session route's existing behavior.
  • Link-generation coverage: the session page's Graphs tab renders "View details" links to all three metrics (test_session_page_links_to_metric_detail), and a regression check that a session with no <metric> data at all still renders those links without erroring (test_session_page_without_metrics_does_not_break).

Notes

  • Updated tests to ensure the session ID format regex supports both adjectives and nouns.(fix commit)
  • Corrected the style in fenn/reproducibility.py to pass ruff format check.

@ApusBerliozi
ApusBerliozi merged commit 0d1862e into pyfenn:main Aug 10, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Dashboard]: Add unit tests for metric detail page routing, 404s, and link generation

2 participants