Skip to content

Commit

Permalink
Use the app artifact in E2E tests
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: D67800932
  • Loading branch information
cipolleschi authored and facebook-github-bot committed Jan 3, 2025
1 parent 24497af commit 23bc2f1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
5 changes: 5 additions & 0 deletions .github/actions/maestro-ios/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ runs:
shell: bash
if: ${{ inputs.flavor == 'Debug' }}
run: |
yarn install
# build codegen or we will see a redbox
./packages/react-native-codegen/scripts/oss/build.sh
cd ${{ inputs.working-directory }}
yarn start &
sleep 5 # to give metro time to load
Expand Down
20 changes: 8 additions & 12 deletions .github/workflows/test-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ jobs:
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 23bc2f1

Please sign in to comment.