Summary:
This diff cleans up some cruft and adds some features:
* It removes the usage of an env variable to control workers.
* It removes the lazy and handwavy calculation on how many workers to use for jest-haste-map. Jest itself uses the maximum amount of workers available and it has never been reported as an issue – especially since it is a one-time startup cost of about 3 seconds on a cold cache only.
* It adds a `--max-workers` flag to replace the env variable. This one is able to control both the number of workers for `jest-haste-map` as well as the transformers.
* It makes the transformers run in the parent process if 1 or fewer workers are are specified. This should help with debugging.
Once you approve this diff, I will publish a new version of metro to npm and update the version used in RN and remove the use of the env variable altogether: https://our.intern.facebook.com/intern/biggrep/?corpus=xplat&filename=&case=false&view=default&extre=&s=REACT_NATIVE_MAX_WORKERS&engine=apr_strmatch&context=false&filter[uninteresting]=false&filter[intern]=false&filter[test]=false&grep_regex=
Note: the process of adding a CLI option is really broken. Commander also has a weird API. We should consider building a better public API for Metro and then consider how to build a new CLI on top of it and simplify our internal integration. I really don't like how Metro is integrated across pieces of the RN cli in ways that is hard to manage. But that is a larger task for another time :)
Reviewed By: jeanlauliac
Differential Revision: D5217726
fbshipit-source-id: 74efddbb87755a9e744c816fbc62efa21f6a79bf
Summary:
Circle only runs the commands under "deployment" if all tests pass. As a result, website deploys tend to get blocked unnecessarily when Circle is red, even when the website has no issues.
As every command under "overrride" is run independently even if other commands fail, the result of this PR is that the website will be deployed on every Circle run on `master` or any of the `-stable` branches.
Note that the "deployment" section is only executed when Circle is run against the master/-stable branch, and Circle is configured to not run deployments on forks. Since "override" does not have these protections in place, I've added some guards to ensure that a web deploy only occurs on runs triggered by commits to master/-stable on the main `facebook/react-native` repo.
This PR assumes the following are correct:
- `CI_PULL_REQUEST` and `CIRCLE_PR_USERNAME` are only set when [run on a fork](https://circleci.com/docs/1.0/environment-variables/#building-pull-requests-that-come-from-forks).
- `CIRCLE_PROJECT_USERNAME ` is only set to "facebook" when the run is triggered by a commit on the main `facebook/react-native` repo, and not a fork.
* Configuring circle.yml: https://circleci.com/docs/1.0/configuration/
* Environment Variables: https://circleci.com/docs/1.0/environment-variables/
None, aside from checking that bash can handle these conditionals. We need to trial this on Circle. Great attention needs to be paid to the conditionals, to ensure we do not allow forks to deploy the official website. We also need to make sure we are not leaking the GitHub access token accidentally.
Closes https://github.com/facebook/react-native/pull/14310
Differential Revision: D5179748
Pulled By: hramos
fbshipit-source-id: 405963f7e3bf2c1969e3e9a282781ce72c04e2d7
Summary:
Motivation is that Circle e2e tests have been broken for a few days, it appears to be flaky and an ongoing problem. AaaChiuuu & Andrew Chen are taking a look, but for now let's turn this off so that Circle can be useful for other things.
Closes https://github.com/facebook/react-native/pull/13616
Differential Revision: D4931852
Pulled By: ericvicenti
fbshipit-source-id: ce725ff3311ea70052191df45d3feb4373176876
Summary:
Android instrumentation tests keep failing due to `java.lang.RuntimeException: java.lang.RuntimeException: Timed out waiting for JS thread`.
An [earlier job](https://circleci.com/gh/facebook/react-native/17064) based off commit [c31a65](c31a65669e) finished successfully, yet [this job](https://circleci.com/gh/facebook/react-native/17070), triggered by the very [next commit](e82c2fbbe5), failed Android instrumentation tests even though that commit touches no Android code.
You can see from the [Circle history](https://circleci.com/gh/facebook/react-native/tree/master) that this test has been consistently failing for the same time out reason.
I am disabling Android instrumentation tests as they are not providing any useful signal a this point in time.
Debug and fix instrumentation tests, and re-enable them.
Closes https://github.com/facebook/react-native/pull/13239
Differential Revision: D4810775
Pulled By: hramos
fbshipit-source-id: 8866f9208ec3b5ac5f0ed2f6c2cf58c5b5825830
Summary:
Disabled earlier today, a fix for HMR landed so let's test it works.
Closes https://github.com/facebook/react-native/pull/12943
Differential Revision: D4712940
Pulled By: jeanlauliac
fbshipit-source-id: 38cbfb04a0a16a0a59e8eb4c9c26adb60ab5d635
Summary:
So that Circle CI builds don't stress github API too much
Closes https://github.com/facebook/react-native/pull/11574
Differential Revision: D4538778
Pulled By: lacker
fbshipit-source-id: af80d13acf7d61c390848764d661a70db2ec961f
Summary:
Circle CI has an older m2repository version by default
Closes https://github.com/facebook/react-native/pull/11671
Differential Revision: D4372795
Pulled By: kentaromiura
fbshipit-source-id: ac563fe3825a57087fbf806c913383e1ade8535f
Summary:
We turned them off on Wednesday Dec 14 when both CIs were busted. Once Circle runs on this PR it'll demonstrate they are functional again.
Closes https://github.com/facebook/react-native/pull/11547
Differential Revision: D4364177
Pulled By: hramos
fbshipit-source-id: 8a3b24a2795d0fcf4255cb3174acedc10ff6fbe7
Summary:
Boost is officially hosted on SourceForge which has ab SSL problem that Gradle complains about and also it is sometimes unavailable.
I switched to using npm hosted (yarnpkg mirrored for performance) boost lib exactly the same as from Source Forge.
Other alternatives considered:
- CDN e.g. mirror.nienbo.com started responding with 4XX code when requested by Gradle
- File sharing like DropBox are not for mass anonymous downloads
- Github is not good for binary files and is throttled for anonymous raw file downloads
- S3 or similar. Requires amazon account for maintenance and does not expose semver API and other nice features that npm has
In the future I'd like to try Yarn as dependency management tool for bridge builds, this could be the first step.
**Test plan (required)**
- Circle (testing with caches cleaned)
- `./gradlew ReactAndroid:packageReactNdkLibsForBuck` (check twice to make sure caches work)
- `REACT_NATIVE_BOOST_PATH=./bridge-dependencies/node_modules/boost-react-native-bundle ./
Closes https://github.com/facebook/react-native/pull/11469
Differential Revision: D4339446
Pulled By: mkonicek
fbshipit-source-id: ccc9196e9b675c16a235a318c4861aaa4e263d6e
Summary:
This PR attempts to fix the iOS tests by fixing a flag in the e2e tests, and "fix" the Android tests by commenting out the e2e test. I propose that if these fix the tests, we accept them, and then follow up attempting to fix the Android e2e tests for real afterwards.
Closes https://github.com/facebook/react-native/pull/11466
Differential Revision: D4328304
Pulled By: mkonicek
fbshipit-source-id: 3c497921ea0359bed633c7bd390495046634c123
Summary:
This should stop Circle CI from crashing.
Let's wait for the test to pass.
cc davidaurelio matryoshcow mkonicek
Closes https://github.com/facebook/react-native/pull/10962
Differential Revision: D4186949
Pulled By: kentaromiura
fbshipit-source-id: 2542376a6e4bf0d7dc423c574bd4573ae9bdfc96
Summary:
Circle CI is failing sometimes on the `buck && ant` task with a `Require JDK 8 or higher` error.
**Test plan (required)**
Make sure tests pass on Circle CI.
Closes https://github.com/facebook/react-native/pull/10390
Differential Revision: D4021546
Pulled By: bestander
fbshipit-source-id: 355657936bf90e70a10df418b378ad07978c0e5e
Summary:
(I changed a ton from when I previously submitted this PR so please take another look if you already did.)
PROBLEM: the no-longer-maintained `esprima-fb` parser does not support class properties, leading our website docgen to die if we use class properties, which we're gonna do real soon now
SOLUTION: use `flow-parser` instead, which the flow team is maintaining including all the fancy-pants ES? stuff that FB uses internally.
This removes the `esprima-fb` parser from jsdocs and replaces it with `flow-parser`. It's almost the same, I checked by diffing all the parser json output and it only had a few irrelevant differences. I had to add a file of constants so that we could remove esprima-fb altogether, too.
This also adds a couple unit tests, so that we can test that jsDocs works programmatically. They don't run if you run the regular RN tests, you have to run `npm test` from the `/website/` subdirectory.
Closes https://github.com/facebook/react-native/pull/9890
Differential Revision: D3865629
Pulled By: bestander
fbshipit-source-id: 8f561b78ca4a02f3f7b45e55904ec2fa911e3bb6
Summary:
This is a temporary patch because gradle builds are not properly cached
Closes https://github.com/facebook/react-native/pull/8274
Differential Revision: D3462705
fbshipit-source-id: 1873904873dec36a42405b9cf37def521552ee8b
Summary:
- TestIdTestModule instrumentation tests is responsible for too many occasional crashes, e.g. https://circleci.com/gh/facebook/react-native/7054.
This should fix the problem (will monitor over next week)
- Made file naming more consistent
- 5 retries don't make e2e tests more stable, reduced back to 3 but I need to investigate how to make it more reliable
Closes https://github.com/facebook/react-native/pull/7784
Differential Revision: D3354444
fbshipit-source-id: d058362edbec09522a4828998e01988a82a74487
Summary:
Travis CI runs Node 4 (LTS), so make CircleCI run Node `<latest>` which is Node 6.
Closes https://github.com/facebook/react-native/pull/7542
Differential Revision: D3334397
fbshipit-source-id: 15a758011626fca4efdc4c1b36891a4d73c52e94
Summary:
This change makes all instrumentation tests to be executed in sequence in independent retriable processes.
With a new test being open sourced recently our CI stability degraded.
This PR should bring back stability because tests won't affect each other and will have shorter lifetime
Closes https://github.com/facebook/react-native/pull/7353
Differential Revision: D3259081
fb-gh-sync-id: 48ccdb5dbd561d416526497ff474378db9ca3c60
fbshipit-source-id: 48ccdb5dbd561d416526497ff474378db9ca3c60
Summary:Implemented smarter retries for e2e tests
E2e tests consist of two expensive and flaky steps: npm installation and tests execution.
Our CI is configured to retry a command 3 times before terminating the test.
In current setup if one of the steps fail the whole test is restarted.
This change adds ad-hoc ability to retry flaky bits of e2e script independently.
This will make tests fail faster when code gets broken while increasing the chances to succeed in case of random false errors.
Closes https://github.com/facebook/react-native/pull/7184
Differential Revision: D3218927
fb-gh-sync-id: 9be8343484bb28aa3601b651db70fc55aa840e61
fbshipit-source-id: 9be8343484bb28aa3601b651db70fc55aa840e61
Summary:- converted shell script `scripts/e2e-test.sh` into JS script to have more programming flexibility
- using appium execute 2 tests after a fresh React Native app installation: check HMR and that debugging mode does not crash the app
- made sure tests can be stable on limited CI systems and added ways to debug any problems in the future
Using appium we can now interact with Android app and test its state.
As a follow up i am planning to write a blog post on how to use appium with android and ios for e2e testing.
Closes https://github.com/facebook/react-native/pull/6840
Differential Revision: D3173635
Pulled By: mkonicek
fb-gh-sync-id: 3cf044bc9f64d1a842ae4589dd1bcab76de3d66a
fbshipit-source-id: 3cf044bc9f64d1a842ae4589dd1bcab76de3d66a
Summary:BUCK is faster than Gradle.
For example `gradle app:installDebug` vs `buck install app` is ~7 seconds vs ~2 seconds with warm caches.
This is just the beginning to allow people to become familiar with BUCK.
It is enough for running the app locally and testing on a device.
Gradle is still used for dependency resolution.
Closes https://github.com/facebook/react-native/pull/6733
Differential Revision: D3126328
Pulled By: bestander
fb-gh-sync-id: 56aad276036c029af7e0e23d60c46ba2f77b3d2c
fbshipit-source-id: 56aad276036c029af7e0e23d60c46ba2f77b3d2c
Summary:- lint bot is now managed by Circle CI
- checked that flow and lint errors are caught both by bot and CI
- flow fix for npm 3
- Travis is now using npm 2 and Circle CI npm 3
- Refactored Travis script to be able to be able to fail on multiple lines
Closes https://github.com/facebook/react-native/pull/6508
Differential Revision: D3069500
Pulled By: davidaurelio
fb-gh-sync-id: 02772bf1eae5f2c44489c2e3a01899428a9640cb
shipit-source-id: 02772bf1eae5f2c44489c2e3a01899428a9640cb
Summary:This work allows automated release deployment.
Previous semi-automation lived in release.sh and I split it into two pieces:
- test-manual-e2e.sh - that just tests that current commit is buildable and makes a quick e2e installation for manual testing
- publish-npm.js - that makes publish based on what current branch and tags are on commit that is tested/deployed by CI
This simplified `Releases.md` guide and requires you to just run
```
git checkout -b 0.22-stable
git tag v0.22.0-rc
git push origin 0.22-stable --tags
```
to have a successful npm release.
Closes https://github.com/facebook/react-native/pull/6453
Reviewed By: mkonicek
Differential Revision: D3047938
Pulled By: bestander
fb-gh-sync-id: dbebf4c3a0bc2c2a0ef75c54595ab5654f91b8ea
shipit-source-id: dbebf4c3a0bc2c2a0ef75c54595ab5654f91b8ea
Summary:Running CI tests with emulator, not a graddle wrapper.
This should make things faster
Closes https://github.com/facebook/react-native/pull/6421
Differential Revision: D3042505
fb-gh-sync-id: 455264f90044c22ed3ec8cf9cb6d5edc2efedcdb
shipit-source-id: 455264f90044c22ed3ec8cf9cb6d5edc2efedcdb
Summary:Motivation: Catch packager breakages (such as bad shrinkwrap, package.json) quickly and reliably. This is also done as part of the e2e test on Travis. Having an isolated packager test as well makes it easier to see there's a problem with the packager, running in on CircleCI helps detect issues even if the Travis e2e test gets ever broken (have some redundancy, these breakages are pretty painful to fix so we want to detect them as reliably as possible).
**Test plan (required)**
Ran this locally:
git checkout master
./scripts/e2e-test.sh --packager # The packager created the bundle, exit code was 0
# Made the packager fail on bad JS
./scripts/e2e-test.sh --packager # Exit code was 1
Closes https://github.com/facebook/react-native/pull/6294
Differential Revision: D3011910
fb-gh-sync-id: 20e8eb29f6aeb3a494a7ef1dbf9cb08fa4e18e27
shipit-source-id: 20e8eb29f6aeb3a494a7ef1dbf9cb08fa4e18e27
Summary:Merged Travis js tests into one test run.
This should simplify test runs, reduce chances of external infra failures and make CI reports more focused.
**Test plan (required)**
See how travis runs it.
Need to double check that APPETIZE_TOKEN and S3_TOKEN aren't used.
Closes https://github.com/facebook/react-native/pull/6172
Differential Revision: D3001437
fb-gh-sync-id: 203e18ce0706d4ab1ab55cfe016beed3e3558dcc
shipit-source-id: 203e18ce0706d4ab1ab55cfe016beed3e3558dcc
Summary:Added ability to run instrumentation tests with BUCK.
This change uses BUCK to build and run instrumentation tests facebook style.
The gains are that we can execute the same tests internally at FB and in OSS.
Also running tests not via graddle:connect command is 1.5 minutes faster.
I'll keep keep an eye on stability Gradle and BUCK builds for a while.
Closes https://github.com/facebook/react-native/pull/6176
Differential Revision: D2999878
Pulled By: bestander
fb-gh-sync-id: d715ba231769e57100685a1256f2e530c589921c
shipit-source-id: d715ba231769e57100685a1256f2e530c589921c