Skip to content

feat(ui): Build Cypress e2e test specs with Vite#16197

Merged
dvail merged 6 commits intomasterfrom
dv/exp/cypress-vite-for-e2e-tests
Oct 17, 2025
Merged

feat(ui): Build Cypress e2e test specs with Vite#16197
dvail merged 6 commits intomasterfrom
dv/exp/cypress-vite-for-e2e-tests

Conversation

@dvail
Copy link
Copy Markdown
Contributor

@dvail dvail commented Jul 29, 2025

Description

Do not merge until 4.10A

Changes Cypress to use Vite instead of Webpack to compile e2e test specs before execution.

Why?

  1. Probably faster (negligible)
  2. No longer opens webpack-bundle-analyzer in a new tab every time we run a spec

Two changes were needed to make this happen:

  1. Instead of using path.join in individual test files, this was moved to a cypress task helper. The reason for this is that Vite does not polyfill nodejs built in modules, and calling path from browser code fails.
  2. We resolve the internal path to cypress-axe when the cypress config loads. Otherwise, the library attempts to do this dynamically at runtime with CommonJS require, which also fails due to Vite not supporting it out of the box.

User-facing documentation

Testing and quality

  • the change is production ready: the change is GA, or otherwise the functionality is gated by a feature flag
  • CI results are inspected

Automated testing

  • added unit tests
  • added e2e tests
  • added regression tests
  • added compatibility tests
  • modified existing tests

How I validated my change

npm run cypress-open locally, run a spec, and observe the absense of a bundle-analyzer tab.

CI

@dvail
Copy link
Copy Markdown
Contributor Author

dvail commented Jul 29, 2025

This change is part of the following stack:

Change managed by git-spice.

@dvail dvail requested review from a team as code owners July 29, 2025 14:43
@rhacs-bot
Copy link
Copy Markdown
Contributor

rhacs-bot commented Jul 29, 2025

Images are ready for the commit at 9b88126.

To use with deploy scripts, first export MAIN_IMAGE_TAG=4.10.x-58-g9b88126249.

@codecov
Copy link
Copy Markdown

codecov bot commented Jul 29, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 48.83%. Comparing base (fa2968e) to head (9b88126).
⚠️ Report is 11 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #16197      +/-   ##
==========================================
+ Coverage   48.81%   48.83%   +0.01%     
==========================================
  Files        2718     2718              
  Lines      202948   202948              
==========================================
+ Hits        99074    99101      +27     
+ Misses      96081    96060      -21     
+ Partials     7793     7787       -6     
Flag Coverage Δ
go-unit-tests 48.83% <ø> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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

@openshift-ci
Copy link
Copy Markdown

openshift-ci bot commented Jul 29, 2025

@dvail: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/ocp-4-18-ui-e2e-tests 4bc18d5 link false /test ocp-4-18-ui-e2e-tests

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@dvail dvail added do-not-merge/work-in-progress do-not-merge A change which is not meant to be merged labels Jul 29, 2025
@dvail
Copy link
Copy Markdown
Contributor Author

dvail commented Jul 29, 2025

Looks like this needs a little bit more work before merging.

@dvail dvail force-pushed the dv/exp/cypress-vite-for-e2e-tests branch from 4bc18d5 to aad77c6 Compare October 2, 2025 19:17
Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New security issues found

sourcery-ai[bot]
sourcery-ai bot previously requested changes Oct 2, 2025
Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New security issues found

@dvail dvail requested a review from pedrottimark October 2, 2025 19:26
@dvail dvail dismissed sourcery-ai[bot]’s stale review October 2, 2025 19:30

The security warning is not relevant to this code that only runs in test environments, and does not accept user input. The AI bot also apparently cannot remove the "Changes requested" status even if it agrees with a comment stating the previous.

Copy link
Copy Markdown
Contributor

@pedrottimark pedrottimark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super investigation and solutions, as usual.

@dvail dvail removed the do-not-merge A change which is not meant to be merged label Oct 17, 2025
@dvail dvail merged commit 070db47 into master Oct 17, 2025
105 of 106 checks passed
@dvail dvail deleted the dv/exp/cypress-vite-for-e2e-tests branch October 17, 2025 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants