Skip to content
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

[LOCAL][RN][CI] Add Maestro tests for the Old Arch in Template App #48045

Open
wants to merge 1 commit into
base: 0.77-stable
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
13 changes: 9 additions & 4 deletions .github/actions/maestro-android/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ inputs:
required: false
default: "."
description: The directory from which metro should be started
architecture:
required: false
default: "NewArch"
description: The react native architecture to test

runs:
using: composite
Expand Down Expand Up @@ -52,6 +56,7 @@ runs:
if: ${{ inputs.flavor == 'debug' }}
run: ./packages/react-native-codegen/scripts/oss/build.sh
- name: Run e2e tests
id: run-tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 24
Expand All @@ -69,16 +74,16 @@ runs:
NORM_APP_ID=$(echo "${{ inputs.app-id }}" | tr '.' '-')
echo "app-id=$NORM_APP_ID" >> $GITHUB_OUTPUT
- name: Store tests result
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4.3.4
if: always()
with:
name: e2e_android_${{ steps.normalize-app-id.outputs.app-id }}_report_${{ inputs.jsengine }}_${{ inputs.flavor }}
name: e2e_android_${{ steps.normalize-app-id.outputs.app-id }}_report_${{ inputs.jsengine }}_${{ inputs.flavor }}_${{ inputs.architecture }}
path: |
report.xml
screen.mp4
- name: Store Logs
if: failure() && steps.run-tests.outcome == 'failure'
if: steps.run-tests.outcome == 'failure'
uses: actions/[email protected]
with:
name: maestro-logs-android-${{ steps.normalize-app-id.outputs.app-id }}-${{ inputs.jsengine }}-${{ inputs.flavor }}
name: maestro-logs-android-${{ steps.normalize-app-id.outputs.app-id }}-${{ inputs.jsengine }}-${{ inputs.flavor }}-${{ inputs.architecture }}
path: /tmp/MaestroLogs
10 changes: 6 additions & 4 deletions .github/actions/maestro-ios/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ inputs:
required: false
default: "."
description: The directory from which metro should be started
architecture:
required: false
default: "NewArch"
description: The react native architecture to test

runs:
using: composite
Expand Down Expand Up @@ -86,8 +90,6 @@ runs:
CURR_ATTEMPT=$((CURR_ATTEMPT+1))
echo "Attempt number $CURR_ATTEMPT"



echo "Start video record using pid: video_record_${{ inputs.jsengine }}_$CURR_ATTEMPT.pid"
xcrun simctl io booted recordVideo video_record_$CURR_ATTEMPT.mov & echo $! > video_record_${{ inputs.jsengine }}_$CURR_ATTEMPT.pid

Expand All @@ -105,7 +107,7 @@ runs:
if: always()
uses: actions/[email protected]
with:
name: e2e_ios_${{ inputs.app-id }}_report_${{ inputs.jsengine }}_${{ inputs.flavor }}
name: e2e_ios_${{ inputs.app-id }}_report_${{ inputs.jsengine }}_${{ inputs.flavor }}_${{ inputs.architecture }}
path: |
video_record_1.mov
video_record_2.mov
Expand All @@ -117,5 +119,5 @@ runs:
if: failure() && steps.run-tests.outcome == 'failure'
uses: actions/[email protected]
with:
name: maestro-logs-${{ inputs.app-id }}-${{ inputs.jsengine }}-${{ inputs.flavor }}
name: maestro-logs-${{ inputs.app-id }}-${{ inputs.jsengine }}-${{ inputs.flavor }}-${{ inputs.architecture }}
path: /tmp/MaestroLogs
5 changes: 3 additions & 2 deletions .github/workflow-scripts/maestro-android.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ async function main() {
stdio: 'ignore',
detached: true,
});
metroProcess.unref();
console.info(`- Metro PID: ${metroProcess.pid}`);
}

Expand Down Expand Up @@ -88,15 +89,15 @@ async function main() {
if (IS_DEBUG && metroProcess != null) {
const pid = metroProcess.pid;
console.info(`Kill Metro. PID: ${pid}`);
process.kill(-pid);
process.kill(pid);
console.info(`Metro Killed`);
process.exit();
}
}

if (error) {
throw error;
}
process.exit();
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 necessary, otherwise the Android simulator hangs and can't be killed.

}

function sleep(ms) {
Expand Down
16 changes: 15 additions & 1 deletion .github/workflows/test-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ jobs:
matrix:
jsengine: [Hermes, JSC]
flavor: [Debug, Release]
architecture: [OldArch, NewArch]
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -277,7 +278,12 @@ jobs:

cd /tmp/RNTestProject/ios
bundle install
HERMES_ENGINE_TARBALL_PATH=$HERMES_PATH bundle exec pod install
NEW_ARCH_ENABLED=1
if [[ ${{ matrix.architecture }} == "OldArch" ]]; then
echo "Disable the New Architecture"
NEW_ARCH_ENABLED=0
fi
HERMES_ENGINE_TARBALL_PATH=$HERMES_PATH RCT_NEW_ARCH_ENABLED=$NEW_ARCH_ENABLED bundle exec pod install

xcodebuild \
-scheme "RNTestProject" \
Expand All @@ -295,6 +301,7 @@ jobs:
maestro-flow: ./scripts/e2e/.maestro/
flavor: ${{ matrix.flavor }}
working-directory: /tmp/RNTestProject
architecture: ${{ matrix.architecture }}

test_e2e_android_templateapp:
if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, 'stable') || inputs.run-e2e-tests }}
Expand All @@ -306,6 +313,7 @@ jobs:
matrix:
jsengine: [Hermes, JSC]
flavor: [debug, release]
architecture: [OldArch, NewArch]
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -351,6 +359,11 @@ jobs:
cd /tmp/RNTestProject
echo "react.internal.mavenLocalRepo=$MAVEN_LOCAL" >> android/gradle.properties

if [[ ${{matrix.architecture}} == "OldArch" ]]; then
echo "Disabling the New Architecture"
sed -i 's/newArchEnabled=true/newArchEnabled=false/' android/gradle.properties
fi

# Build
cd android
CAPITALIZED_FLAVOR=$(echo "${{ matrix.flavor }}" | awk '{print toupper(substr($0, 1, 1)) substr($0, 2)}')
Expand All @@ -366,6 +379,7 @@ jobs:
install-java: 'false'
flavor: ${{ matrix.flavor }}
working-directory: /tmp/RNTestProject
architecture: ${{ matrix.architecture }}

build_hermesc_linux:
runs-on: ubuntu-latest
Expand Down
6 changes: 3 additions & 3 deletions packages/rn-tester/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1870,8 +1870,8 @@ EXTERNAL SOURCES:
:path: "../react-native/ReactCommon/yoga"

SPEC CHECKSUMS:
boost: 7e761d76ca2ce687f7cc98e698152abd03a18f90
DoubleConversion: cb417026b2400c8f53ae97020b2be961b59470cb
boost: 1dca942403ed9342f98334bf4c3621f011aa7946
DoubleConversion: fea03f2699887d960129cc54bba7e52542b6f953
fast_float: 06eeec4fe712a76acc9376682e4808b05ce978b6
FBLazyVector: ec2eda6b55fa0e3d32b9f8bd1e6190e95c3189a4
fmt: a40bb5bd0294ea969aaaba240a927bd33d878cdd
Expand Down Expand Up @@ -1948,4 +1948,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: 8591f96a513620a2a83a0b9a125ad3fa32ea1369

COCOAPODS: 1.14.3
COCOAPODS: 1.15.2
Loading