Skip to content

Commit 29f35f4

Browse files
committed
Skip completed Android E2E retries
1 parent e6fd007 commit 29f35f4

3 files changed

Lines changed: 24 additions & 0 deletions

File tree

.github/workflow-scripts/__tests__/maestro-android-test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,11 @@ describe('Maestro Android runner', () => {
2424
temporaryDirectory = fs.mkdtempSync(
2525
path.join(os.tmpdir(), 'maestro-android-test-'),
2626
);
27+
jest.spyOn(console, 'error').mockImplementation(() => {});
2728
});
2829

2930
afterEach(() => {
31+
jest.restoreAllMocks();
3032
fs.rmSync(temporaryDirectory, {recursive: true, force: true});
3133
});
3234

.github/workflows/e2e-android-rntester.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,19 @@ jobs:
4747
with:
4848
name: e2e_android_rntester_state_${{ matrix.flavor }}_x86_NewArch
4949
path: /tmp/maestro-android-state
50+
- name: Check for unfinished E2E flows
51+
id: test-state
52+
shell: bash
53+
run: |
54+
SHOULD_RUN=true
55+
if [[ -f /tmp/maestro-android-state/results.json ]] && \
56+
jq -e '(.flows | length > 0) and all(.flows[]; .status == "passed")' /tmp/maestro-android-state/results.json > /dev/null; then
57+
SHOULD_RUN=false
58+
fi
59+
echo "should-run=$SHOULD_RUN" >> "$GITHUB_OUTPUT"
5060
- name: Run E2E Tests
5161
id: run-tests
62+
if: steps.test-state.outputs.should-run == 'true'
5263
continue-on-error: true
5364
uses: ./.github/actions/maestro-android
5465
timeout-minutes: 90

.github/workflows/e2e-android-templateapp.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,19 @@ jobs:
8383
with:
8484
name: e2e_android_templateapp_state_${{ matrix.flavor }}_x86_NewArch
8585
path: /tmp/maestro-android-state
86+
- name: Check for unfinished E2E flows
87+
id: test-state
88+
shell: bash
89+
run: |
90+
SHOULD_RUN=true
91+
if [[ -f /tmp/maestro-android-state/results.json ]] && \
92+
jq -e '(.flows | length > 0) and all(.flows[]; .status == "passed")' /tmp/maestro-android-state/results.json > /dev/null; then
93+
SHOULD_RUN=false
94+
fi
95+
echo "should-run=$SHOULD_RUN" >> "$GITHUB_OUTPUT"
8696
- name: Run E2E Tests
8797
id: run-tests
98+
if: steps.test-state.outputs.should-run == 'true'
8899
continue-on-error: true
89100
uses: ./.github/actions/maestro-android
90101
timeout-minutes: 90

0 commit comments

Comments
 (0)