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

Run persistent mode tests in CI #15029

Merged
merged 9 commits into from
Mar 11, 2019

Conversation

acdlite
Copy link
Collaborator

@acdlite acdlite commented Mar 6, 2019

Based on #15013

Adds a command to run React Noop tests in persistent mode.

yarn test-persistent

This command will run in CI.

Includes a fix for a bug I found when running the tests.

@sizebot
Copy link

sizebot commented Mar 6, 2019

Details of bundled changes.

Comparing: 3f4852f...2cf0c14

react-native-renderer

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
ReactNativeRenderer-dev.js -0.0% -0.0% 616.51 KB 616.26 KB 131.84 KB 131.79 KB RN_FB_DEV
ReactNativeRenderer-profiling.js 0.0% 0.0% 251.7 KB 251.7 KB 44.27 KB 44.27 KB RN_FB_PROFILING
ReactNativeRenderer-dev.js -0.0% -0.0% 616.42 KB 616.18 KB 131.81 KB 131.75 KB RN_OSS_DEV
ReactFabric-dev.js -0.1% -0.1% 607.41 KB 606.69 KB 129.56 KB 129.46 KB RN_FB_DEV
ReactFabric-prod.js -0.1% -0.2% 239.75 KB 239.57 KB 41.79 KB 41.72 KB RN_FB_PROD
ReactFabric-profiling.js -0.1% -0.1% 245.07 KB 244.89 KB 43.15 KB 43.09 KB RN_FB_PROFILING
ReactFabric-dev.js -0.1% -0.1% 607.32 KB 606.6 KB 129.52 KB 129.42 KB RN_OSS_DEV
ReactFabric-prod.js -0.1% -0.2% 239.75 KB 239.57 KB 41.78 KB 41.71 KB RN_OSS_PROD
ReactFabric-profiling.js -0.1% -0.1% 245.08 KB 244.9 KB 43.15 KB 43.09 KB RN_OSS_PROFILING

react-noop-renderer

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-noop-renderer.development.js -2.9% -0.6% 25.95 KB 25.2 KB 6.18 KB 6.14 KB NODE_DEV
react-noop-renderer.production.min.js -3.3% -0.8% 9.53 KB 9.21 KB 3.07 KB 3.05 KB NODE_PROD
react-noop-renderer-persistent.development.js -2.9% -0.6% 26.07 KB 25.32 KB 6.19 KB 6.15 KB NODE_DEV
react-noop-renderer-persistent.production.min.js -3.3% -0.8% 9.55 KB 9.23 KB 3.08 KB 3.05 KB NODE_PROD
react-noop-renderer-server.development.js 0.0% -0.1% 1.83 KB 1.83 KB 877 B 876 B NODE_DEV

react-reconciler

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-reconciler.development.js -0.1% 0.0% 479.89 KB 479.57 KB 100.83 KB 100.84 KB NODE_DEV
react-reconciler.production.min.js -0.2% -0.1% 63.05 KB 62.95 KB 18.85 KB 18.83 KB NODE_PROD
react-reconciler-persistent.development.js -0.1% 0.0% 478.09 KB 477.77 KB 100.13 KB 100.13 KB NODE_DEV
react-reconciler-persistent.production.min.js -0.2% -0.1% 63.07 KB 62.96 KB 18.86 KB 18.84 KB NODE_PROD
react-reconciler-reflection.production.min.js 0.0% -0.1% 2.7 KB 2.7 KB 1.23 KB 1.22 KB NODE_PROD

Generated by 🚫 dangerJS

@acdlite acdlite force-pushed the run-persistent-tests-in-ci branch from 8472cbd to b69a2d7 Compare March 6, 2019 23:07
@@ -0,0 +1,7 @@
'use strict';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need both these identical files? setupPersistent and setupTests.persistent. What's the difference?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Idk I copy-pasted the other test entry points

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh no wait, that's a rename mistake. I'll delete whichever one is superfluous.

package.json Outdated
@@ -80,11 +81,11 @@
"rollup-plugin-replace": "^2.0.0",
"rollup-plugin-strip-banner": "^0.2.0",
"semver": "^5.5.0",
"shelljs": "^0.8.3",
Copy link
Collaborator

@sebmarkbage sebmarkbage Mar 9, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#carmackno We need fewer deps. This is unnecessarily complicated and slow.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I'll just delete that last commit then

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For context I would have just used exec or whatever but something something Windows contributors whatever I don't care enough it's CI anyway

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a bit of a last minute Friday drive-by review. The dependency is just one issue. The other issue is its reliance on file system information in general. We should leave that to jest since it's something that does a lot of complex work around invalidation, file watching, module resolution etc. It also fairly frequently changes.

So without this diff, it just runs more than it needs to on CI wasting cycles but should be equivalent otherwise?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah

Copy link
Collaborator

@sebmarkbage sebmarkbage left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we should monitor CI times after this and hope they're not too bad.

So we can run it in persistent mode, too.
We can't mutate the stateNode in appendAllChildren because the children
could be current.

This is a bit weird because now the child that we append is different
from the one on the fiber stateNode. I think this makes conceptual
sense, but I suspect this likely breaks an assumption in Fabric.

With this approach, we no longer need to clone to unhide the children,
so I removed those host config methods.

Fixes bug surfaced by fuzz tester. (The test case that failed was the
one that's already hard coded.)
Refs behave differently in persistent mode. I added a TODO to write
a persistent mode version of this test.
If a file doesn't reference react-noop-renderer, we shouldn't bother
running it in persistent mode, since the results will be identical to
the normal test run.
We don't need this now that we have the ability to run any test file in
either mutation or persistent mode.
Seb objected to adding shelljs as a dep and I'm too lazy to worry about
Windows support so whatever I'll just revert this.
@acdlite
Copy link
Collaborator Author

acdlite commented Mar 11, 2019

I don't think this will affect CI times because we have four parallel instances and I put this task in the one that previously ran the shortest. I was more interested in the time it takes to run test-persistent locally.

@acdlite
Copy link
Collaborator Author

acdlite commented Mar 11, 2019

Screen Shot 2019-03-11 at 10 54 59 AM

Persistent tests run in container 0, which is still not close to being the slowest one.

@acdlite acdlite merged commit bc8bd24 into facebook:master Mar 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants