Add tests for out-of-tree platform support#20932
Add tests for out-of-tree platform support#20932empyrical wants to merge 4 commits intofacebook:masterfrom
Conversation
Generated by 🚫 dangerJS |
|
Yep, still the same issue: ( Will have to come up with a way to fix this. |
ad3c448 to
76a7fec
Compare
|
The dummy platform has been moved to its own module/repo, and tests look much better now! https://github.com/react-native-community/react-native-dummy |
|
test_android failure is unrelated. again. |
76a7fec to
861217c
Compare
|
Rebased against master and things look better 👌 |
facebook-github-bot
left a comment
There was a problem hiding this comment.
hramos is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
|
I tried to merge this pull request into the Facebook internal repo but some checks failed. To unblock yourself please check the following: Does this pull request pass all open source tests on GitHub? If not please fix those. Does the code still apply cleanly on top of GitHub master? If not can please rebase. In all other cases this means some internal test failed, for example a part of a fb app won't work with this pull request. I've added the Import Failed label to this pull request so it is easy for someone at fb to find the pull request and check what failed. If you don't see anyone comment in a few days feel free to comment mentioning one of the core contributors to the project so they get a notification. |
|
Not sure what it got caught on |
|
Re-trying. |
|
@empyrical the internal diff is failing JavaScript tests: |
|
Very weird that it is working in OSS but not internally. Since |
|
Or -- would adding the changed |
|
I did have to take care of that internally, since we have an offline yarn mirror. Let me re-import, as the internal diff might be out of date. |
facebook-github-bot
left a comment
There was a problem hiding this comment.
hramos has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
|
I am still working on this. Will update soon. |
|
I'm at a loss. Jest is still failing the new test case when run internally: |
|
So, the reason that test would fail is because react-native/jest/hasteImpl.js Lines 16 to 26 in f5dd2c4 In If you were to have a |
|
A-ha! We're using Yarn Plug-n-Play, so I'm aware of an alternate way to detect if a test is running within our internal CI. I am not sure if it's something that would be OK to include in open source, but regardless, it looks like we'd need to solve not having |
|
The way that react-native/local-cli/core/findPlugins.js Lines 104 to 111 in 4b106be It looks like RNPM will need to be adapted to work with Yarn Plug 'n Play. For now, perhaps this test could somehow be skipped on the internal test suite until YPNP is made public? |
|
Actually - perhaps I could modify the test to skip itself if the |
|
@hramos I modified the |
|
Sorry for the delay. I just incorporated your updates into the internal diff. Will merge if tests pass. Thanks! |
|
@empyrical merged commit 57041ee into Once this commit is added to a release, you will see the corresponding version tag below the description at 57041ee. If the commit has a single |
Summary: This PR is a WIP for adding tests for out-of-tree platform support. [I originally had issues](facebook#20825 (comment)) with this, so I want to give it a try in a separate pull request. None of these issues appear on my machine while running these tests as of this rebase - if everything seems okay on CircleCI after this rebase against `master`, I will ditch the [WIP] tag. Otherwise, I will see if I can find a way to make this work. The bunch of JS files that will give this a "Large PR" tag are in `RNTester/js/OutOfTreeTestPlatform` - they are only used by the bundler and not executed at any point in time. So if another file needs to be added when React Native's module structure changes, you do not need to have a functional JS file in there as a stub. `module.exports` could be `null` if you wanted. I just had copied over stubs from `Libraries` because I wanted a non-trivial haste module map to be in the test. Pull Request resolved: facebook#20932 Reviewed By: axe-fb Differential Revision: D9818112 Pulled By: hramos fbshipit-source-id: 0b53359b84430fdefb972587c95d19f85773c5fa
This PR adds tests for out-of-tree platform support.
A new test has been added to
hasteImpl-test.jswhich both verifies the ability offindPluginsto find out of tree platforms, and the ability ofhasteImplto add relevant whitelists and name reducers for out of tree platforms.Test Plan:
A test has been added to
hasteImpl.js's test, so you can try it out by runningyarn test. I've added an e2e test for running the bundler on this "dummy" platform.Release Notes:
[CLI] [ENHANCEMENT] [jest/hasteImpl.js] The hasteImpl is now aware of whether it's in React Native CI, and will change where it looks for "plugins" accordingly
[CLI] [ENHANCEMENT] [jest/tests/hasteImpl-test.js] hasteImpl.js' plugin support is tested
[INTERNAL] [ENHANCEMENT] [ContainerShip/scripts/run-ci-e2e-tests.sh] Bundling the "dummy" platform is now part of the E2E test
[INTERNAL] [ENHANCEMENT] [package.json] The "dummy" platform has been added as a devDependency