Skip to content

Conversation

lmiller1990
Copy link
Contributor

@lmiller1990 lmiller1990 commented Jun 24, 2022

User facing changelog

Fix a bug in migration where the old pluginsFile API is not respected during migration, causing the migration tool to hang without a response.

Additional details

The migration tool is not respecting when pluginsFile points to a directory containing index.js. For example:

- root
--- cypress
------ plugins
-------- index.js

If you set your cypress.json to

{
   "pluginsFile": "cypress/plugins"
}

Cypress 9 would figure out you wanted cypress/plugins/index.js, since we just did require(config.pluginsFile). It's not really documented, but it worked, so we should respect this during migration.

Although this was not explicitly documented, users coming from this usage encounter a migration screen that doesn't show any error, which is a terrible first experience when using Cypress 10, so I think it's better to just support this than error confusingly.

Steps to test

  1. Grab reproduction from Migration Helper loads endlessly #22461
  2. Try to migrate it

Note: supportFile pointing to a directory with index.js also worked previously, although not explicitly documented. This throws a reasonable error telling the user the problem, so it's not as problematic as the case of pluginsFile, where it just sat on a screen with a spinner.

How has the user experience changed?

Can migrate without getting stuck.

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)
  • Has a PR for user-facing changes been opened in cypress-documentation?
  • Have API changes been updated in the type definitions?

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Jun 24, 2022

Thanks for taking the time to open a PR!

@cypress
Copy link

cypress bot commented Jun 24, 2022



Test summary

37681 0 456 0Flakiness 13


Run details

Project cypress
Status Passed
Commit 41c3f44
Started Jun 24, 2022 7:38 AM
Ended Jun 24, 2022 7:55 AM
Duration 16:54 💡
OS Linux Debian - 10.11
Browser Multiple

View run in Cypress Dashboard ➡️


Flakiness

actions/click.cy.js Flakiness
1 ... > scroll-behavior > can scroll to and click elements in html with scroll-behavior: smooth
xhr.cy.js Flakiness
1 ... > logs request + response headers
2 ... > logs Method, Status, URL, and XHR
3 ... > logs response
4 ... > logs Method, Status, URL, and XHR
This comment includes only the first 5 flaky tests. See all 13 flaky tests in the Cypress Dashboard.

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

@lmiller1990 lmiller1990 marked this pull request as ready for review June 24, 2022 07:32
@lmiller1990 lmiller1990 requested review from a team and tgriesser as code owners June 24, 2022 07:32
@lmiller1990 lmiller1990 requested review from emilyrohrbough, astone123, a team, mike-plummer, tbiethman and tgriesser and removed request for a team and tgriesser June 24, 2022 07:32

debug('error, could not find path to pluginsFile!')

throw Error(`Could not find pluginsFile. Received projectRoot ${projectRoot} and pluginPath: ${pluginPath}`)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
throw Error(`Could not find pluginsFile. Received projectRoot ${projectRoot} and pluginPath: ${pluginPath}`)
throw Error(`Could not find pluginsFile in %s`, pluginLoc)

Copy link
Contributor

@tbiethman tbiethman left a comment

Choose a reason for hiding this comment

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

Works good. I appreciate the extra logs in here 👍

@mjhenkes mjhenkes merged commit c7f63e1 into develop Jun 24, 2022
@mjhenkes mjhenkes deleted the lmiller/issue-22461-implicit-index-migration branch June 24, 2022 14:48
tgriesser added a commit that referenced this pull request Jun 27, 2022
…esser/CLOUD-577-spec-list-display-latest-runs-batching

* muaz/CLOUD-577-spec-list-display-latest-runs:
  test: Addressing launchpad test flake in Windows (#22536)
  address comments from @marktnoonan
  Address code review comments
  followup on other comments
  re: @lmiller1990 PR comments
  chore(deps): update dependency semantic-release to v19 [security] (#22238)
  chore: Address skipped specs in server package (#22356)
  Address code review findings
  Address code review findings
  Empty-Commit to generate new percy nonce
  fix: handle case of implicit plugins/index.js files during migration (#22501)
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Jun 28, 2022

Released in 10.3.0.

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

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

Successfully merging this pull request may close these issues.

Migration Helper loads endlessly
4 participants