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

🧹 Get long-running tests clean #91

Open
GantMan opened this issue Oct 11, 2018 · 9 comments
Open

🧹 Get long-running tests clean #91

GantMan opened this issue Oct 11, 2018 · 9 comments
Labels
help wanted Extra attention is needed

Comments

@GantMan
Copy link
Owner

GantMan commented Oct 11, 2018

Looks like 3 React failures and 1 react-native failure.

yarn test:all is currently failing with such:

image

@GantMan GantMan added help wanted Extra attention is needed hacktoberfest-accepted Good for October credit in Hacktoberfest labels Oct 11, 2018
@tudorpavel
Copy link
Contributor

@GantMan I took this one, but I only managed to fix the React examples. I couldn't run the React Native examples properly in order to see what fails. I tried executing the same commands from test_react_native_directory.js:

$ react-native build
Scanning folders for symlinks in /home/me/workspace/ReactStateMuseum/ReactNative/ApolloLinkState/node_modules (18ms)

  Unrecognized command 'build'
  Run react-native --help to see list of all available commands

Happy Hacktoberfest!

P.S. I ran out of space on disk when first running the exhaustive tests. 😅 I think it uses > 10GB of space for all the dependencies of all the examples. What do you think about adjusting the test scripts to clean up each example after running it?

P.P.S. Since most of the examples reuse the same setup (such as create-react-app), I was wondering if it wouldn't be a good use for Yarn Workspaces. What do you think?

@GantMan
Copy link
Owner Author

GantMan commented Oct 14, 2018

I ❤️the idea of cleanup as you go! I've never used Yarn Workspaces but that sounds great, too!

Feel free to create the ticket and I'll assign it to you. Happy Hacktoberfest!

@GantMan GantMan removed the hacktoberfest-accepted Good for October credit in Hacktoberfest label Nov 3, 2018
@tudorpavel
Copy link
Contributor

tudorpavel commented Oct 17, 2019

@GantMan it's already been 1 year. 😮

I took the opportunity of a new Hacktoberfest to implement my proposal from last year with "cleanup as you go".

Also, while working on this, I noticed some examples are not passing. I will try to fix them in a separate PR.

@tudorpavel
Copy link
Contributor

Okay, so I analyzed the failing examples.

All the failing React examples are failing because of missing tests:

  • overmind
  • react-recomponent
  • react-recontext
  • redux-and-context
  • reim
  • undux

An easy solution would be to drop the yarn test check from the exhaustive test suite. Otherwise, it should be mandatory to provide some tests when implementing new examples. Or it could be mandatory to use create-react-app for project setup in all examples.

All the failing React Native examples are failing because they use Expo and don't have the file structure which the tests expect:

  • immer
  • pure-store
  • simple-remx

I'm not sure what the solution is in this case. I guess all examples should follow a standard project setup, but which one?

@GantMan
Copy link
Owner Author

GantMan commented Oct 19, 2019

We can add test scripts to those projects that return true. I wouldn't mind that.

Then we could tie everything with CI.

@tudorpavel
Copy link
Contributor

We can add test scripts to those projects that return true. I wouldn't mind that.

Yep, that sounds good for the web React examples. I'll start working on that.

How about the React Native examples? The test suite for React Native makes a few more assumptions about the file structure.

@GantMan
Copy link
Owner Author

GantMan commented Oct 19, 2019

my guess is we'll have to make the tests detect if they are expo or not. No other way other than full conversions.

@tudorpavel
Copy link
Contributor

Then we could tie everything with CI.

Regarding CI, it would be nice to integrate the exhaustive test suite to run on every PR but it currently takes maybe too long to run. On my (albeit slow) machine just running the web React examples takes about 16 minutes.

I have one idea I want to explore that might speed up the suite a bit: sharing dependencies between each example app by running yarn install --modules-folder ../shared_node_modules. This might speed up each yarn install if some dependency versions are the same across multiple example apps. But if they are very different, it will just use up a lot of disk space. I'll let you know how it goes.

@tudorpavel
Copy link
Contributor

Just to follow up on my previous comment, my idea didn't pan out. I don't think yarn likes to share node_modules like that and will clean the folder. Maybe there's another way to share dependencies, but I'm still not sure it would speed up the tests all that much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants