fix: Make runtime tests pass in the whole Debug/Release × BundleMode/LegacyEval matrix#9931
Open
tjzel wants to merge 2 commits into
Open
fix: Make runtime tests pass in the whole Debug/Release × BundleMode/LegacyEval matrix#9931tjzel wants to merge 2 commits into
tjzel wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
This PR description was AI-generated.
Stacked on #9930. Part 5 of the runtime-tests spec.
Summary
I made the runtime tests run and pass in all four configurations — Debug and Release builds, each in Bundle Mode and Legacy Eval Mode — and fixed every failing test found along the way. Note that
apps/fabric-exampleships with Bundle Mode on by default;yarn toggle-bundle-modeswitches to Legacy Eval Mode.Release configuration. I added a
ReleaseRuntimeTestsbuild configuration (via the Xcodeproj API — hand-edited pbxproj blocks get dropped whenpod installre-serializes the project). The React Native bundle phase now embeds two Hermes bundles for*RuntimeTestsconfigurations —main.runtimeTests.reanimated.jsbundleandmain.runtimeTests.worklets.jsbundle(onereact-native-xcode.shinvocation per entry withENTRY_FILE/BUNDLE_NAME) — and the AppDelegate loads the right one from theRUNTIME_TESTS_LIBRARYlaunch environment variable. The server skips Metro entirely for Release configurations (--configuration ReleaseRuntimeTests) and listens on 8082, matching the app's no-Metro WebSocket fallback.Bundle/Legacy matrix support. The server-spawned Metro now always starts with
--reset-cache— a cache produced under the other Bundle Mode setting serves stale module maps ("Requiring unknown module"). Thebundle mode coresuite was silently never running: itsdisabledflag readglobalThis._WORKLETS_BUNDLE_MODE_ENABLEDat module scope, which races module initialization under inline requires — it now callsisBundleModeEnabled(), which forcesreact-native-workletsto initialize first. I also added--include <suites>to the server/runner protocol so CI can optskipByDefaultsuites (likebundle mode core) into a run.Test fixes (all previously failing or mode-dependent):
toThrownow captures theErrorUtilsglobal handler for the duration of the asserted function (with a bounded grace period), so errors that Worklets reports asynchronously viareportFatalError— therunOnUISyncpath — are seen by the matcher regardless of which handler (LogBox, remote reporter) is installed around the run. This fixesthrows when trying to serialize a Promise.createSerializableHostObjectand theisSerializableRefhost-object test usedglobalThis.__reanimatedModuleProxyas their host-object specimen — a hidden Reanimated dependency in Worklets tests, exposed by the isolation work in feat: CLI runner for runtime tests, one library at a time #9930. They now use__workletsModuleProxy.createSerializableOnUIInaccessibleObject: in Debug the unsupported value comes back as a placeholder that throws on access; in ReleaserunOnUISyncthrows synchronously during copy-back. TherunOnUISynccall now lives inside the asserted function so both channels land in the matcher.'Promise').processColor(nohwb()support) in feat: CLI runner for runtime tests, one library at a time #9930's color-utils split; it now lazy-requires Reanimated'sisColor/processColor(color comparisons only happen in Reanimated tests, so Worklets isolation is preserved). Formatting-only helpers keep the RN-based implementation.formatTestNamenow replaces every occurrence of a placeholder, fixing test names like… → ${finalColor}.Test plan
Full matrix on iPhone 17 Pro simulator via
yarn runtime-tests:bundle mode corevia--include: 8 passed, 0 failed)createSerializableOnUIInaccessibleObject, fixed aboveCounts differ across cells because
__DEV__-guarded suites are excluded in Release and!bundleMode-gated plugin tests only run in Legacy mode.yarn type:check:nativeinapps/common-apppasses.