Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48022
Changelog: [internal]
This adds support for Fantom options in tests to configure different aspects of the test execution.
For now, it only supports specifying the mode (dev or opt) so we can try things without having to change the runner (watch mode still works if you change mode :D).
Fantom options are specified as pragmas in the docblock of the test. E.g.:
```
/**
* flow strict-local
* format
* fantom_mode opt
*/
```
We expect this is mostly going to be used for one-time tests and that regular tests won't specify the mode (they'll just run in dev mode).
Maybe we can evolve this in the future to specify that you want a test to be executed in both modes, to ensure the behavior is consistent in dev/prod.
Reviewed By: rshest
Differential Revision: D66597626
fbshipit-source-id: b12325fc2235740cc2a3e0283d6a556091c1794c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48015
Changelog: [internal]
Right now, when we run individual Fantom tests, we compile Hermes and the RN Tester CLI as part of the test, which causes the first test to run to be very slow and the remaining tests in the same run to be very fast.
This is misleading because it makes it look like the test itself is slow, when it's actually paying a price for everyone.
Fortunately, Jest has an option to do a global setup before any tests in the project run (and it doesn't run if none of the tests in the project run, in multi-project setups), so we can use it to do the necessary warmup so it doesn't end up being attributed to individual tests.
Reviewed By: javache
Differential Revision: D66595406
fbshipit-source-id: 496aa2b248da661f7504c8445fed1edad0301803
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48014
Changelog: [internal]
Just a small refactor in preparation for a following change that will add more usages for these utilities. It also cleans up the runner file which is good too.
Reviewed By: javache
Differential Revision: D66595405
fbshipit-source-id: e734d76006ce937fadd1cb673035db85a3e838dd
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48006
Changelog: [internal]
This implements symbolication of error stack traces in Fantom tests. We just needed to ask Metro to generate source maps and use the `source-map` package to process the stack traces that we get back from the runtime.
Reviewed By: sammy-SC
Differential Revision: D66577818
fbshipit-source-id: 672c66c246ad8646646d5ed31cabca39eb4f7aca
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47870
Changelog: [internal]
This flag allows us to run optimized mode by using the right buck modes for the Fantom CLI, using minified + dev in Metro and building bytecode using Buck as well.
It's disabled by default but in the future we can enable it based on the configuration in the test file (e.g.: if it's a benchmark) or we can run tests in both modes by default to catch problems caused by the differences between environments.
Reviewed By: rshest
Differential Revision: D66292709
fbshipit-source-id: d25294b739ff6a67507990241784b838d5b30dcd
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47758
Changelog: [internal]
This helps with debugging when adding logs in native code. By default they're logged to stderr and not shown in the Jest output, but we can opt into getting them with this new flag.
Reviewed By: sammy-SC
Differential Revision: D66232572
fbshipit-source-id: d507fa4438ae46988fafc92123d0954ab3d27631
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47658
Changelog: [internal]
AppRegistry logs are showing up again in Fantom because we changed the order and now they're not necessarily showing up last.
This fixes that by filtering them out in any position.
Reviewed By: sammy-SC
Differential Revision: D66094274
fbshipit-source-id: bd37394252ee6309f7093567f9a2b73b641938ce
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47612
Changelog: [internal]
Just using babel-register so we can use Flow types in the code for the RN integration tests runner.
Reviewed By: sammy-SC
Differential Revision: D65948801
fbshipit-source-id: 6c54b0463fe4b71c818ff1c4faa973cc8b13b5d2