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

feat: support specPattern, deprecate integrationFolder and componentFolder #19319

Merged
merged 146 commits into from
Jan 4, 2022

Conversation

lmiller1990
Copy link
Contributor

@lmiller1990 lmiller1990 commented Dec 9, 2021

Documented here (Cypress team only): https://www.notion.so/cypressdx/testFiles-specPattern-glob-patterns-295d545a0af942ebb5b71eda2a6d422b

  • deprecate testFiles, integrationFolder, component, superseded by specPattern, configurable on component and e2e

important this PR is really big since the concept of integrationFolder is sprinkled throughout the entire system. The main, important, and possibly breaking change is explained here: https://github.com/cypress-io/cypress/pull/19319/files#r765721951 please read this comment and ask if you have any concerns. @cowboy is the main person to talk to about this change in behavior.

Before

{
  integrationFolder: 'cypress/integration',
  testFiles: '**/*'
}

After

{
  e2e: {
    specPattern: 'cypress/integration/**/*',
  }
}

Scaffolding cypress/integration is gone

Our scaffolding logic is very closely tied to cypress/integration existing. Since we no longer scaffold by default on first use, instead using a visual wizard to let the user choose which specs they'd like to scaffold, I deleted all this code and relevant tests.

util/spec.ts is gone

Now using the findSpecs method in data-context, which does the same thing with much less indirection, not relying on integration or component folders any more, instead just using the new specPattern property. We only hit the file system once, then caching the specs in ctx.currentProject.specs, making it nice and quick.

Breaking change for @cypress/code-coverage

No integrationFolder is a breaking change for code coverage. I patched it locally to get CI passing for now: https://github.com/cypress-io/cypress/pull/19319/files#diff-84b549ff6d349070e8dfaf1b1713e4213274611342147dfcc2456848147d72f6. We will need to figure out the migration strategy here. Made an issue here.

Coming in future PR

  • cypress/integration/**/* instead of cypress/e2e/**/*.cy.js
  • update ignoreTestFiles to ignoreSpecPattern

As outlined in notion, we are changing the default directory for e2e from cypress/integration to cypress/e2e. Changing the default means changing all our projects in system-tests/projects (all 89 of them) and all the ones in npm. It's easy but adds a lot of noise to the PR. For this reason, I'll do those in a separate PR (WIP HERE).

chrisbreiding
chrisbreiding previously approved these changes Dec 15, 2021
ryanthemanuel
ryanthemanuel previously approved these changes Dec 20, 2021
@lmiller1990 lmiller1990 merged commit 792980a into 10.0-release Jan 4, 2022
@lmiller1990 lmiller1990 deleted the lmiller1990/update-spec-patter-change-path branch January 4, 2022 04:24
tgriesser added a commit that referenced this pull request Jan 4, 2022
* 10.0-release:
  feat: support specPattern, deprecate integrationFolder and componentFolder (#19319)
  refactor: remove concept of liveMutation (#19528)
  chore: Adding `validateExternalLink` command to increase e2e coverage of external links (#19462)
  chore: remove vite-plugin-favicon, add a simple favicon path (#19527)
  feat: implement the ui for migration to 10.0 (#19371)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants