Skip to content

Conversation

@artus9033
Copy link
Contributor

@artus9033 artus9033 commented Sep 18, 2025

Summary:

This PR fixes problems with unit & integration tests in the iOS RNTester project, related to: compilation errors, JS problems, missing mocks & outdated baselines.

Changelog:

[GENERAL] [FIXED] - IntegrationTestsApp not registering components under proper names, breaking integration tests
[GENERAL] [FIXED] - IntegrationTestsApp flow types
[GENERAL] [FIXED] - Re-enabled iOS unit & integration tests, Ruby tests on CI
[IOS] [FIXED] - Fixed Ruby scripting tests, refactored order of arguments to assert_equals where it was swapped
[IOS] [FIXED] - Reconfigured CI iOS test runner to run on iPhone 16, iOS 18.1, since the previous device was missing in the runner setup
[IOS] [FIXED] - Compilation errors of iOS unit tests
[IOS] [FIXED] - Fixed logic of broken iOS tests, add missing mocks
[IOS] [FIXED] - Disabled / skipped unit & integration tests that are coupled with legacy architecture bridge, which now throws upon initialization

Test Plan:

  1. iOS tests pass:
  • When run from dedicated xcschemes:
image image
  • When run from the RNTester scheme (command + U):
image
  1. Ruby scripting tests pass:
image
  1. CI - green

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Sep 18, 2025
@artus9033 artus9033 changed the title fix(test): fix RNTester iOS unit and instrumentation tests fix(test): fix RNTester iOS unit and integration tests Sep 21, 2025
@artus9033 artus9033 marked this pull request as ready for review September 21, 2025 10:39
@facebook-github-bot facebook-github-bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Sep 21, 2025
Copy link
Contributor

@cipolleschi cipolleschi left a comment

Choose a reason for hiding this comment

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

Amazing job, I left a couple of comments.

We also have in CI a flag here and here that leverage these tests.

It would be nice if we can enable them to run in CI so we can keep them checked while we develop react native.

Can you update the PR with that?

@artus9033
Copy link
Contributor Author

Absolutely, thanks for the comments, I'll address them today.

installer.target_installation_results.pod_target_installation_results.each do |pod_name, target_installation_result|
if pod_name.to_s == target_pod_name
target_installation_result.native_target.build_configurations.each do |config|
if configuration_type == nil || (configuration_type != nil && config.type == configuration_type)
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 file, indentation was messed up

# Assert
assert_equal(DirMock.exist_invocation_params, [codegen_path, codegen_path])
assert_equal(DirMock.glob_invocation, ["#{codegen_path}/*", "#{codegen_path}/*"])
assert_equal(DirMock.exist_invocation_params, [codegen_path])
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 is related to most (although, not all) assert_equal invocations in Ruby tests: the order of arguments is inverted, i.e., expected is swapped with actual. The signature is assert_equal(exp, act, msg = nil), while here and in all other places, the first argument is the actual value and the second is the expected value.

This deteriorates DX since makes it misleading to browse the messages of failed assertions:
image

@artus9033 artus9033 force-pushed the fix/rntester-tests branch 3 times, most recently from b37ee40 to fe3d3de Compare September 29, 2025 01:25
@artus9033 artus9033 force-pushed the fix/rntester-tests branch 5 times, most recently from 2d0b42f to dbbaf26 Compare October 2, 2025 10:01
@artus9033
Copy link
Contributor Author

Thank you Riccardo @cipolleschi , #54421 unblocked this PR - build & tests are now passing. I also disabled or skipped the tests that depend on legacy architecture (bridge). Would you re-review the PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants