Skip to content

Commit

Permalink
Add tests with more recent Rubies (#36376)
Browse files Browse the repository at this point in the history
Summary:
This change add more tests for iOS, using different versions of Ruby

## Changelog
[iOS][Added] - Added smoke tests for iOS with Ruby 2.7.7 and 3.2.0

Pull Request resolved: #36376

Test Plan: CircleCI must be green.

Reviewed By: blakef

Differential Revision: D43825344

Pulled By: cipolleschi

fbshipit-source-id: 8d3f5a2d9688f4d58f0ad5573d7b21e059cab523
  • Loading branch information
Riccardo Cipolleschi authored and facebook-github-bot committed Mar 6, 2023
1 parent b6f8210 commit aac7150
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 4 deletions.
59 changes: 56 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -596,12 +596,17 @@ jobs:
description: Which JavaScript engine to use. Must be one of "Hermes", "JSC".
type: enum
enum: ["Hermes", "JSC"]
ruby_version:
default: "2.6.10"
description: The version of ruby that must be used
type: string
environment:
- REPORTS_DIR: "./reports/junit"
steps:
- checkout_code_with_cache
- setup_artifacts
- setup_ruby
- setup_ruby:
ruby_version: << parameters.ruby_version >>
- brew_install:
package: xcbeautify
- run:
Expand Down Expand Up @@ -895,6 +900,10 @@ jobs:
description: Which kind of option we want to use for `use_frameworks!`
type: enum
enum: ["StaticLibraries", "StaticFrameworks", "DynamicFrameworks"]
ruby_version:
default: "2.6.10"
description: The version of ruby that must be used
type: string
environment:
- PROJECT_NAME: "iOSTemplateProject"
- HERMES_WS_DIR: *hermes_workspace_root
Expand All @@ -904,7 +913,8 @@ jobs:
- attach_workspace:
at: .
- *attach_hermes_workspace
- setup_ruby
- setup_ruby:
ruby_version: << parameters.ruby_version >>
- when:
condition:
equal: ["Hermes", << parameters.jsengine >>]
Expand Down Expand Up @@ -977,6 +987,10 @@ jobs:
description: Which React Native architecture to use. Must be one of "OldArch", "NewArch".
type: enum
enum: ["NewArch", "OldArch"]
ruby_version:
default: "2.6.10"
description: The version of ruby that must be used
type: string
steps:
- checkout_code_with_cache
- run_yarn
Expand All @@ -989,7 +1003,8 @@ jobs:
name: Delete iOS Simulators
background: true
command: sudo rm -rf /Library/Developer/CoreSimulator/Profiles/Runtimes/
- setup_ruby
- setup_ruby:
ruby_version: << parameters.ruby_version >>
- with_hermes_tarball_cache_span:
set_tarball_path: True
steps:
Expand Down Expand Up @@ -1673,6 +1688,20 @@ workflows:
jsengine: ["Hermes", "JSC"]
flavor: ["Debug", "Release"]
- test_buck
- test_ios_template:
requires:
- build_npm_package
name: "Test Template with Ruby 2.7.7"
ruby_version: "2.7.7"
architecture: "NewArch"
flavor: "Debug"
- test_ios_template:
requires:
- build_npm_package
name: "Test Template with Ruby 3.2.0"
ruby_version: "3.2.0"
architecture: "NewArch"
flavor: "Debug"
- test_ios_template:
requires:
- build_npm_package
Expand Down Expand Up @@ -1804,13 +1833,37 @@ workflows:
jsengine: "JSC"
flipper: "WithFlipper"
use_frameworks: "DynamicFrameworks"
- test_ios_rntester:
requires:
- build_hermes_macos
name: "Test RNTester with Ruby 2.7.7"
ruby_version: "2.7.7"
architecture: "NewArch"
- test_ios_rntester:
requires:
- build_hermes_macos
name: "Test RNTester with Ruby 3.2.0"
ruby_version: "3.2.0"
architecture: "NewArch"
- test_ios_rntester:
requires:
- build_hermes_macos
matrix:
parameters:
architecture: ["NewArch", "OldArch"]
jsengine: ["Hermes", "JSC"]
- test_ios:
name: "Test iOS with Ruby 2.7.7"
run_unit_tests: true
requires:
- build_hermes_macos
ruby_version: "2.7.7"
- test_ios:
name: "Test iOS with Ruby 3.2.0"
run_unit_tests: true
requires:
- build_hermes_macos
ruby_version: "3.2.0"
- test_ios:
run_unit_tests: true
requires:
Expand Down
3 changes: 2 additions & 1 deletion scripts/cocoapods/__tests__/codegen_utils-test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -402,9 +402,10 @@ def testCleanUpCodegenFolder_whenCleanupDone_doNothing
CodegenUtils.set_cleanup_done(true)
codegen_dir = "build/generated/ios"
ios_folder = '.'
rn_path = '../node_modules/react-native'

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

# Assert
assert_equal(FileUtils::FileUtilsStorage.rmrf_invocation_count, 0)
Expand Down

0 comments on commit aac7150

Please sign in to comment.