-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Add E2E test retry jobs for PRs to handle flakiness #56581
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
Changes from 3 commits
a91dc39
8b73712
71f5d85
157163d
55a2797
fd54ee6
9657cb9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| name: E2E Android RNTester | ||
|
|
||
| on: | ||
| workflow_call: | ||
| outputs: | ||
| status: | ||
| description: "The result of the E2E tests (success or failure)" | ||
| value: ${{ jobs.report.outputs.status }} | ||
|
|
||
| jobs: | ||
| test: | ||
| runs-on: 4-core-ubuntu | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| flavor: [debug, release] | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v6 | ||
| - name: Setup node.js | ||
| uses: ./.github/actions/setup-node | ||
| - name: Install node dependencies | ||
| uses: ./.github/actions/yarn-install | ||
| - name: Download APK | ||
| uses: actions/download-artifact@v7 | ||
| with: | ||
| name: rntester-${{ matrix.flavor }} | ||
| path: ./packages/rn-tester/android/app/build/outputs/apk/${{ matrix.flavor }}/ | ||
| - name: Print folder structure | ||
| run: ls -lR ./packages/rn-tester/android/app/build/outputs/apk/${{ matrix.flavor }}/ | ||
| - name: Run E2E Tests | ||
| uses: ./.github/actions/maestro-android | ||
| timeout-minutes: 60 | ||
| with: | ||
| app-path: ./packages/rn-tester/android/app/build/outputs/apk/${{ matrix.flavor }}/app-x86-${{ matrix.flavor }}.apk | ||
| app-id: com.facebook.react.uiapp | ||
| maestro-flow: ./packages/rn-tester/.maestro | ||
| flavor: ${{ matrix.flavor }} | ||
|
|
||
| report: | ||
Check warningCode scanning / CodeQL Workflow does not contain permissions Medium
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
|
||
| needs: test | ||
| if: always() | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| status: ${{ steps.check.outputs.status }} | ||
| steps: | ||
| - id: check | ||
| run: | | ||
| if [[ "${{ needs.test.result }}" == "failure" ]]; then | ||
| echo "status=failure" >> $GITHUB_OUTPUT | ||
| else | ||
| echo "status=success" >> $GITHUB_OUTPUT | ||
| fi | ||
Check warningCode scanning / CodeQL Workflow does not contain permissions Medium
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}
|
||
|
github-advanced-security[bot] marked this conversation as resolved.
Fixed
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,91 @@ | ||
| name: E2E Android Template App | ||
|
|
||
| on: | ||
| workflow_call: | ||
| outputs: | ||
| status: | ||
| description: "The result of the E2E tests (success or failure)" | ||
| value: ${{ jobs.report.outputs.status }} | ||
|
|
||
| jobs: | ||
| test: | ||
| runs-on: 4-core-ubuntu | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| flavor: [debug, release] | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v6 | ||
| - name: Setup node.js | ||
| uses: ./.github/actions/setup-node | ||
| - name: Run yarn | ||
| uses: ./.github/actions/yarn-install | ||
| - name: Set up JDK 17 | ||
| uses: actions/setup-java@v5 | ||
| with: | ||
| java-version: '17' | ||
| distribution: 'zulu' | ||
| - name: Download Maven Local | ||
| uses: actions/download-artifact@v7 | ||
| with: | ||
| name: maven-local | ||
| path: /tmp/react-native-tmp/maven-local | ||
| - name: Download React Native Package | ||
| uses: actions/download-artifact@v7 | ||
| with: | ||
| name: react-native-package | ||
| path: /tmp/react-native-tmp | ||
| - name: Print /tmp folder | ||
| run: ls -lR /tmp/react-native-tmp | ||
| - name: Prepare artifacts | ||
| id: prepare-artifacts | ||
| run: | | ||
| REACT_NATIVE_PKG=$(find /tmp/react-native-tmp -type f -name "*.tgz") | ||
| echo "React Native tgs is $REACT_NATIVE_PKG" | ||
|
|
||
| MAVEN_LOCAL=/tmp/react-native-tmp/maven-local | ||
| echo "Maven local path is $MAVEN_LOCAL" | ||
|
|
||
| # For stable branches, we want to use the stable branch of the template | ||
| # In all the other cases, we want to use "main" | ||
| BRANCH=${{ github.ref_name }} | ||
| if ! [[ $BRANCH == *-stable* ]]; then | ||
| BRANCH=main | ||
| fi | ||
| node ./scripts/e2e/init-project-e2e.js --projectName RNTestProject --currentBranch $BRANCH --directory /tmp/RNTestProject --pathToLocalReactNative $REACT_NATIVE_PKG | ||
|
|
||
| echo "Feed maven local to gradle.properties" | ||
| cd /tmp/RNTestProject | ||
| echo "react.internal.mavenLocalRepo=$MAVEN_LOCAL" >> android/gradle.properties | ||
|
|
||
| # Build | ||
| cd android | ||
| CAPITALIZED_FLAVOR=$(echo "${{ matrix.flavor }}" | awk '{print toupper(substr($0, 1, 1)) substr($0, 2)}') | ||
| ./gradlew assemble$CAPITALIZED_FLAVOR --no-daemon -PreactNativeArchitectures=x86 | ||
|
|
||
| - name: Run E2E Tests | ||
| uses: ./.github/actions/maestro-android | ||
| timeout-minutes: 60 | ||
| with: | ||
| app-path: /tmp/RNTestProject/android/app/build/outputs/apk/${{ matrix.flavor }}/app-${{ matrix.flavor }}.apk | ||
| app-id: com.rntestproject | ||
| maestro-flow: ./scripts/e2e/.maestro/ | ||
| install-java: 'false' | ||
| flavor: ${{ matrix.flavor }} | ||
| working-directory: /tmp/RNTestProject | ||
|
|
||
| report: | ||
Check warningCode scanning / CodeQL Workflow does not contain permissions Medium
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
|
||
|
github-advanced-security[bot] marked this conversation as resolved.
Fixed
|
||
| needs: test | ||
| if: always() | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| status: ${{ steps.check.outputs.status }} | ||
| steps: | ||
| - id: check | ||
| run: | | ||
| if [[ "${{ needs.test.result }}" == "failure" ]]; then | ||
| echo "status=failure" >> $GITHUB_OUTPUT | ||
| else | ||
| echo "status=success" >> $GITHUB_OUTPUT | ||
| fi | ||
Check warningCode scanning / CodeQL Workflow does not contain permissions Medium
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}
|
||
|
github-advanced-security[bot] marked this conversation as resolved.
Fixed
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| name: E2E iOS RNTester | ||
|
|
||
| on: | ||
| workflow_call: | ||
| outputs: | ||
| status: | ||
| description: "The result of the E2E tests (success or failure)" | ||
| value: ${{ jobs.report.outputs.status }} | ||
|
|
||
| jobs: | ||
| test: | ||
| runs-on: macos-15-large | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| flavor: [Debug, Release] | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v6 | ||
| - name: Setup Node.js | ||
| uses: ./.github/actions/setup-node | ||
| - name: Download App | ||
| uses: actions/download-artifact@v7 | ||
| with: | ||
| name: RNTesterApp-NewArch-${{ matrix.flavor }} | ||
| path: /tmp/RNTesterBuild/RNTester.app | ||
| - name: Check downloaded folder content | ||
| run: ls -lR /tmp/RNTesterBuild | ||
| - name: Setup xcode | ||
| uses: ./.github/actions/setup-xcode | ||
| - name: Run E2E Tests | ||
| uses: ./.github/actions/maestro-ios | ||
| with: | ||
| app-path: "/tmp/RNTesterBuild/RNTester.app" | ||
| app-id: com.meta.RNTester.localDevelopment | ||
| maestro-flow: ./packages/rn-tester/.maestro/ | ||
| flavor: ${{ matrix.flavor }} | ||
|
|
||
| report: | ||
Check warningCode scanning / CodeQL Workflow does not contain permissions Medium
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
|
||
|
github-advanced-security[bot] marked this conversation as resolved.
Fixed
|
||
| needs: test | ||
| if: always() | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| status: ${{ steps.check.outputs.status }} | ||
| steps: | ||
| - id: check | ||
| run: | | ||
| if [[ "${{ needs.test.result }}" == "failure" ]]; then | ||
| echo "status=failure" >> $GITHUB_OUTPUT | ||
| else | ||
| echo "status=success" >> $GITHUB_OUTPUT | ||
| fi | ||
Check warningCode scanning / CodeQL Workflow does not contain permissions Medium
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}
|
||
|
github-advanced-security[bot] marked this conversation as resolved.
Fixed
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,110 @@ | ||
| name: E2E iOS Template App | ||
|
|
||
| on: | ||
| workflow_call: | ||
| outputs: | ||
| status: | ||
| description: "The result of the E2E tests (success or failure)" | ||
| value: ${{ jobs.report.outputs.status }} | ||
|
|
||
| jobs: | ||
| test: | ||
| runs-on: macos-15-large | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| flavor: [Debug, Release] | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v6 | ||
| - name: Setup xcode | ||
| uses: ./.github/actions/setup-xcode | ||
| - name: Setup node.js | ||
| uses: ./.github/actions/setup-node | ||
| - name: Run yarn | ||
| uses: ./.github/actions/yarn-install | ||
| - name: Setup ruby | ||
| uses: ruby/setup-ruby@v1 | ||
| with: | ||
| ruby-version: 2.6.10 | ||
| - name: Download React Native Package | ||
| uses: actions/download-artifact@v7 | ||
| with: | ||
| name: react-native-package | ||
| path: /tmp/react-native-tmp | ||
| - name: Print /tmp folder | ||
| run: ls -lR /tmp/react-native-tmp | ||
| - name: Download ReactNativeDependencies | ||
| uses: actions/download-artifact@v7 | ||
| with: | ||
| name: ReactNativeDependencies${{ matrix.flavor }}.xcframework.tar.gz | ||
| path: /tmp/third-party | ||
| - name: Print third-party folder | ||
| shell: bash | ||
| run: ls -lR /tmp/third-party | ||
| - name: Download React Native Prebuilds | ||
| uses: actions/download-artifact@v7 | ||
| with: | ||
| name: ReactCore${{ matrix.flavor }}.xcframework.tar.gz | ||
| path: /tmp/ReactCore | ||
| - name: Print ReactCore folder | ||
| shell: bash | ||
| run: ls -lR /tmp/ReactCore | ||
| - name: Configure git | ||
| shell: bash | ||
| run: | | ||
| git config --global user.email "react-native-bot@meta.com" | ||
| git config --global user.name "React Native Bot" | ||
| - name: Prepare artifacts | ||
| run: | | ||
| REACT_NATIVE_PKG=$(find /tmp/react-native-tmp -type f -name "*.tgz") | ||
| echo "React Native tgs is $REACT_NATIVE_PKG" | ||
|
|
||
| # For stable branches, we want to use the stable branch of the template | ||
| # In all the other cases, we want to use "main" | ||
| BRANCH=${{ github.ref_name }} | ||
| if ! [[ $BRANCH == *-stable* ]]; then | ||
| BRANCH=main | ||
| fi | ||
|
|
||
| node ./scripts/e2e/init-project-e2e.js --projectName RNTestProject --currentBranch $BRANCH --directory /tmp/RNTestProject --pathToLocalReactNative $REACT_NATIVE_PKG | ||
|
|
||
| cd /tmp/RNTestProject/ios | ||
| bundle install | ||
| NEW_ARCH_ENABLED=1 | ||
|
|
||
| export RCT_USE_LOCAL_RN_DEP=/tmp/third-party/ReactNativeDependencies${{ matrix.flavor }}.xcframework.tar.gz | ||
| # Disable prebuilds for now, as they are causing issues with E2E tests for 0.82-stable branch | ||
| export RCT_TESTONLY_RNCORE_TARBALL_PATH="/tmp/ReactCore/ReactCore${{ matrix.flavor }}.xcframework.tar.gz" | ||
| RCT_NEW_ARCH_ENABLED=$NEW_ARCH_ENABLED bundle exec pod install | ||
|
|
||
| xcodebuild \ | ||
| -scheme "RNTestProject" \ | ||
| -workspace RNTestProject.xcworkspace \ | ||
| -configuration "${{ matrix.flavor }}" \ | ||
| -sdk "iphonesimulator" \ | ||
| -destination "generic/platform=iOS Simulator" \ | ||
| -derivedDataPath "/tmp/RNTestProject" | ||
| - name: Run E2E Tests | ||
| uses: ./.github/actions/maestro-ios | ||
| with: | ||
| app-path: "/tmp/RNTestProject/Build/Products/${{ matrix.flavor }}-iphonesimulator/RNTestProject.app" | ||
| app-id: org.reactjs.native.example.RNTestProject | ||
| maestro-flow: ./scripts/e2e/.maestro/ | ||
| flavor: ${{ matrix.flavor }} | ||
| working-directory: /tmp/RNTestProject | ||
|
|
||
| report: | ||
Check warningCode scanning / CodeQL Workflow does not contain permissions Medium
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
|
||
|
github-advanced-security[bot] marked this conversation as resolved.
Fixed
|
||
| needs: test | ||
| if: always() | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| status: ${{ steps.check.outputs.status }} | ||
| steps: | ||
| - id: check | ||
| run: | | ||
| if [[ "${{ needs.test.result }}" == "failure" ]]; then | ||
| echo "status=failure" >> $GITHUB_OUTPUT | ||
| else | ||
| echo "status=success" >> $GITHUB_OUTPUT | ||
| fi | ||
Check warningCode scanning / CodeQL Workflow does not contain permissions Medium
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}
|
||
|
github-advanced-security[bot] marked this conversation as resolved.
Fixed
|
||
Uh oh!
There was an error while loading. Please reload this page.