Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
354432e
fix(test): fix integration tests js app problems due to ES exports
artus9033 Sep 11, 2025
b8a93db
fix(test): fix unit tests compilation errors
artus9033 Sep 11, 2025
3908718
fix(test): fix AccessibilityManagerTest failing because of handling l…
artus9033 Sep 11, 2025
80289f8
test: disable AccessibilityManagerTest due to T225745315
artus9033 Sep 12, 2025
7c8e4a9
docs: update unit and integration tests instructions
artus9033 Sep 13, 2025
3a0dcd9
test: enable RCTLoggingTests
artus9033 Sep 18, 2025
c9d42b2
chore: update Podfile
artus9033 Sep 18, 2025
a41e886
fix(test): mock dispatch_async in RCTBlobManagerTests
artus9033 Sep 18, 2025
970228c
fix(test): use color constants for RCTConvert_UIColorTests::testGener…
artus9033 Sep 18, 2025
d9db57d
fix(test): update baseline strings in RCTBundleURLProviderTests
artus9033 Sep 18, 2025
cd572ab
fix(test): use default xctestplan environment variable values in test…
artus9033 Sep 18, 2025
30a93fc
fix(test): do not skip RCTBundleURLProviderTests in unit tests
artus9033 Sep 18, 2025
b34c885
Merge branch 'main' into fix/rntester-tests
artus9033 Sep 20, 2025
4c51544
fix: typechecking in IntegrationTestsApp.js
artus9033 Sep 20, 2025
462b28b
chore: update Podfile.lock
artus9033 Sep 20, 2025
c9484f1
chore: re-enable debugger in RNTester unit and integration tests
artus9033 Sep 20, 2025
efe4c5c
chore: update Podfile
artus9033 Sep 20, 2025
640e672
chore: revert changes to Podfile.lock
artus9033 Sep 23, 2025
a400089
fix: use ES exports in IntegrationTests sources, properly destructure…
artus9033 Sep 23, 2025
a1ae130
ci: run iOS unit & integration tests on CI
artus9033 Sep 24, 2025
9888b70
fix(test): fix codegen_utils-test.rb using removed mock helper Codege…
artus9033 Sep 24, 2025
dc24ea8
fix(test): bad indentation in ruby tests
artus9033 Sep 24, 2025
a8f6150
fix(test): ruby test - updated baselines in codegen_utils-test
artus9033 Sep 24, 2025
c627b3e
fix(test): ruby test - updated baselines in jsengine-test
artus9033 Sep 24, 2025
d753226
fix: missing requires in new_architecture.rb
artus9033 Sep 24, 2025
63ae020
fix(test): ruby test - updated baselines in new_architecture-test
artus9033 Sep 24, 2025
f92b135
fix(test): ruby test - updated baselines in utils-test
artus9033 Sep 24, 2025
42eb4c3
refactor: comment in codegen_utils-test.rb
artus9033 Sep 24, 2025
075bf29
Merge branch 'main' into fix/rntester-tests
artus9033 Sep 24, 2025
fa18880
Merge branch 'main' into fix/rntester-tests
artus9033 Sep 24, 2025
5182a1b
fix(test): fix order of arguments passed to assert_equal in Ruby tests
artus9033 Sep 24, 2025
c02cc35
fix(ci): bump up the target device of iOS test runner to a present one
artus9033 Sep 24, 2025
85138c0
Merge branch 'main' into fix/rntester-tests
artus9033 Sep 25, 2025
d3cb26c
chore: temporarily disable throwIfOnLegacyArch in RCTBridge
artus9033 Sep 28, 2025
b2ff94e
Merge branch 'main' into fix/rntester-tests
artus9033 Oct 1, 2025
3b208c9
fix(ci): include RCTTest source files in CI compilation that utilizes…
artus9033 Oct 2, 2025
f4b1eb5
fix(ci): correct path to test results in test-ios-rntester
artus9033 Oct 2, 2025
8fd5bc2
fix: explicitly define NDEBUG in objc-test
artus9033 Oct 2, 2025
d180f10
Merge branch 'main' into fix/rntester-tests
artus9033 Oct 2, 2025
bf04df5
fix(ci): conflicts between test artifacts' names
artus9033 Oct 3, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions .github/actions/test-ios-rntester/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ inputs:
ruby-version:
description: The version of ruby that must be used
default: 2.6.10
run-unit-tests:
description: whether unit tests should run or not.
default: "false"
run-unit-integration-tests:
description: whether unit & integration tests should run or not.
default: "true"
hermes-tarball-artifacts-dir:
description: The directory where the hermes tarball artifacts are stored
default: /tmp/hermes/hermes-runtime-darwin
Expand Down Expand Up @@ -46,7 +46,7 @@ runs:
with:
ruby-version: ${{ inputs.ruby-version }}
- name: Prepare IOS Tests
if: ${{ inputs.run-unit-tests == 'true' }}
if: ${{ inputs.run-unit-integration-tests == 'true' }}
uses: ./.github/actions/prepare-ios-tests
- name: Set HERMES_ENGINE_TARBALL_PATH envvar if Hermes tarball is present
shell: bash
Expand Down Expand Up @@ -134,33 +134,33 @@ runs:
echo "App found at $APP_PATH"
echo "app-path=$APP_PATH" >> $GITHUB_ENV
- name: "Run Tests: iOS Unit and Integration Tests"
if: ${{ inputs.run-unit-tests == 'true' }}
if: ${{ inputs.run-unit-integration-tests == 'true' }}
shell: bash
run: yarn test-ios

