← Back to Pull requests

test(maas-portal): add Cypress coverage #10355

Open
unknown opened this pull request with 541 lines diff across 6 files
View on GitHub
unknown unknown commented on Oct 20, 2026 17:01 UTC
Author

Problem

The standalone MaaS Portal lacks browser coverage for its assembled UI. Module tests do not exercise portal-prefixed navigation, the portal shell, or how MaaS, GenAI, and observability features behave together.

Solution

  • Add 27 Cypress mock tests covering navigation and reloads, API key creation/revocation, subscriptions and governance, playground chat, observability access/error states, and Grid flag behavior.

  • Reuse module-owned page objects and fixtures through shared test exports. Keep portal navigation and portal-specific states local, and fail tests on unmatched fetch/XHR requests.

  • Run the production portal bundle with intercepted APIs, without starting BFFs or requiring a cluster. BFF behavior remains covered by the modules' own suites.

  • Register the portal in the existing Cypress-Mock-Tests matrix. The dashboard-shards runner uses shared builds and selected dashboard specs; standalone-app runs the application's own build, server, and Cypress suite. Select portal tests from transitive workspace dependencies and build/test inputs, with conservative execution when impact cannot be determined. Reuse the existing final Tests check; no dedicated portal job or gate is required.

  • Collect portal code coverage with test-only Istanbul instrumentation and reuse the existing coverage artifact, merge, and Codecov steps. Partial runs, including portal-only selections, produce merged coverage artifacts. Update the shared cypress-mock Codecov flag only when the complete dashboard matrix and all registered application suites run; other runs use carryforward coverage. Normal production builds remain uninstrumented.

  • Keep distribution impact selection in the shared library, remove the unused standalone selector CLI, and add separate application/Cypress type checks with shared command declarations. Document local execution and extension patterns.
  • The MaaS Portal suite covers the assembled application’s navigation and feature flows. The Grid tests provide initial coverage of Grid mode by checking project-selector visibility with the flag enabled and disabled, including after reload. This coverage should be improved and expanded to exercise broader Grid-specific workflows.

    Evidence

    Validation from the repository root:

    COVERAGE=true pnpm --filter @odh-dashboard/maas-portal-distribution test:cypress-ci
    pnpm run test:cypress-orchestration
    pnpm run test:ci-matrix
    pnpm --filter @odh-dashboard/maas-portal-distribution type-check
    pnpm run type-check
    pnpm run lint
    

  • All 27 browser tests pass across five specs with coverage enabled, including the API key accessibility check.

  • All 98 orchestration tests and 9 CI matrix/status tests pass (107 total), covering dependency selection, runner routing, portal-only and combined coverage merging, and final-job handling of failures, cancellations, and unexpected skips.

  • JSON and LCOV reports contain executed portal, base shell, MaaS, GenAI, and observability sources. Tests, mock factories, and generated extension declarations are excluded. A separate normal production build contains no coverage instrumentation.

  • Portal and repository-wide type checks pass. Lint passes with existing warnings. The updated frozen lockfile passes pnpm validation.
  • Browser tests use mocked service responses; they do not verify deployed authentication, production proxy routing, persistent writes, real inference, or live metrics. This PR adds test infrastructure and does not change the production UI.

    <!-- This is an auto-generated comment: release notes by coderabbit.ai -->
    <!-- coderabbit-ai-generated:v1 -->

    Summary by CodeRabbit

    Testing & Quality
    Added automated MaaS Portal checks for navigation, observability, playground, subscriptions, API keys, governance, and Grid scenarios.
    Tests flag unexpected network requests and produce reports and coverage data.

    CI Improvements
    Cypress mock tests now select affected dashboard shards and standalone applications, skipping unrelated test runs.
    Added application-specific test artifacts and combined coverage reporting.

    Documentation
    Expanded guidance for running and debugging tests, reviewing coverage and artifacts, and understanding CI test selection.
    <!-- end of auto-generated comment: release notes by coderabbit.ai -->

    Diff: 541 lines (+405 / -136) across 6 files Reviewer: lucferbux Review duration: 4223m
    All Vouch review confidence checks passed
    Residual risk 0.26 = Change Risk (0.48) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.48 · 541 lines diff across 6 files
    0.48
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.377
    Shallow Review Depth shallow_review_depth
    0.344
    Real PR Conversation Timeline
    1 comments
    "Review active on #10355"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 48.0% (MEDIUM) · Higher = larger blast radius
    48.0%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 46.7% · Lower = rushed or shallow review
    46.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 25.6% · Safe to merge
    25.6%