Repository navigation
Run ReactCommon C++ unit tests in GitHub CI - #59802
Conversation
4b836e7 to
1f264e7
Compare
| @@ -0,0 +1,45 @@ | |||
| name: Test ReactCommon C++ | |||
There was a problem hiding this comment.
can we have a reusable workflow rather than a reusable action? It's much easier to maintain. Also, if it is only used in test-all, can we just put the workflow there instead of splitting it in two places?
There was a problem hiding this comment.
Yeah it's semantically part of test-all, which is getting long at this point. For now I'll move this inline so we have less files to look at, at least (although I believe reusable actions are a fair pattern). The scope of this test suite is a single job in this workflow, IMO.
I'm certainly keen, after this, that we do another pass over all GHA files to simplify. But that goes beyond the initial scope here.
|
@cortinico has imported this pull request. If you are a Meta employee, you can view this in D129898681. |
|
@cipolleschi Can I get signal on what is failing internally here? |
|
Seems like an internal issue. We have a few issues going on now. I'll let you know in a moment. I'm rebasing the PR. EDIT: seems to be landing now. |
|
This pull request was successfully merged by @huntie in 6990b94 When will my fix make it into a release? | How to file a pick request? |
Summary
The C++ unit tests under
packages/react-native/ReactCommon/**/testsrun only inside Meta, under Buck. Public CI has no build for them, so a change that breaks one passes every GitHub check and fails only after import, as happened with #59686.This adds a
test_react_common_cxxjob toTest Allthat builds and runs them on Linux, reusing the Fantom tester's CMake build, which already compiles every ReactCommon library with folly, Hermes and codegen.Changes
private/react-native-fantom/tester/react-common-tests/: one GoogleTest executable pertestsdirectory (38 today), linked against the librariesfantom_testerlinks. Each test case is registered with CTest throughgtest_discover_tests, so it runs in its own process.:private:react-native-fantom:testReactCommon, which builds them and runsctest. GoogleTest 1.18.0 is downloaded like the Fantom tester's other dependencies.test_react_common_cxxjob totest-all.yml, mirroringbuild_fantom_runneron the same container and runner. It adds no ccache steps: in this container compiles do not go through ccache, andbuild_fantom_runneronmainreports 0 hits and 0 misses.Notes
jsinspector-modern/testsfail in OSS on macOS and Linux alike, and are excluded by name in the CMake file (see Test Plan).std::source_locationand parenthesised aggregate initialisation.jsinspector-modern/tests,TracingTestfails when run after the other suites in one process, and passes on its own.-Wno-error, since the header-only ReactCommon libraries export-Werror -Wpedanticand a few tests call deprecated APIs.benchmarks/directories are left out, as they need Google Benchmark.Changelog: [Internal]
Test Plan
On macOS (Apple clang 21, CMake 3.30.5 from the Android SDK, JDK 17):
All 38 test executables build, and 1522 test cases pass, one of which skips itself (
ReactInstanceTest.testRegistersRuntimeSchedulerAsEventLoopControl: this Hermes build has noISetEventLoopControl).Before the exclusions, 1525 cases ran and these 3 failed, with the same result on macOS and in this job on Linux:
JsiIntegrationHermesTest.ResolveColumnlessBreakpointAfterEval:Debugger.setBreakpointByUrlreturns nolocations.JsiIntegrationHermesTest.ResolveColumnlessBreakpointAfterReload: the same.JsiIntegrationHermesTest.TwoConnectionsDebuggerLifecycle: the second session gets noDebugger.scriptParsedafter the first disablesDebugger.test_react_common_cxxon this PR: passed in 14m15s, with all 1522 tests passing. Running them takes 30 seconds of that; the rest is the build.