- name: Zip Derived data folder
if: ${{ inputs.run-unit-tests == 'true' }}
if: ${{ inputs.run-unit-integration-tests == 'true' }}
shell: bash
run: |
echo "zipping tests results"
cd /Users/distiller/Library/Developer/Xcode
cd /Users/runner/Library/Developer/Xcode
XCRESULT_PATH=$(find . -name '*.xcresult')
tar -zcvf xcresults.tar.gz $XCRESULT_PATH
- name: Upload artifact
uses: actions/[email protected]
if: ${{ inputs.run-unit-tests == 'true' }}
if: ${{ inputs.run-unit-integration-tests == 'true' }}
with:
name: xcresults
path: /Users/distiller/Library/Developer/Xcode/xcresults.tar.gz
name: xcresults-${{ inputs.flavor }}-${{ inputs.use-frameworks }}-Ruby${{ inputs.ruby-version }}
path: /Users/runner/Library/Developer/Xcode/xcresults.tar.gz
- name: Upload RNTester App
if: ${{ inputs.use-frameworks == 'StaticLibraries' && inputs.ruby-version == '2.6.10' }} # This is needed to avoid conflicts with the artifacts
uses: actions/[email protected]
with:
name: RNTesterApp-NewArch-${{ inputs.flavor }}
path: ${{ env.app-path }}
- name: Store test results
if: ${{ inputs.run-unit-tests == 'true' }}
if: ${{ inputs.run-unit-integration-tests == 'true' }}
uses: actions/[email protected]
with:
name: test-results
name: test-results-${{ inputs.flavor }}-${{ inputs.use-frameworks }}-Ruby${{ inputs.ruby-version }}
path: ./reports/junit
8 changes: 4 additions & 4 deletions packages/react-native/React/Base/RCTBridge.mm
Original file line number Diff line number Diff line change
Expand Up @@ -380,10 +380,10 @@ - (instancetype)initWithDelegate:(id<RCTBridgeDelegate>)delegate
moduleProvider:(RCTBridgeModuleListProvider)block
launchOptions:(NSDictionary *)launchOptions
{
// Only enabld this assertion in OSS
#if COCOAPODS
[RCTBridge throwIfOnLegacyArch];
#endif
// Only enable this assertion in OSS
//#if COCOAPODS
// [RCTBridge throwIfOnLegacyArch];
//#endif

if (self = [super init]) {
_delegate = delegate;
Expand Down
2 changes: 1 addition & 1 deletion packages/react-native/React/Base/RCTUtils.mm
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,7 @@ BOOL RCTForceTouchAvailable(void)
[data base64EncodedStringWithOptions:(NSDataBase64EncodingOptions)0]]];
}

