Skip to content

Commit

Permalink
Use the app artifact in E2E tests (#48444)
Browse files Browse the repository at this point in the history
Summary:

This change downloads the generated artifact and uses it in the E2E tests

## Context

While looking at the recent failures of the E2E tests, I realized that the Hermes, NewArch, Debug variant often fails to build, not to test, for some misconfiguration.

I also realized that we are already building that varaint successfully once, so why not reuse it? To reuse prebuilds, we need a few steps:

1. make sure we build all the variants we need
2. store the .app file as an artifact
3. download the artifact and use it in the E2E tests

## Changelog:
[Internal] - Build release variant for RNTester

Differential Revision: D67760436
  • Loading branch information
cipolleschi authored and facebook-github-bot committed Jan 3, 2025
1 parent 4d6db4a commit e1e4e63
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 18 deletions.
11 changes: 6 additions & 5 deletions .github/actions/maestro-ios/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ runs:
shell: bash
if: ${{ inputs.flavor == 'Debug' }}
run: |
yarn install
cd ${{ inputs.working-directory }}
yarn start &
sleep 5 # to give metro time to load
Expand All @@ -70,11 +71,11 @@ runs:
with:
name: e2e_ios_${{ inputs.app-id }}_report_${{ inputs.jsengine }}_${{ inputs.flavor }}_${{ inputs.architecture }}
path: |
video_record_1.mov
video_record_2.mov
video_record_3.mov
video_record_4.mov
video_record_5.mov
video_record_${{ inputs.jsengine }}_1.mov
video_record_${{ inputs.jsengine }}_2.mov
video_record_${{ inputs.jsengine }}_3.mov
video_record_${{ inputs.jsengine }}_4.mov
video_record_${{ inputs.jsengine }}_5.mov
report.xml
- name: Store Logs
if: failure() && steps.run-tests.outcome == 'failure'
Expand Down
22 changes: 9 additions & 13 deletions .github/workflows/test-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,10 @@ jobs:
flavor: ${{ matrix.flavor }}

test_e2e_ios_rntester:
if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, 'stable') || inputs.run-e2e-tests }}
# if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, 'stable') || inputs.run-e2e-tests }}
runs-on: macos-13-large
needs:
[build_apple_slices_hermes, prepare_hermes_workspace, build_hermes_macos]
[test_ios_rntester]
env:
HERMES_WS_DIR: /tmp/hermes
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
Expand All @@ -209,21 +209,17 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run it
uses: ./.github/actions/test-ios-rntester
- name: Download App
uses: actions/download-artifact@v4
with:
jsengine: ${{ matrix.jsengine }}
architecture: ${{ matrix.architecture }}
run-unit-tests: "false"
use-frameworks: StaticLibraries
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
run-e2e-tests: "true"
flavor: ${{ matrix.flavor }}
name: RNTesterApp-${{ matrix.architecture }}-${{ matrix.jsengine }}-${{ matrix.flavor }}
path: /tmp/RNTesterBuild/RNTester.app
- name: Check downloaded folder content
run: ls -lR /tmp/RNTesterBuild
- name: Run E2E Tests
uses: ./.github/actions/maestro-ios
with:
app-path: "/tmp/RNTesterBuild/Build/Products/${{ matrix.flavor }}-iphonesimulator/RNTester.app"
app-path: "/tmp/RNTesterBuild/RNTester.app"
app-id: com.meta.RNTester.localDevelopment
jsengine: ${{ matrix.jsengine }}
maestro-flow: ./packages/rn-tester/.maestro/
Expand Down

0 comments on commit e1e4e63

Please sign in to comment.