32
32
description : Override container image
33
33
type : string
34
34
required : false
35
- run_e2e_tests :
36
- description : Run e2e tests
37
- type : boolean
38
- required : false
39
35
run_firebase_tests :
40
36
description : Run firebase tests
41
37
type : boolean
42
38
required : false
43
39
mockapi_test_repeat :
44
- description : Mockapi test repeat
40
+ description : Mockapi test repeat(self hosted)
45
41
default : ' 1'
46
42
required : true
47
43
type : string
44
+ e2e_test_repeat :
45
+ description : e2e test repeat(self hosted)
46
+ default : ' 0'
47
+ required : true
48
+ type : string
48
49
# Build if main is updated to ensure up-to-date caches are available
49
50
push :
50
51
branches : [main]
@@ -407,7 +408,6 @@ jobs:
407
408
instrumented-tests :
408
409
name : Run instrumented tests
409
410
runs-on : [self-hosted, android-device]
410
- timeout-minutes : 30
411
411
needs : [build-app, build-instrumented-tests]
412
412
strategy :
413
413
fail-fast : false
@@ -447,8 +447,14 @@ jobs:
447
447
name : ${{ matrix.test-type }}-instrumentation-apks
448
448
path : ${{ matrix.path }}
449
449
450
+ - name : Calculate timeout
451
+ id : calculate-timeout
452
+ run : echo "timeout=$(( ${{ matrix.test-repeat }} * 10 ))" >> $GITHUB_OUTPUT
453
+ shell : bash
454
+
450
455
- name : Run instrumented test script
451
456
if : ${{ matrix.test-repeat != 0 }}
457
+ timeout-minutes : ${{ fromJSON(steps.calculate-timeout.outputs.timeout) }}
452
458
shell : bash -ieo pipefail {0}
453
459
env :
454
460
AUTO_FETCH_TEST_HELPER_APKS : true
@@ -471,11 +477,15 @@ jobs:
471
477
name : Run instrumented e2e tests
472
478
# Temporary workaround for targeting the runner android-runner-v1
473
479
runs-on : [self-hosted, android-device, android-emulator]
474
- if : github.event_name == 'schedule' || github.event.inputs.run_e2e_tests == 'true'
475
- timeout-minutes : 30
480
+ if : github.event_name == 'schedule' || ${{ github.event.inputs.e2e_test_repeat }} != '0'
476
481
needs : [build-app, build-instrumented-tests]
482
+ strategy :
483
+ matrix :
484
+ include :
485
+ - test-repeat : ${{ github.event.inputs.e2e_test_repeat || 1 }}
477
486
steps :
478
487
- name : Prepare report dir
488
+ if : ${{ matrix.test-repeat != 0 }}
479
489
id : prepare-report-dir
480
490
env :
481
491
INNER_REPORT_DIR : /tmp/${{ github.run_id }}-${{ github.run_attempt }}
@@ -484,21 +494,31 @@ jobs:
484
494
echo "report_dir=$INNER_REPORT_DIR" >> $GITHUB_OUTPUT
485
495
486
496
- name : Checkout repository
497
+ if : ${{ matrix.test-repeat != 0 }}
487
498
uses : actions/checkout@v4
488
499
489
500
# Using v3 due to v4 being very slow for this artifact.
490
501
- uses : actions/download-artifact@v3
502
+ if : ${{ matrix.test-repeat != 0 }}
491
503
with :
492
504
name : apks
493
505
path : android/app/build/outputs/apk
494
506
495
507
# Using v3 due to v4 being very slow for this artifact.
496
508
- uses : actions/download-artifact@v3
509
+ if : ${{ matrix.test-repeat != 0 }}
497
510
with :
498
511
name : e2e-instrumentation-apks
499
512
path : android/test/e2e/build/outputs/apk
500
513
514
+ - name : Calculate timeout
515
+ id : calculate-timeout
516
+ run : echo "timeout=$(( ${{ matrix.test-repeat }} * 10 ))" >> $GITHUB_OUTPUT
517
+ shell : bash
518
+
501
519
- name : Run instrumented test script
520
+ if : ${{ matrix.test-repeat != 0 }}
521
+ timeout-minutes : ${{ fromJSON(steps.calculate-timeout.outputs.timeout) }}
502
522
shell : bash -ieo pipefail {0}
503
523
env :
504
524
AUTO_FETCH_TEST_HELPER_APKS : true
@@ -509,7 +529,7 @@ jobs:
509
529
INVALID_TEST_ACCOUNT_NUMBER : ' 0000000000000000'
510
530
ENABLE_HIGHLY_RATE_LIMITED_TESTS : ${{ github.event_name == 'schedule' && 'true' || 'false' }}
511
531
REPORT_DIR : ${{ steps.prepare-report-dir.outputs.report_dir }}
512
- run : ./android/scripts/run-instrumented-tests.sh
532
+ run : ./android/scripts/run-instrumented-tests-repeat .sh ${{ matrix.test-repeat }}
513
533
514
534
firebase-tests :
515
535
name : Run firebase tests
0 commit comments