BOOL RCTIsGzippedData(NSData *__nullable /*data*/); // exposed for unit testing purposes
extern "C" BOOL RCTIsGzippedData(NSData *__nullable /*data*/); // exposed for unit testing purposes
BOOL RCTIsGzippedData(NSData *__nullable data)
{
UInt8 *bytes = (UInt8 *)data.bytes;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ class CodegenUtilsTests < Test::Unit::TestCase

def setup
CodegenUtils.set_react_codegen_discovery_done(false)
CodegenUtils.set_react_codegen_podspec_generated(false)
Pod::Config.reset()
@base_path = "~/app/ios"
Pathname.pwd!(@base_path)
Expand Down Expand Up @@ -62,8 +61,8 @@ def testUseReactCodegenDiscovery_whenCodegenDisabled_doNothing

# Assert
assert_false(CodegenUtils.react_codegen_discovery_done())
assert_equal(Pod::UI.collected_messages, [])
assert_equal(Pod::UI.collected_warns, [])
assert_equal([], Pod::UI.collected_messages)
assert_equal([], Pod::UI.collected_warns)
end

def testUseReactCodegenDiscovery_whenDiscoveryDone_doNothing
Expand All @@ -75,8 +74,8 @@ def testUseReactCodegenDiscovery_whenDiscoveryDone_doNothing

# Assert
assert_true(CodegenUtils.react_codegen_discovery_done())
assert_equal(Pod::UI.collected_messages, ["Skipping use_react_native_codegen_discovery."])
assert_equal(Pod::UI.collected_warns, [])
assert_equal(["Skipping use_react_native_codegen_discovery."], Pod::UI.collected_messages)
assert_equal([], Pod::UI.collected_warns)
end

def testUseReactCodegenDiscovery_whenAppPathUndefined_abort
Expand All @@ -89,16 +88,16 @@ def testUseReactCodegenDiscovery_whenAppPathUndefined_abort

# Assert
assert_false(CodegenUtils.react_codegen_discovery_done())
assert_equal(Pod::UI.collected_messages, [])
assert_equal(Pod::UI.collected_warns, [
assert_equal([], Pod::UI.collected_messages)
assert_equal([
'Error: app_path is required for use_react_native_codegen_discovery.',
'If you are calling use_react_native_codegen_discovery! in your Podfile, please remove the call and pass `app_path` and/or `config_file_dir` to `use_react_native!`.'
])
], Pod::UI.collected_warns)
end

# ============================= #
# =========================== #
# Test - CleanUpCodegenFolder #
# ============================= #
# =========================== #

def testCleanUpCodegenFolder_whenCleanupDone_doNothing
# Arrange
Expand All @@ -110,9 +109,9 @@ def testCleanUpCodegenFolder_whenCleanupDone_doNothing
CodegenUtils.clean_up_build_folder(rn_path, codegen_dir, dir_manager: DirMock, file_manager: FileMock)

# Assert
assert_equal(FileUtils::FileUtilsStorage.rmrf_invocation_count, 0)
assert_equal(FileUtils::FileUtilsStorage.rmrf_paths, [])
assert_equal(CodegenUtils.cleanup_done(), true)
assert_equal(0, FileUtils::FileUtilsStorage.rmrf_invocation_count)
assert_equal([], FileUtils::FileUtilsStorage.rmrf_paths)
assert_equal(true, CodegenUtils.cleanup_done())
end

def testCleanUpCodegenFolder_whenFolderDoesNotExists_markAsCleanupDone
Expand All @@ -125,10 +124,10 @@ def testCleanUpCodegenFolder_whenFolderDoesNotExists_markAsCleanupDone
CodegenUtils.clean_up_build_folder(rn_path, codegen_dir, dir_manager: DirMock, file_manager: FileMock)

# Assert
assert_equal(FileUtils::FileUtilsStorage.rmrf_invocation_count, 0)
assert_equal(FileUtils::FileUtilsStorage.rmrf_paths, [])
assert_equal(DirMock.glob_invocation, [])
assert_equal(CodegenUtils.cleanup_done(), true)
assert_equal(0, FileUtils::FileUtilsStorage.rmrf_invocation_count)
assert_equal([], FileUtils::FileUtilsStorage.rmrf_paths)
assert_equal([], DirMock.glob_invocation)
assert_equal(true, CodegenUtils.cleanup_done())
end

def testCleanUpCodegenFolder_whenFolderExists_deleteItAndSetCleanupDone
Expand All @@ -137,29 +136,33 @@ def testCleanUpCodegenFolder_whenFolderExists_deleteItAndSetCleanupDone
codegen_dir = "build/generated/ios"
codegen_path = "#{@base_path}/#{codegen_dir}"
globs = [
"/MyModuleSpecs/MyModule.h",
"#{codegen_path}/MyModuleSpecs/MyModule.mm",
"#{codegen_path}/react/components/MyComponent/ShadowNode.h",
"#{codegen_path}/react/components/MyComponent/ShadowNode.mm",
codegen_path
Comment on lines -140 to +139
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this baseline, these files apparently are no longer present anywhere

]
rn_path = '../node_modules/react-native'

DirMock.mocked_existing_dirs(codegen_path)
DirMock.mocked_existing_globs(globs, "#{codegen_path}/*")

original_define_singleton_method = CodegenUtils.method(:assert_codegen_folder_is_empty)
CodegenUtils.define_singleton_method(:assert_codegen_folder_is_empty) do |*args, **kwargs|
# no-op
end

Comment on lines +146 to +150
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This mock was missing

# Act
CodegenUtils.clean_up_build_folder(rn_path, codegen_dir, dir_manager: DirMock, file_manager: FileMock)

# Assert
assert_equal(DirMock.exist_invocation_params, [codegen_path, codegen_path])
assert_equal(DirMock.glob_invocation, ["#{codegen_path}/*", "#{codegen_path}/*"])
assert_equal(FileUtils::FileUtilsStorage.rmrf_invocation_count, 3)
assert_equal(FileUtils::FileUtilsStorage.rmrf_paths, [
globs,
assert_equal([codegen_path], DirMock.exist_invocation_params)
assert_equal(3, FileUtils::FileUtilsStorage.rmrf_invocation_count)
assert_equal([
*globs,
"#{rn_path}/React/Fabric/RCTThirdPartyFabricComponentsProvider.h",
"#{rn_path}/React/Fabric/RCTThirdPartyFabricComponentsProvider.mm",
])
assert_equal(CodegenUtils.cleanup_done(), true)
], FileUtils::FileUtilsStorage.rmrf_paths)
assert_equal(true, CodegenUtils.cleanup_done())
ensure
# Restore original method so other tests are not affected
CodegenUtils.define_singleton_method(:assert_codegen_folder_is_empty, original_define_singleton_method)
end

# ===================================== #
Expand All @@ -175,7 +178,7 @@ def test_assertCodegenFolderIsEmpty_whenItDoesNotExists_doesNotAbort
CodegenUtils.assert_codegen_folder_is_empty(codegen_path, dir_manager: DirMock)

# Assert
assert_equal(Pod::UI.collected_warns, [])
assert_equal([], Pod::UI.collected_warns)
end

def test_assertCodegenFolderIsEmpty_whenItExistsAndIsEmpty_doesNotAbort
Expand All @@ -189,7 +192,7 @@ def test_assertCodegenFolderIsEmpty_whenItExistsAndIsEmpty_doesNotAbort
CodegenUtils.assert_codegen_folder_is_empty(codegen_path, dir_manager: DirMock)

# Assert
assert_equal(Pod::UI.collected_warns, [])
assert_equal([], Pod::UI.collected_warns)
end

def test_assertCodegenFolderIsEmpty_whenItIsNotEmpty_itAborts
Expand All @@ -205,9 +208,9 @@ def test_assertCodegenFolderIsEmpty_whenItIsNotEmpty_itAborts
}

