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 #19168
Conversation
5ea8a5e
to
df3d841
Compare
Test summaryRun details
View run in Cypress Dashboard ➡️ Flakiness
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 |
…cypress-io/cypress into lmiller1990/update-spec-pattern
@@ -110,7 +105,9 @@ const resolvedOptions: Array<ResolvedConfigOption> = [ | |||
}, { | |||
name: 'e2e', | |||
// e2e runner overrides | |||
defaultValue: {}, | |||
defaultValue: { | |||
specPattern: 'cypress/integration/**/*', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be cypress/e2e/**/*.cy.js
but changing this means changing all our example projects, making this PR ungodly huge, so I will come back for this soon.
Also @tgriesser is doing work around config and this code will change a bunch soon (again) anyway.
return [] | ||
} | ||
|
||
const pattern = await ctx.project.specPatternForTestingType(source.projectRoot, ctx.appData.currentTestingType) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should cache these instead of hitting filesystem each time but outside scope of this PR
@@ -1137,7 +944,7 @@ describe('Routes', () => { | |||
// .expect("Content-Type", /application\/json/) | |||
// .expect(JSON.parse(json)) | |||
|
|||
context('GET /__cypress/iframes/*', () => { | |||
xcontext('GET /__cypress/iframes/*', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I deleted the code this is associated with, but going to leave this in case I missed something.
const { experimental } = require(`${root}../lib/experiments`) | ||
|
||
describe('lib/modes/run', () => { | ||
// todo(lachlan): put these back in when we've updated run.js | ||
xdescribe('lib/modes/run', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This spec is basically impossible to get passing without a HUGE amount of extra stubbing, since we now use the data context in run.js
... the unit tests here are really not very useful anyway, but I'm going to leave them here and hopefully keep some of them when we finish run mode for the unified runner.
@@ -39,7 +40,8 @@ exports['e2e new project passes 1'] = ` | |||
(Video) | |||
|
|||
- Started processing: Compressing to 32 CRF | |||
- Finished processing: /XXX/XXX/XXX/cypress/videos/app_spec.js.mp4 (X second) | |||
- Finished processing: /XXX/XXX/XXX/cypress/videos/cypress/integration/app_spec.js (X second) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this probably correct, but it somehow feels off... cypress/videos/cypress/integration
vs cypress/videos/integration
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cypress/videos
+ <spec relative to projectRoot>
Previously we stripped of integrationFolder
. Yes this feels weird, I agree.
# testing scaffolding examples and running them | ||
# against example.cypress.io |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to record this as an action item to follow up on / add back in one way or another?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm yes probably, we want to make sure all the scaffolded specs still function and work, just without all the complexity of the existing scaffolding setup.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gone in favor of #19319 |
Documented here (Cypress team only): https://www.notion.so/cypressdx/testFiles-specPattern-glob-patterns-295d545a0af942ebb5b71eda2a6d422b
This is a gigantic change that touches every inch of the system, and has several breaking changes. Those are:
testFiles
,integrationFolder
,component
specPattern
, configurable oncomponent
ande2e
ignoreTestFiles
is nowignoreSpecPattern
Before
After
Scaffolding
cypress/integration
is goneOur 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 goneNow using the
findSpecs
method in data-context, which does the same thing with much less indirection, not relying onintegration
orcomponent
folders any more, instead just using the newspecPattern
property.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/19168/files#diff-f7d0849fee5886e2b2efea84707ab2d2b8046975155572be66a486e5a7de1354. We will need to figure out the migration strategy here. Made an issue here.Default is still
cypress/integration/**/*
instead ofcypress/e2e/**/*.cy.js
As outlined in notion, we are changing the default directory for e2e from
cypress/integration
tocypress/e2e
. Changing the default means changing all our projects insystem-tests/projects
(all 89 of them) and all the ones innpm
. It's easy but adds a lot of noise to the PR. For this reason, I'll do those in a separate PR.