Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: sanitize internal vite plugins #22055

Merged
merged 3 commits into from
Jun 2, 2022
Merged

Conversation

ZachJW34
Copy link
Contributor

@ZachJW34 ZachJW34 commented Jun 2, 2022

User facing changelog

Vite dev-server for component testing will not crash if user has vite plugins that rely on non-empty plugins list

Additional details

Vite expects registered plugins to match a certain shape. We were pushing a null value into the plugins list if the user did not enable CYPRESS_INTERNAL_VITE_INSPECT or did not have vite-plugin-inspect installed. This PR filters the list of plugins we add to exclude any null values.

Also added a fallback for if the require of the plugin doesn't have a default property, as testing locally a node require of vite-plugin-inspect was returning the function.

Added unit testing to npm/vite-dev-server. We were running the vite cypress integration tests twice on CI since their is an explicit job for running the integration tests in the circle.yml and the package had a test script that pointed to the integration tests. I swapped the test script to only run the newly added unit tests.

Steps to test

See original issue

How has the user experience changed?

na

PR Tasks

  • Have tests been added/updated?
  • Has the original issue (or this PR, if no issue exists) been tagged with a release in ZenHub? (user-facing changes only)
  • [na] Has a PR for user-facing changes been opened in cypress-documentation?
  • [na] Have API changes been updated in the type definitions?

@ZachJW34 ZachJW34 requested review from a team as code owners June 2, 2022 18:45
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Jun 2, 2022

Thanks for taking the time to open a PR!

@marktnoonan
Copy link
Contributor

I see a failure on https://app.circleci.com/pipelines/github/cypress-io/cypress/38902/workflows/30f43bec-0c32-4cfd-82c3-f8fad4416773/jobs/1582942 but it looks Percy-related. I don't think we are using percy in these e2e tests at the moment, going to take a closer look at what's going on there.

@cypress
Copy link

cypress bot commented Jun 2, 2022



Test summary

4876 0 59 0Flakiness 1


Run details

Project cypress
Status Passed
Commit 0d4f040
Started Jun 2, 2022 8:22 PM
Ended Jun 2, 2022 8:37 PM
Duration 15:07 💡
OS Linux Debian - 10.11
Browser Electron 100

View run in Cypress Dashboard ➡️


Flakiness

cypress/e2e/cypress/proxy-logging.cy.ts Flakiness
1 Proxy Logging > request logging > xhr log has response body/status code when xhr response is logged second

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

Copy link
Contributor

@marktnoonan marktnoonan left a comment

Choose a reason for hiding this comment

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

🎉 I am on this branch and was able to open the packages/vuetify project in https://github.com/vuetifyjs/vuetify/tree/next in global mode without hitting the error this time. Percy CI issues can wait.

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Jun 2, 2022

Released in 10.0.2.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v10.0.2, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Jun 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
4 participants