diff options
| author | Niklas Berglund <niklas.berglund@gmail.com> | 2024-08-20 16:28:16 +0200 |
|---|---|---|
| committer | Albin <albin@mullvad.net> | 2024-08-22 11:22:02 +0200 |
| commit | 05f4af68182f6d78a4e5fc1fe07514c328eb7e33 (patch) | |
| tree | 3fb34ba2b191992430cb56fbf6f44c25295f937c | |
| parent | e236c901a2325434ab77cb9f8cb005503e69ca22 (diff) | |
| download | mullvadvpn-05f4af68182f6d78a4e5fc1fe07514c328eb7e33.tar.xz mullvadvpn-05f4af68182f6d78a4e5fc1fe07514c328eb7e33.zip | |
Add repeat option for self hosted e2e tests
| -rw-r--r-- | .github/workflows/android-app.yml | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/.github/workflows/android-app.yml b/.github/workflows/android-app.yml index a8f76266eb..97ec390c9e 100644 --- a/.github/workflows/android-app.yml +++ b/.github/workflows/android-app.yml @@ -32,19 +32,20 @@ on: description: Override container image type: string required: false - run_e2e_tests: - description: Run e2e tests - type: boolean - required: false run_firebase_tests: description: Run firebase tests type: boolean required: false mockapi_test_repeat: - description: Mockapi test repeat + description: Mockapi test repeat(self hosted) default: '1' required: true type: string + e2e_test_repeat: + description: e2e test repeat(self hosted) + default: '0' + required: true + type: string # Build if main is updated to ensure up-to-date caches are available push: branches: [main] @@ -407,7 +408,6 @@ jobs: instrumented-tests: name: Run instrumented tests runs-on: [self-hosted, android-device] - timeout-minutes: 30 needs: [build-app, build-instrumented-tests] strategy: fail-fast: false @@ -423,6 +423,7 @@ jobs: - name: Prepare report dir if: ${{ matrix.test-repeat != 0 }} id: prepare-report-dir + timeout-minutes: 5 env: INNER_REPORT_DIR: /tmp/${{ matrix.test-type }}-${{ github.run_id }}-${{ github.run_attempt }} run: | @@ -471,11 +472,15 @@ jobs: name: Run instrumented e2e tests # Temporary workaround for targeting the runner android-runner-v1 runs-on: [self-hosted, android-device, android-emulator] - if: github.event_name == 'schedule' || github.event.inputs.run_e2e_tests == 'true' - timeout-minutes: 30 + if: github.event_name == 'schedule' || ${{ github.event.inputs.e2e_test_repeat }} != '0' needs: [build-app, build-instrumented-tests] + strategy: + matrix: + include: + - test-repeat: ${{ github.event.inputs.e2e_test_repeat || 1 }} steps: - name: Prepare report dir + if: ${{ matrix.test-repeat != 0 }} id: prepare-report-dir env: INNER_REPORT_DIR: /tmp/${{ github.run_id }}-${{ github.run_attempt }} @@ -484,21 +489,25 @@ jobs: echo "report_dir=$INNER_REPORT_DIR" >> $GITHUB_OUTPUT - name: Checkout repository + if: ${{ matrix.test-repeat != 0 }} uses: actions/checkout@v4 # Using v3 due to v4 being very slow for this artifact. - uses: actions/download-artifact@v3 + if: ${{ matrix.test-repeat != 0 }} with: name: apks path: android/app/build/outputs/apk # Using v3 due to v4 being very slow for this artifact. - uses: actions/download-artifact@v3 + if: ${{ matrix.test-repeat != 0 }} with: name: e2e-instrumentation-apks path: android/test/e2e/build/outputs/apk - name: Run instrumented test script + if: ${{ matrix.test-repeat != 0 }} shell: bash -ieo pipefail {0} env: AUTO_FETCH_TEST_HELPER_APKS: true @@ -509,7 +518,7 @@ jobs: INVALID_TEST_ACCOUNT_NUMBER: '0000000000000000' ENABLE_HIGHLY_RATE_LIMITED_TESTS: ${{ github.event_name == 'schedule' && 'true' || 'false' }} REPORT_DIR: ${{ steps.prepare-report-dir.outputs.report_dir }} - run: ./android/scripts/run-instrumented-tests.sh + run: ./android/scripts/run-instrumented-tests-repeat.sh ${{ matrix.test-repeat }} firebase-tests: name: Run firebase tests |
