-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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: scaffold integration files in app #18763
Conversation
Thanks for taking the time to open a PR!
|
Test summaryRun details
View run in Cypress Dashboard ➡️ Failures
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 |
@@ -336,4 +336,37 @@ export class ProjectActions { | |||
content: newSpec.content, | |||
} | |||
} | |||
|
|||
async scaffoldIntegration () { |
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 think with the addition of this we could probably break this and the other CodeGen related methods out to another Action file that better encomppasses what they were doing. Maybe something like CodeGenActions
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 agree, and I think it could be further improved by moving a lot of stuff out of ProjectDataSource that is related to codegen. I'll tackle that after the create spec flow is in though.
@@ -10,7 +10,7 @@ export interface ProjectShape { | |||
projectRoot: string | |||
} | |||
|
|||
const GeneratedSpec = objectType({ | |||
export const GeneratedSpec = objectType({ |
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.
For this I think we should keep it to one objectType per file. It would be easier to find gql-GeneratedSpec
then remember what it's paired with
}, | ||
}) | ||
|
||
export const CodeGenResultWithFileParts = objectType({ |
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.
Same thing here with multiple objectTypes
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'm going to keep this one in here since I'm really only extending the type.
aad69dc
to
3e6e075
Compare
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.
Some comments!
packages/app/src/pages/NewSpec.vue
Outdated
@@ -14,9 +14,12 @@ | |||
<Button @click="codeGenTypeClicked('integration')"> | |||
Generate Integration | |||
</Button> | |||
<Button @click="codeGenTypeClicked('scaffoldIntegration'); scaffoldIntegration.executeMutation({})"> |
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 think we should create a method on <script>
for this, to keep <template>
more thin and simple.
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 page was deleted with Jess' recent merge of the create-spec
flow, but yeah I should have had moved that into a function.
packages/server/lib/project-base.ts
Outdated
@@ -847,7 +847,10 @@ export class ProjectBase<TServer extends Server> extends EE { | |||
|
|||
if (scaffoldExamples) { | |||
debug('will scaffold integration and fixtures folder') | |||
push(scaffold.integration(cfg.integrationFolder, cfg)) | |||
if (!process.env.LAUNCPAD) { |
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.
Uh oh... LAUNCHPAD
. This will always be true!
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 always be true when running the new launchpad which is what we want. There are some system-tests for the old desktop-gui that still rely on the old scaffolding and this gating was to allow those to continue to work while allowing the new functionality for launchpad. @tgriesser am I correct here?
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 am saying you made a typo - you are missing the N
in LAUNCPAD
packages/app/src/pages/NewSpec.vue
Outdated
<RouterLink | ||
:key="generatedSpec.fileParts.absolute" | ||
class="text-left" | ||
:to="{ path: 'runner', query: { file: generatedSpec.fileParts.relative } }" |
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.
Is this supposed to immediately execute the spec? I think the route has changed to something like /spec?file=...
.
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 page was deleted, I'll integrate the scaffold integration into the new flow.
Just one comment (re spelling of launchpad). Once this is resolved we can merge |
8207e54
to
ca88b66
Compare
ca88b66
to
4169ee0
Compare
4169ee0
to
0cf3451
Compare
…ypress into scaffold-integration-in-app
* 10.0-release: feat: improve vite DX (#18937) feat: Use plugins on config files (#18798) BREAKING CHANGE: trigger major bump BREAKING CHANGE: trigger major bump fix: fix cypress/package.json crasher fix(breaking): change circle.yml to release binary fix: build-prod-ui deps before build-prod packages feat: implement spec list tree (#18901) chore: adding 10.0-release to the circle.yml build script (#18926) feat(app): remove __vite__ route and default to unified runner (#18909) fix: app layout + specs list review (#18862) feat(app): show previous versions (#18838) feat: scaffold integration files in app (#18763) feat: add footer to the settings (#18867) fix: Exit when both --e2e and --component flags are passed in (#18855)
Details
This PR moves the scaffolding of integration files into the app using the new code-generation utility. This will enable the
Scaffold example specs
UI flow.The scaffolded integration files come from cypress-kitchen-sink which are pulled down and copied into
@packages/example
. I didn't want to move them into thetemplates
directory since they might fall out of sync.The codegen differs from the story and component spec generation so I settled on a data-model for generated files that graphql can serve. This data model should work for our scaffolding inside the launchpad that is currently mocked.
Screen.Recording.2021-11-02.at.5.25.40.PM.mov
Draft PR since I have to fix some tests that relied on the specs being generated within
@packages/server