# Assert
assert_equal(Pod::UI.collected_warns, [
assert_equal([
"Unable to remove the content of ~/app/ios/./build/generated/ios folder. Please run rm -rf ~/app/ios/./build/generated/ios and try again."
])
], Pod::UI.collected_warns)
end

private
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@ def check_pod(name, path: nil, modular_headers: nil, podspec: nil)
if modular_headers != nil then expected_params[:modular_headers] = modular_headers end
if podspec != nil then expected_params[:podspec] = podspec end

assert_equal(params, expected_params)
assert_equal(expected_params, params)
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,11 @@ def test_setupHermes_installsPods
setup_hermes!(:react_native_path => @react_native_path)

# Assert
assert_equal($podInvocationCount, 3)
assert_equal($podInvocation["React-jsi"][:path], "../../ReactCommon/jsi")
assert_equal(2, $podInvocationCount)
hermes_engine_pod_invocation = $podInvocation["hermes-engine"]
assert_equal(hermes_engine_pod_invocation[:podspec], "../../sdks/hermes-engine/hermes-engine.podspec")
assert_equal(hermes_engine_pod_invocation[:tag], "")
assert_equal($podInvocation["React-hermes"][:path], "../../ReactCommon/hermes")
assert_equal("../../sdks/hermes-engine/hermes-engine.podspec", hermes_engine_pod_invocation[:podspec])
assert_equal("", hermes_engine_pod_invocation[:tag])
assert_equal("../../ReactCommon/hermes", $podInvocation["React-hermes"][:path])
end

