Skip to content

feat(cost-management): add Playwright E2E test suite - #4276

Open
hardengl wants to merge 2 commits into
redhat-developer:mainfrom
hardengl:feature/cost-management-e2e-upstream
Open

feat(cost-management): add Playwright E2E test suite#4276
hardengl wants to merge 2 commits into
redhat-developer:mainfrom
hardengl:feature/cost-management-e2e-upstream

Conversation

@hardengl

Copy link
Copy Markdown
Contributor

Summary

Adds the Cost Management / ROS Playwright E2E suite into workspaces/cost-management, following the same two-tier pattern as the merged DCM suite (#3249).

Merge gate (CI): app.test.ts runs against the local workspace app shell — validates the app boots and sidebar renders.

Downstream E2E (Jenkins): 100+ tests across 11 files, activated by PLAYWRIGHT_URL. Covers:

  • Live-cluster smoke (navigation, table, details, charts, apply, performance)
  • 3-tier RBAC (ros.plugin / ros/<cluster> / ros/<cluster>/<project>) — FLPATH-4207
  • Secure proxy / server-side RBAC — FLPATH-3503
  • Marketplace install flow
  • OpenShift cost page, table/pagination, dark theme, Apply Recommendation workflow

Why a new branch (not the old fork branch)

Previous PRs failed for the wrong shape:

This PR is test-only, based on current main, and lands files under the renamed cost-management workspace.

Architecture

// playwright.config.ts
projects: [
  { name: 'chromium', testMatch: /app\.test\.ts$/ },           // merge gate
  ...(PLAYWRIGHT_URL ? [{ name: 'live', testMatch: // }] : []), // Jenkins
]

Run downstream tests with:

cd workspaces/cost-management
PLAYWRIGHT_URL=https://backstage-...apps... yarn e2e-test:live

Test plan

  • yarn playwright test --list → 1 test (chromium / merge gate) without PLAYWRIGHT_URL
  • PLAYWRIGHT_URL=… yarn playwright test --list → 104 tests in 12 files
  • Prettier + eslint via lint-staged on commit
  • GitHub CI: Playwright install + yarn playwright test for cost-management workspace
  • After merge: retarget Jenkins flightpath-ros profiles from fork branch feature/resource-optimization-e2e-tests → upstream main + workspaces/cost-management

Notes

  • No plugin code changes; no changeset (test-only)
  • CODEOWNERS: @PreetiW @mareklibra @ydayagi @batzionb @asmasarw @Aurobinda55 @r14chandra @kgaikwad
  • Nightlies can keep using the fork branch until this merges; then update RHDH_PLUGINS_BRANCH / path

Made with Cursor

Port the ROS/cost-management E2E suite into workspaces/cost-management with
a DCM-style two-tier Playwright config: merge-gate runs app.test.ts locally;
full live suite activates when PLAYWRIGHT_URL is set.

Signed-off-by: Gary Harden <gharden@redhat.com>
Assisted-by: Cursor Grok 4.5
Co-authored-by: Cursor <cursoragent@cursor.com>
@rhdh-gh-app

rhdh-gh-app Bot commented Aug 12, 2026

Copy link
Copy Markdown

Changed Packages

Package Name Package Path Changeset Bump Current Version
app workspaces/cost-management/packages/app none v0.0.5

@codecov

codecov Bot commented Aug 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 59.58%. Comparing base (2e4c46e) to head (42b7afd).
⚠️ Report is 4 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4276   +/-   ##
=======================================
  Coverage   59.58%   59.58%           
=======================================
  Files        2459     2459           
  Lines       98272    98272           
  Branches    27448    27438   -10     
=======================================
  Hits        58559    58559           
- Misses      39348    39352    +4     
+ Partials      365      361    -4     
Flag Coverage Δ *Carryforward flag
adoption-insights 84.55% <ø> (ø) Carriedforward from 3781352
ai-integrations 68.29% <ø> (ø) Carriedforward from 3781352
app-defaults 69.79% <ø> (ø) Carriedforward from 3781352
augment 46.67% <ø> (ø) Carriedforward from 3781352
boost 77.63% <ø> (ø) Carriedforward from 3781352
bulk-import 72.79% <ø> (ø) Carriedforward from 3781352
cost-management 13.55% <ø> (ø)
dcm 67.21% <ø> (ø) Carriedforward from 3781352
e2e-adoption-insights 60.00% <ø> (ø) Carriedforward from 3781352
e2e-extensions 62.13% <ø> (ø) Carriedforward from 3781352
e2e-intelligent-assistant 46.74% <ø> (ø) Carriedforward from 3781352
extensions 56.59% <ø> (ø) Carriedforward from 3781352
global-floating-action-button 71.18% <ø> (ø) Carriedforward from 3781352
global-header 66.50% <ø> (ø) Carriedforward from 3781352
homepage 47.50% <ø> (ø) Carriedforward from 3781352
install-dynamic-plugins 59.95% <ø> (ø) Carriedforward from 3781352
intelligent-assistant 75.42% <ø> (ø) Carriedforward from 3781352
konflux 91.98% <ø> (ø) Carriedforward from 3781352
lightspeed 69.02% <ø> (ø) Carriedforward from 3781352
mcp-integrations 83.40% <ø> (ø) Carriedforward from 3781352
orchestrator 71.27% <ø> (ø) Carriedforward from 3781352
quickstart 63.74% <ø> (ø) Carriedforward from 3781352
sandbox 79.56% <ø> (ø) Carriedforward from 3781352
scorecard 86.25% <ø> (ø) Carriedforward from 3781352
theme 88.14% <ø> (ø) Carriedforward from 3781352
translations 5.12% <ø> (ø) Carriedforward from 3781352
x2a 79.20% <ø> (ø) Carriedforward from 3781352

*This pull request uses carry forward flags. Click here to find out more.


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2e4c46e...42b7afd. Read the comment docs.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

SonarCloud S3923: both branches of the PLAYWRIGHT_URL conditional returned
the same path, which failed the new-code reliability quality gate.

Signed-off-by: Gary Harden <gharden@redhat.com>
Assisted-by: Cursor Grok 4.5
Co-authored-by: Cursor <cursoragent@cursor.com>
@hardengl

Copy link
Copy Markdown
Contributor Author

Status update

GitHub Actions: all required workspace CI checks passed (cost-management node 22/24 + verify).

SonarCloud: Quality Gate failed on 1 new bug — identical ternary in routes.ts (S3923). Fixed in 42b7afd and pushed; Sonar should re-run green.

CODEOWNERS already auto-requested: @ydayagi @mareklibra @batzionb @PreetiW @asmasarw @Aurobinda55 @r14chandra @kgaikwad

Ready for review once Sonar flips green. Test-only PR (same pattern as DCM #3249).

@sonarqubecloud

Copy link
Copy Markdown

@hardengl

Copy link
Copy Markdown
Contributor Author

All checks are green now (including SonarCloud Quality Gate after the S3923 fix).

@PreetiW @Aurobinda55 @mareklibra @kgaikwad @r14chandra @ydayagi @batzionb @asmasarw — ready for CODEOWNER review / merge when you have a chance. Test-only PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant