Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49102
Moves this script one level up. In the next diff, will be used to support execution of scripts themselves, as well as `packages/`.
Changelog: [Internal]
Reviewed By: cipolleschi
Differential Revision: D68960279
fbshipit-source-id: 7b62420c269dc1c1366ac9a827db078d34cb86c5
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49008
Changelog: [internal]
We're modifying some core APIs in the RN render in following diffs, so this adds a simple benchmark as a safety mechanism to verify those don't regress performance significantly.
Reviewed By: yungsters
Differential Revision: D68772175
fbshipit-source-id: 3bc446e68495dc04590b613297baa00589fb5f8d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48882
Changelog: [internal]
The current hint for benchmarks is that the test body contains `unstable_benchmark` calls, but some benchmarks that need to use feature flags define their test bodies in a separate file, so the file containing the call to `unstable_benchmark` isn't the `-itest.js` one.
This adds a new hint to opt into optimized builds that uses the name of the test instead of its contents. If it contains `-benchmark` then we consider it a benchmark and do the opt in.
Reviewed By: andrewdacenko
Differential Revision: D68102300
fbshipit-source-id: 4c0909969f76b8a7d563959cccf686aefaef700d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48570
Changelog: [internal]
We're still iterating on this feature and making sure it reports stable results, so marking it as `unstable` to set expectations.
Reviewed By: andrewdacenko
Differential Revision: D67975844
fbshipit-source-id: 41e93cb9cb0c887a96178e4a4d5078d1899b2478
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48451
Changelog: [internal]
Modifies the execution of benchmarks in CI to run benchmarks in test mode when they don't define a `verify` method.
If a benchmark uses `verify`, the test is meant to make sure that the benchmark doesn't regress in CI. If it doesn't, then running the benchmark on CI doesn't provide much value. In that case, we run a single iteration of each test case just to make sure things don't break over time.
Reviewed By: rshest
Differential Revision: D67637754
fbshipit-source-id: 33b78a9c809386cf2e040314b0427de6a53da3e3
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48452
Changelog: [internal]
Implements a basic API to run benchmarks with Fantom (using `tinybench` under the hood):
```
import {benchmark} from 'react-native/fantom';
benchmark
.suite('Suite name', {
// options
})
.add(
'Test name',
() => {
// code to benchmark
},
{
beforeAll: () => {},
beforeEach: () => {},
afterEach: () => {},
afterAll: () => {},
},
)
.verify(results => {
// check results and throw an error if the expectations fail
});
```
Features:
* Print benchmark results in the console as a table.
* It opts into optimized builds automatically
* Verifies that optimized build is used (unless manually opting out of the check via `disableOptimizedBuildCheck`).
* Supports verification of results (making expectations and making the test fail if the benchmark doesn't meet some expectations).
Reviewed By: rshest
Differential Revision: D66926183
fbshipit-source-id: 61cfa7689ea7684eb870fbbc815b8d236a1871e6
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48440
Changelog: [internal]
Modifies the Fantom runner to read 2 new environment variables to help with debugging:
- `FANTOM_PRINT_OUTPUT`: prints the output of the CLI to the output of the test.
- `FANTOM_LOG_COMMANDS`: logs the buck commands executed by the runner, so they can be re-run outside the runner for debugging, etc.
Reviewed By: rshest
Differential Revision: D67682750
fbshipit-source-id: aff48c4f47078db1be53e0ee105089fbc921768f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48372
Changelog: [internal]
Implements log streaming in Fantom tests. This allows us to see the logs emitted from tests as they're logged, so we don't need to wait until the test completes to flush all of them at the same time.
Reviewed By: rshest
Differential Revision: D67600609
fbshipit-source-id: efb3125e13fd9aec1800a5f1ddaf0d93dcb29218
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48371
Changelog: [internal]
Adds a new favor for `runCommand` and `runBuck2` that works asynchronously and support parsing their output in real time.
Reviewed By: javache
Differential Revision: D67600614
fbshipit-source-id: 99dd2ce9bff11036829f214bf19208b10c9c1b25
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48369
Changelog: [internal]
This improves logs in Fantom by preserving the original log levels. It's also in preparation for adding support for log streaming in tests.
Reviewed By: javache
Differential Revision: D67600616
fbshipit-source-id: 1c4997d5e836a78327f33092527543fe025c90c6
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48367
Changelog: [internal]
We removed the calls to `AppRegistry` in Fantom, so this filter isn't necessary anymore (just a no-op).
Reviewed By: rshest
Differential Revision: D67600610
fbshipit-source-id: d985cc5f0ee1728ac72c567bc091a6c2877f2659
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48307
Changelog:
[General][Fixed] - Fix a bug when fantom tests could not be run in parallel, e.g. in a stress-test.
Reviewed By: rubennorte, danalex97
Differential Revision: D67334828
fbshipit-source-id: 3db18f6a100925480dbf8385f9ea414187406f4a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48263
Changelog: [internal]
Customize log level in Fantom based on flag in runner.js.
Reviewed By: javache
Differential Revision: D67199970
fbshipit-source-id: 31cdd2eaeee8e7ab4c8985661b35822d78d0457b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48222
Changelog: [internal]
Tiny improvement over the current setup so it might help detect some current issues.
Reviewed By: yungsters
Differential Revision: D67021976
fbshipit-source-id: 7829f2ea0d839178f1a50d176b42dc0906c2e585
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48029
Changelog: [Internal]
Adding snapshot support for rendered output only for now.
This will only work if snapshot is created beforehand by hand.
# Next steps
* Create snapshot when no prior snapshot is available
* Pass and update if instructed
Reviewed By: christophpurrer
Differential Revision: D66601387
fbshipit-source-id: fe528cded43c5ba36d314bd9af8e3fb84b98ac3e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48178
Changelog: [internal]
Adds a new mode for Fantom to run tests with dev-mode bytecode. Right now the modes were only dev (development with source code) or opt (optimized bytecode).
Reviewed By: rshest
Differential Revision: D66888986
fbshipit-source-id: 34b2566a65d138790e16f8fb5787fd9c2bcde536
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48179
Changelog: [internal]
Migrating this type to an enum, which is safer, because it prevents errors like:
```
// when it's actually 'dev'
if (mode === 'development') {
}
```
Reviewed By: rshest
Differential Revision: D66888985
fbshipit-source-id: 4f3f91fad6ca5256baa2123425b2bad11fe036f9
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48150
Changelog: [internal]
We're starting to have some Fantom tests that run in optimized mode, but we're not currently prewarming for that case. This adds that capability to do proper attribution of run time for tests.
Reviewed By: javache
Differential Revision: D66877991
fbshipit-source-id: dccb80cd6a4f664de7df0661456bad78d960826d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48143
Changelog: [internal]
Just a small cleanup to move `jest/integration/*` to `packages/react-native-fantom`, so everything related to Fantom (config, runner, runtime, etc.) is in the same directory.
Reviewed By: javache
Differential Revision: D66874763
fbshipit-source-id: 8b87d7320c7704f7ce6cd58761508193784f5ce2