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

RFC Contributing Tools: script to create a functional test project using the latest CRWA template #2218

Closed
2 tasks
thedavidprice opened this issue Apr 6, 2021 · 6 comments · Fixed by #2324
Closed
2 tasks

Comments

@thedavidprice
Copy link
Contributor

thedavidprice commented Apr 6, 2021

Local development often requires setting up a functional test project (Redwood App). Additionally, when new hosting providers, auth providers, or other service companies want to integrate with Redwood, they ask if there's a canonical Redwood project for development and testing.

It seems everyone has their own way of managing this, from using an example app, completed Tutorial codebase, a branch from their personal project, etc. During release QA, I start with a fresh project installed using the current create-redwood-app/template codebase in the main branch. I then run the E2E Cypress test against this new project, committing the state after it has applied code mods and completed the run successfully.

I propose creating a new ./tasks script that replicates my QA process:

  1. install a new project using the CRWA/template from the current branch yarn babel-node packages/create-redwood-app/src/create-redwood-app.js path/to/project
  2. apply a series of code mods similar to those for the Cypress E2E test

To Do

  • determine a "canonical" feature set and code mods (if not those represented in the Cypress Tutorial test)
    • CLI generators should be prioritized as much as possible
    • bonus: developer could extend the automatic project build "instructions" with additional commands and code mods, e.g. need to add a specific auth provider, components/pages, setup commands, etc. for repeated or collaborative development testing
  • add documentation to CONTRIBUTING.md
@Tobbe
Copy link
Member

Tobbe commented Apr 6, 2021

This is a great idea @thedavidprice!

What's the scope of the generated project? Some of my latest PRs, and one I'm currently working on, all require auth to be able to test properly. Would this generated project include auth as well?

@thedavidprice
Copy link
Contributor Author

@Tobbe I'd added this catch-all BonusBullet:

bonus: developer could extend the automatic project build "instructions" with additional commands and code mods, e.g. need to add a specific auth provider, components/pages, setup commands, etc. for repeated or collaborative development testing

What if the script allowed passing setup command(s)? So you could do something like:

./tasks/build-project --setup "auth netlify "deploy netlify" tailwind

We could work on the syntax, but do you get the idea?

@renansoares
Copy link
Contributor

renansoares commented Apr 7, 2021

Hey @thedavidprice, such a good improvement to make it easier to contribute.

I am wondering I have enough knowledge on the project to pick up this story 👁️

Would it be a good start point to create the run the same tests that are in the Cypress tutorial? If I understood correctly, those are the tests that are running in the CI?

@thedavidprice
Copy link
Contributor Author

@renansoares hi there! (and, wow, do I owe you some discussion about Lighthouse score project 😬) This would be an amazing project to help with. And even higher in priority to lighthouse scores.

I tried to contact you last week via forums admin but had a bounce on your email address. If you're up for it, could we find a time to connect real-time for 30 min? That way I can remove myself as a bottleneck and empower you to move forward!

Open to other suggestions. If you're up for it, email me at thedavid@thedavidprice.com (you can also try Discord or Forums, but I'm often slower to reply on those)

@thedavidprice
Copy link
Contributor Author

Update

@renansoares and I connected and strategized about this today. He's going to start working on this (and will also keep in mind #981) 🚀

The first step is to experiment with a script for installing the project, running CLI commands, and applying code mods (basic). This might be custom or using a library. Suggestions welcome.

Renan, for reference, I just saw an interesting CI setup related to our conversation. Admittedly it would be for a much later step in this process -> #1886 (comment)

@ajcwebdev
Copy link
Collaborator

The discussion for this has shifted to the forums for anyone tracking this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants