Skip to content

Fix ruby unit tests #48498

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed

Conversation

kraenhansen
Copy link
Contributor

@kraenhansen kraenhansen commented Jan 5, 2025

Summary:

As a prerequisite of enabling running unit tests on CI again, this PR suggests changes needed to the Ruby unit tests.

I've added comments on the code below, justifying changes where I deem a justification might be needed.

For use internally, I suggest accessing the folly_config and boost_config directly via the Helpers class instead of the get_folly_config and get_boost_config because these global functions are defined in react_native_pods.rb and requiring that file would be result in circular requires. An alternative would be to move these global functions to a separate file.

Changelog:

[INTERNAL] [FIXED] - Fix Ruby unit tests.

Test Plan:

  • cd packages/react-native
  • ./scripts/run_ruby_tests.sh

@facebook-github-bot facebook-github-bot added 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. labels Jan 5, 2025
@@ -513,9 +513,10 @@ def get_podspec_no_fabric_no_script
'source' => { :git => '' },
'header_mappings_dir' => './',
'platforms' => {
:ios => '13.4',
:ios => '15.1',
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 was updated since the tests ran last: #46137

Comment on lines -14 to -16
def get_folly_config()
return Helpers::Constants.folly_config
end
Copy link
Contributor Author

Choose a reason for hiding this comment

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

No longer needed now that the Helpers are accessed directly.

Comment on lines +535 to +544
'OTHER_CPLUSPLUSFLAGS' => [
'$(inherited)',
'-DFOLLY_NO_CONFIG',
'-DFOLLY_MOBILE=1',
'-DFOLLY_USE_LIBCPP=1',
'-DFOLLY_CFG_NO_COROUTINES=1',
'-DFOLLY_HAVE_CLOCK_GETTIME=1',
'-Wno-comma',
'-Wno-shorten-64-to-32',
'-Wno-documentation'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

As per #46513

@@ -544,6 +556,7 @@ def get_podspec_no_fabric_no_script
"ReactCommon/turbomodule/core": [],
"hermes-engine": [],
"React-NativeModulesApple": [],
'React-RCTAppDelegate': [],
Copy link
Contributor Author

Choose a reason for hiding this comment

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

As per #47650

},
'source_files' => "**/*.{h,mm,cpp}",
'exclude_files' => "RCTAppDependencyProvider.{h,mm}",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

As per #47761

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.

Thanks fo fixing this. The changes makes sense to me, and I agree that accessing the Helpers is better.
The globals are there more for third party libraries that might need those values.

@facebook-github-bot
Copy link
Contributor

@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Jan 6, 2025
@facebook-github-bot
Copy link
Contributor

@cipolleschi merged this pull request in 7a85b91.

@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by @kraenhansen in 7a85b91

When will my fix make it into a release? | How to file a pick request?

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. Merged This PR has been merged. 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.

4 participants