| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 5b8af35 commit 67c340d
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -25,7 +25,29 @@ jobs: | |||
| 25 | 25 | e2e-android: | |
| 26 | 26 | needs: coverage | |
| 27 | 27 | runs-on: ubuntu-latest | |
| 28 | - timeout-minutes: 60 | ||
| 28 | + timeout-minutes: 30 | ||
| 29 | + # GitHub-hosted Android emulators grow unstable after ~15 minutes of | ||
| 30 | + # sustained Maestro driving and start reporting "device offline" / | ||
| 31 | + # "device not found" mid-run (the emulator VM, not the app, dies). | ||
| 32 | + # The full 60-flow suite reliably crosses that threshold around the | ||
| 33 | + # ~35th flow. Sharding the run into a few balanced groups — each on | ||
| 34 | + # its own freshly booted emulator — keeps every session well under | ||
| 35 | + # the limit, and parallelizes the Android pass as a bonus. Groups are | ||
| 36 | + # sized so none exceeds ~25 flows; ``components`` is the largest | ||
| 37 | + # single category and runs alone. ``fail-fast: false`` so one shard's | ||
| 38 | + # failure still lets the others report. | ||
| 39 | + strategy: | ||
| 40 | + fail-fast: false | ||
| 41 | + matrix: | ||
| 42 | + include: | ||
| 43 | + - name: components | ||
| 44 | + suites: components | ||
| 45 | + - name: hooks-nav | ||
| 46 | + suites: hooks navigation | ||
| 47 | + - name: layout-styling-anim-misc | ||
| 48 | + suites: layout styling animations misc | ||
| 49 | + | ||
| 50 | + name: e2e-android (${{ matrix.name }}) | ||
| 29 | 51 | ||
| 30 | 52 | steps: | |
| 31 | 53 | - name: Checkout | |
@@ -61,7 +83,7 @@ jobs: | |||
| 61 | 83 | with: | |
| 62 | 84 | api-level: 31 | |
| 63 | 85 | arch: x86_64 | |
| 64 | - script: bash -lc "./scripts/run-e2e.sh android" | ||
| 86 | + script: bash -lc "./scripts/run-e2e.sh android ${{ matrix.suites }}" | ||
| 65 | 87 | ||
| 66 | 88 | e2e-ios: | |
| 67 | 89 | needs: coverage | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -5,17 +5,26 @@ | |||
| 5 | 5 | # full E2E pass locally. It mirrors what CI does in .github/workflows/e2e.yml. | |
| 6 | 6 | # | |
| 7 | 7 | # Usage: | |
| 8 | - # ./scripts/run-e2e.sh android [suite] | ||
| 9 | - # ./scripts/run-e2e.sh ios [suite] | ||
| 8 | + # ./scripts/run-e2e.sh android [suite ...] | ||
| 9 | + # ./scripts/run-e2e.sh ios [suite ...] | ||
| 10 | 10 | # | |
| 11 | 11 | # Examples: | |
| 12 | - # ./scripts/run-e2e.sh android # full suite | ||
| 13 | - # ./scripts/run-e2e.sh android components # only the components suite | ||
| 14 | - # ./scripts/run-e2e.sh ios hooks # only the hooks suite on iOS | ||
| 12 | + # ./scripts/run-e2e.sh android # full suite | ||
| 13 | + # ./scripts/run-e2e.sh android components # only the components suite | ||
| 14 | + # ./scripts/run-e2e.sh ios hooks # only the hooks suite on iOS | ||
| 15 | + # ./scripts/run-e2e.sh android hooks navigation # two categories, one session | ||
| 15 | 16 | # | |
| 16 | 17 | # Available suites: full, components, hooks, navigation, layout, styling, | |
| 17 | 18 | # animations, misc. | |
| 18 | 19 | # | |
| 20 | + # Multiple category suites can be passed at once; they run sequentially in | ||
| 21 | + # a single Maestro session (and against a single emulator/simulator boot). | ||
| 22 | + # CI uses this to shard the Android run into a few balanced groups so no | ||
| 23 | + # single emulator session has to survive the entire 60-flow marathon — | ||
| 24 | + # GitHub-hosted Android emulators grow unstable under ~15 minutes of | ||
| 25 | + # sustained Maestro driving and start reporting "device offline". See | ||
| 26 | + # .github/workflows/e2e.yml and tests/e2e/AGENTS.md. | ||
| 27 | + # | ||
| 19 | 28 | # Prerequisites: | |
| 20 | 29 | # - `pn` CLI available (e.g. via `pip install -e .`). | |
| 21 | 30 | # - `maestro` CLI on PATH (https://maestro.dev/). | |
@@ -24,9 +33,9 @@ | |||
| 24 | 33 | # | |
| 25 | 34 | # The script: | |
| 26 | 35 | # 1. Builds + installs the e2e-suite app via `pn run <platform> --no-logs`. | |
| 27 | - # 2. Picks the right Maestro YAML based on platform + suite. | ||
| 28 | - # 3. Runs `maestro test` up to ``MAESTRO_MAX_ATTEMPTS`` times (default | ||
| 29 | - # 2) and exits with the last attempt's exit code. | ||
| 36 | + # 2. Resolves each requested suite to its Maestro YAML target. | ||
| 37 | + # 3. Runs `maestro test` (over all targets) up to ``MAESTRO_MAX_ATTEMPTS`` | ||
| 38 | + # times (default 2) and exits with the last attempt's exit code. | ||
| 30 | 39 | # | |
| 31 | 40 | # A successful run prints "All E2E suites passed." at the end and exits 0. | |
| 32 | 41 | # Any failed flow is reported by Maestro in its standard format; see | |
@@ -39,7 +48,12 @@ ROOT_DIR="$(cd "$SCRIPT_DIR/.." && pwd)" | |||
| 39 | 48 | cd "$ROOT_DIR" | |
| 40 | 49 | ||
| 41 | 50 | PLATFORM="${1:-android}" | |
| 42 | - SUITE="${2:-full}" | ||
| 51 | + shift || true | ||
| 52 | + # Remaining args are suite names; default to the full aggregate suite. | ||
| 53 | + SUITES=("$@") | ||
| 54 | + if [[ ${#SUITES[@]} -eq 0 ]]; then | ||
| 55 | + SUITES=("full") | ||
| 56 | + fi | ||
| 43 | 57 | ||
| 44 | 58 | case "$PLATFORM" in | |
| 45 | 59 | android|ios) ;; | |
@@ -65,23 +79,29 @@ case "$PLATFORM" in | |||
| 65 | 79 | ios) APP_ID="com.pythonnative.ios-template" ;; | |
| 66 | 80 | esac | |
| 67 | 81 | ||
| 68 | - case "$SUITE" in | ||
| 69 | - full) | ||
| 70 | - if [[ "$PLATFORM" == "android" ]]; then | ||
| 71 | - MAESTRO_TARGET="tests/e2e/android.yaml" | ||
| 72 | - else | ||
| 73 | - MAESTRO_TARGET="tests/e2e/ios.yaml" | ||
| 74 | - fi | ||
| 75 | - ;; | ||
| 76 | - components|hooks|navigation|layout|styling|animations|misc) | ||
| 77 | - MAESTRO_TARGET="tests/e2e/suites/${SUITE}.yaml" | ||
| 78 | - ;; | ||
| 79 | - *) | ||
| 80 | - echo "Error: unknown suite '$SUITE'" >&2 | ||
| 81 | - echo "Available suites: full, components, hooks, navigation, layout, styling, animations, misc" >&2 | ||
| 82 | - exit 2 | ||
| 83 | - ;; | ||
| 84 | - esac | ||
| 82 | + # Resolve each requested suite to a Maestro YAML target. ``full`` expands | ||
| 83 | + # to the platform's master aggregate; the category names map to the | ||
| 84 | + # per-category suite files under tests/e2e/suites/. | ||
| 85 | + MAESTRO_TARGETS=() | ||
| 86 | + for suite in "${SUITES[@]}"; do | ||
| 87 | + case "$suite" in | ||
| 88 | + full) | ||
| 89 | + if [[ "$PLATFORM" == "android" ]]; then | ||
| 90 | + MAESTRO_TARGETS+=("tests/e2e/android.yaml") | ||
| 91 | + else | ||
| 92 | + MAESTRO_TARGETS+=("tests/e2e/ios.yaml") | ||
| 93 | + fi | ||
| 94 | + ;; | ||
| 95 | + components|hooks|navigation|layout|styling|animations|misc) | ||
| 96 | + MAESTRO_TARGETS+=("tests/e2e/suites/${suite}.yaml") | ||
| 97 | + ;; | ||
| 98 | + *) | ||
| 99 | + echo "Error: unknown suite '$suite'" >&2 | ||
| 100 | + echo "Available suites: full, components, hooks, navigation, layout, styling, animations, misc" >&2 | ||
| 101 | + exit 2 | ||
| 102 | + ;; | ||
| 103 | + esac | ||
| 104 | + done | ||
| 85 | 105 | ||
| 86 | 106 | printf "\n==> Building e2e-suite app for %s\n" "$PLATFORM" | |
| 87 | 107 | pushd examples/e2e-suite > /dev/null | |
@@ -90,13 +110,13 @@ popd > /dev/null | |||
| 90 | 110 | ||
| 91 | 111 | run_maestro() { | |
| 92 | 112 | if [[ "$PLATFORM" == "ios" ]]; then | |
| 93 | - maestro --platform ios test -e "APP_ID=$APP_ID" "$MAESTRO_TARGET" | ||
| 113 | + maestro --platform ios test -e "APP_ID=$APP_ID" "${MAESTRO_TARGETS[@]}" | ||
| 94 | 114 | else | |
| 95 | - maestro test -e "APP_ID=$APP_ID" "$MAESTRO_TARGET" | ||
| 115 | + maestro test -e "APP_ID=$APP_ID" "${MAESTRO_TARGETS[@]}" | ||
| 96 | 116 | fi | |
| 97 | 117 | } | |
| 98 | 118 | ||
| 99 | - printf "\n==> Running Maestro suite: %s\n" "$MAESTRO_TARGET" | ||
| 119 | + printf "\n==> Running Maestro suite(s): %s\n" "${MAESTRO_TARGETS[*]}" | ||
| 100 | 120 | ||
| 101 | 121 | # Maestro's iOS XCUITest driver occasionally loses its connection to the | |
| 102 | 122 | # app during long suites and surfaces transient "Application is not | |
| Back | FazBrowse Home | New Git URL |
0 commit comments