Run script phases tests in CI and Sandcastle (#33802)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/33802

We use to have a couple of tests for the script phases script that were not running during the CI.

This diff connect them with the two CI, so that they run together with the other ruby tests.

## Changelog
[iOS][Added] - Run script phases tests in CI

Reviewed By: fkgozali

Differential Revision: D36283211

fbshipit-source-id: 01b257cdc99b0bc196d60d49ac76cf044d61a7e9
This commit is contained in:
Riccardo Cipolleschi 2022-05-11 10:00:28 -07:00 коммит произвёл Facebook GitHub Bot
Родитель 7dc0b5153e
Коммит c171a6e157
4 изменённых файлов: 18 добавлений и 13 удалений

Просмотреть файл

@ -455,8 +455,8 @@ jobs:
- run:
name: Run Ruby Tests
command: |
cd scripts/cocoapods
sh run_tests.sh
cd scripts
sh run_ruby_tests.sh
- run_yarn
- run: |
cd packages/rn-tester

Просмотреть файл

@ -5,9 +5,9 @@
require_relative "../script_phases"
require_relative "./script_phases.snap"
require 'minitest/autorun'
require "test/unit"
class TestScriptPhases < Minitest::Test
class TestScriptPhases < Test::Unit::TestCase
def test_get_script_phases_with_codegen_discovery_with_config_file_dir
result = get_script_phases_with_codegen_discovery(
@ -15,7 +15,7 @@ class TestScriptPhases < Minitest::Test
relative_app_root: '',
relative_config_file_dir: 'node_modules',
fabric_enabled: true)
assert_equal snap_get_script_phases_with_codegen_discovery_with_config_file_dir, result
assert_equal(snap_get_script_phases_with_codegen_discovery_with_config_file_dir, result)
end
def test_get_script_phases_with_codegen_discovery_without_config_file_dir
@ -24,7 +24,7 @@ class TestScriptPhases < Minitest::Test
relative_app_root: '',
relative_config_file_dir: '',
fabric_enabled: true)
assert_equal snap_get_script_phases_with_codegen_discovery_without_config_file_dir, result
assert_equal(snap_get_script_phases_with_codegen_discovery_without_config_file_dir, result)
end
def test_get_script_phases_no_codegen_discovery()
@ -39,7 +39,7 @@ class TestScriptPhases < Minitest::Test
js_srcs_dir: './',
file_list: '[".//NativeScreenshotManager.js"]'
)
assert_equal snap_get_script_phases_no_codegen_discovery, result
assert_equal(snap_get_script_phases_no_codegen_discovery, result)
end
end

Просмотреть файл

@ -16,8 +16,9 @@ def snap_get_script_phases_with_codegen_discovery_with_config_file_dir()
export RCT_SCRIPT_FABRIC_ENABLED=true
export RCT_SCRIPT_TYPE=withCodegenDiscovery
SCRIPT_PHASES_SCRIPT=\"$RCT_SCRIPT_RN_DIR/scripts/react_native_pods_utils/script_phases.sh\"
/bin/sh -c \"$SCRIPT_PHASES_SCRIPT\"
SCRIPT_PHASES_SCRIPT="$RCT_SCRIPT_RN_DIR/scripts/react_native_pods_utils/script_phases.sh"
WITH_ENVIRONMENT="$RCT_SCRIPT_RN_DIR/scripts/xcode/with-environment.sh"
/bin/sh -c "$WITH_ENVIRONMENT $SCRIPT_PHASES_SCRIPT"
EOS
end
@ -34,8 +35,9 @@ def snap_get_script_phases_with_codegen_discovery_without_config_file_dir()
export RCT_SCRIPT_FABRIC_ENABLED=true
export RCT_SCRIPT_TYPE=withCodegenDiscovery
SCRIPT_PHASES_SCRIPT=\"$RCT_SCRIPT_RN_DIR/scripts/react_native_pods_utils/script_phases.sh\"
/bin/sh -c \"$SCRIPT_PHASES_SCRIPT\"
SCRIPT_PHASES_SCRIPT="$RCT_SCRIPT_RN_DIR/scripts/react_native_pods_utils/script_phases.sh"
WITH_ENVIRONMENT="$RCT_SCRIPT_RN_DIR/scripts/xcode/with-environment.sh"
/bin/sh -c "$WITH_ENVIRONMENT $SCRIPT_PHASES_SCRIPT"
EOS
end
@ -55,7 +57,8 @@ def snap_get_script_phases_no_codegen_discovery()
export RCT_SCRIPT_CODEGEN_COMPONENT_DIR=react/renderer/components
export RCT_SCRIPT_FILE_LIST=\"[\\\".//NativeScreenshotManager.js\\\"]\"
SCRIPT_PHASES_SCRIPT=\"$RCT_SCRIPT_RN_DIR/scripts/react_native_pods_utils/script_phases.sh\"
/bin/sh -c \"$SCRIPT_PHASES_SCRIPT\"
SCRIPT_PHASES_SCRIPT="$RCT_SCRIPT_RN_DIR/scripts/react_native_pods_utils/script_phases.sh"
WITH_ENVIRONMENT="$RCT_SCRIPT_RN_DIR/scripts/xcode/with-environment.sh"
/bin/sh -c "$WITH_ENVIRONMENT $SCRIPT_PHASES_SCRIPT"
EOS
end

Просмотреть файл

@ -7,6 +7,8 @@
set -f
basepath=$(dirname "${0}")
# shellcheck disable=SC2207
files=( $(find . -name '*-test.rb') )
test_suite="${basepath}/all_tests.rb"