From c9bbb1ecb538a84bc9c35a8aa8264586dc7e7217 Mon Sep 17 00:00:00 2001 From: Riccardo Cipolleschi Date: Thu, 2 Jan 2025 12:05:21 -0800 Subject: [PATCH] Use the app artifact in E2E tests (#48444) 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 --- .github/actions/maestro-ios/action.yml | 1 + .github/workflows/test-all.yml | 22 +++++++++------------- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/.github/actions/maestro-ios/action.yml b/.github/actions/maestro-ios/action.yml index fe059326119836..3530399773d29e 100644 --- a/.github/actions/maestro-ios/action.yml +++ b/.github/actions/maestro-ios/action.yml @@ -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 diff --git a/.github/workflows/test-all.yml b/.github/workflows/test-all.yml index 3a49ebea3a550b..4e20813fceee15 100644 --- a/.github/workflows/test-all.yml +++ b/.github/workflows/test-all.yml @@ -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 @@ -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/