Skip to content

Commit

Permalink
Use stagemole with e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
niklasberglund committed Dec 6, 2024
1 parent 15fc4f9 commit 7180f37
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
22 changes: 17 additions & 5 deletions .github/workflows/android-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ on:
default: '0'
required: true
type: string
e2e_tests_infra_flavor:
description: Infra environment to run e2e tests on. If set to 'stagemole' test-related artefacts will be uploaded.
default: 'stagemole'
required: true
type: string
# Build if main is updated to ensure up-to-date caches are available
push:
branches: [main]
Expand Down Expand Up @@ -341,7 +346,7 @@ jobs:

- name: Build stagemole app
uses: burrunan/gradle-cache-action@v1
if: github.event.inputs.run_firebase_tests == 'true'
if: github.event.inputs.e2e_test_repeat != '0'
with:
job-id: jdk17
arguments: assemblePlayStagemoleDebug
Expand Down Expand Up @@ -526,7 +531,7 @@ jobs:

- name: Calculate timeout
id: calculate-timeout
run: echo "timeout=$(( ${{ matrix.test-repeat }} * 10 ))" >> $GITHUB_OUTPUT
run: echo "timeout=$(( ${{ matrix.test-repeat }} * 20 ))" >> $GITHUB_OUTPUT
shell: bash

- name: Run instrumented test script
Expand All @@ -536,15 +541,22 @@ jobs:
env:
AUTO_FETCH_TEST_HELPER_APKS: true
TEST_TYPE: e2e
BILLING_FLAVOR: oss
INFRA_FLAVOR: prod
VALID_TEST_ACCOUNT_NUMBER: ${{ secrets.ANDROID_PROD_TEST_ACCOUNT }}
BILLING_FLAVOR: play
INFRA_FLAVOR: ${{ github.event.inputs.e2e_tests_infra_flavor }}
PARTNER_AUTH: ${{ secrets.STAGEMOLE_PARTNER_AUTH }}
INVALID_TEST_ACCOUNT_NUMBER: '0000000000000000'
ENABLE_HIGHLY_RATE_LIMITED_TESTS: ${{ github.event_name == 'schedule' && 'true' || 'false' }}
ENABLE_ACCESS_TO_LOCAL_API_TESTS: true
REPORT_DIR: ${{ steps.prepare-report-dir.outputs.report_dir }}
run: ./android/scripts/run-instrumented-tests-repeat.sh ${{ matrix.test-repeat }}

- name: Upload e2e instrumentation report
uses: actions/upload-artifact@v4
if: always() && ${{ matrix.test-repeat != 0 }} && ${{ github.event.inputs.e2e_tests_infra_flavor == 'stagemole' }}
with:
name: e2e-instrumentation-report
path: ${{ steps.prepare-report-dir.outputs.report_dir }}

firebase-tests:
name: Run firebase tests
if: github.event.inputs.run_firebase_tests == 'true'
Expand Down
4 changes: 0 additions & 4 deletions android/scripts/run-instrumented-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,6 @@ case "$TEST_TYPE" in
echo ""
echo "Error: The 'e2e' test type with billing flavor 'play' require infra flavor 'stagemole'."
exit 1
elif [[ $BILLING_FLAVOR == "oss" && $INFRA_FLAVOR != "prod" ]]; then
echo ""
echo "Error: The 'e2e' test type with billing flavor 'oss' require infra flavor 'prod'."
exit 1
fi
OPTIONAL_TEST_ARGUMENTS=""
if [[ -n ${INVALID_TEST_ACCOUNT_NUMBER-} ]]; then
Expand Down

0 comments on commit 7180f37

Please sign in to comment.