end
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ def test_podsToUpdate_whenNoFilesExists_returnLocalPodspecs
local_podspec = LocalPodspecPatch.pods_to_update(:react_native_path => react_native_path, dir_manager: DirMock, file_manager: FileMock)

# Assert
assert_equal(local_podspec, [])
assert_equal(DirMock.glob_invocation, ["#{react_native_path}/third-party-podspecs/*"])
assert_equal(FileMock.exist_invocation_params, [
assert_equal([], local_podspec)
assert_equal(["#{react_native_path}/third-party-podspecs/*"], DirMock.glob_invocation)
assert_equal([
FileMock.join(mocked_pwd, "Pods/Local Podspecs", "boost.podspec.json"),
FileMock.join(mocked_pwd, "Pods/Local Podspecs", "DoubleConversion.podspec.json"),
])
], FileMock.exist_invocation_params)
end

def test_podsToUpdate_whenFilesExistsWithSameVersions_returnsEmpty
Expand All @@ -53,12 +53,12 @@ def test_podsToUpdate_whenFilesExistsWithSameVersions_returnsEmpty
local_podspec = LocalPodspecPatch.pods_to_update(:react_native_path => react_native_path, dir_manager: DirMock, file_manager: FileMock)

# Assert
assert_equal(local_podspec, [])
assert_equal(DirMock.glob_invocation, ["#{react_native_path}/third-party-podspecs/*"])
assert_equal(FileMock.exist_invocation_params, [
assert_equal([], local_podspec)
assert_equal(["#{react_native_path}/third-party-podspecs/*"], DirMock.glob_invocation)
assert_equal([
FileMock.join(mocked_pwd, "Pods/Local Podspecs", "boost.podspec.json"),
FileMock.join(mocked_pwd, "Pods/Local Podspecs", "DoubleConversion.podspec.json"),
])
], FileMock.exist_invocation_params)
end

def test_podsToUpdate_whenFilesExistsWithDifferentVersions_returnsThem
Expand All @@ -72,15 +72,15 @@ def test_podsToUpdate_whenFilesExistsWithDifferentVersions_returnsThem
local_podspec = LocalPodspecPatch.pods_to_update(:react_native_path => react_native_path, dir_manager: DirMock, file_manager: FileMock)

# Assert
assert_equal(local_podspec, [
assert_equal([
"boost",
"DoubleConversion"
])
assert_equal(DirMock.glob_invocation, ["#{react_native_path}/third-party-podspecs/*"])
assert_equal(FileMock.exist_invocation_params, [
], local_podspec)
assert_equal(["#{react_native_path}/third-party-podspecs/*"], DirMock.glob_invocation)
assert_equal([
FileMock.join(mocked_pwd, "Pods/Local Podspecs", "boost.podspec.json"),
FileMock.join(mocked_pwd, "Pods/Local Podspecs", "DoubleConversion.podspec.json"),
])
], FileMock.exist_invocation_params)
end

# ======================================== #
Expand All @@ -101,10 +101,10 @@ def test_patchDetectChangesWithPodfile_whenAlreadyChanged_returnSameChangeSet()

new_changes = Pod::Lockfile.new().patch_detect_changes_with_podfile(changes)

assert_equal(new_changes, {
assert_equal({
:unchanged => ["some_pod"],
:changed => ["boost", "DoubleConversion", "another_pod"]
})
}, new_changes)
end

def test_patchDetectChangesWithPodfile_whenLocalPodsUnchanged_movesLocalPodsToChangeSet()
Expand All @@ -122,10 +122,10 @@ def test_patchDetectChangesWithPodfile_whenLocalPodsUnchanged_movesLocalPodsToCh

new_changes = Pod::Lockfile.new().patch_detect_changes_with_podfile(changes)

assert_equal(new_changes, {
assert_equal({
:unchanged => ["first_pod"],
:changed => ["another_pod", "boost", "DoubleConversion"]
})
}, new_changes)
end

# ========= #
Expand Down
Loading
Loading