Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 74 additions & 3 deletions .github/workflows/collection-native-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,26 @@ name: Collection native candidate tests
on:
workflow_dispatch:
inputs:
platform:
description: Choose the native journey to run
type: choice
required: true
options: [android, ios]
default: android
candidate_run_id:
description: GitHub Actions run containing a candidate APK built from this exact SHA
required: false
artifact_name:
description: Artifact containing one standalone APK with localhost HTTP enabled for the fixture API
required: false
pull_request:
types: [ready_for_review]
branches: [main]
paths:
- .github/workflows/collection-native-tests.yml
- apps/collection/scripts/test-native-ios.sh
- apps/collection/scripts/check-native-ios-ledger.mjs
- apps/collection/test/native/ios-ledger.test.mjs
permissions:
contents: read
actions: read
Expand All @@ -16,21 +30,37 @@ defaults:
shell: bash
jobs:
validate:
if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.id == github.event.repository.id) }}
permissions:
contents: read
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
persist-credentials: false
- name: Test native input and state assertion guards
if: github.event_name == 'workflow_dispatch'
run: python3 -m unittest discover -s apps/collection/test/native -p '*_test.py'
- env:
- name: Test iOS outage and retry evidence checks
if: github.event_name == 'pull_request' || inputs.platform == 'ios'
run: node --test apps/collection/test/native/ios-ledger.test.mjs
- if: github.event_name == 'workflow_dispatch'
env:
PLATFORM: ${{ inputs.platform }}
RUN_ID: ${{ inputs.candidate_run_id }}
ARTIFACT: ${{ inputs.artifact_name }}
run: |
if [[ "$PLATFORM" == ios && ( -n "$RUN_ID" || -n "$ARTIFACT" ) ]]; then
echo "The iOS simulator builds its own synthetic candidate; APK inputs are Android-only."
exit 1
fi
if [[ -n "$RUN_ID" || -n "$ARTIFACT" ]]; then
[[ "$RUN_ID" =~ ^[0-9]+$ ]] && test -n "$ARTIFACT"
fi
build:
needs: validate
if: inputs.candidate_run_id == '' && inputs.artifact_name == ''
if: github.event_name == 'workflow_dispatch' && inputs.platform == 'android' && inputs.candidate_run_id == '' && inputs.artifact_name == ''
runs-on: ubuntu-24.04
timeout-minutes: 45
steps:
Expand Down Expand Up @@ -64,7 +94,7 @@ jobs:
retention-days: 14
android:
needs: [validate, build]
if: ${{ always() && needs.validate.result == 'success' && (needs.build.result == 'success' || (needs.build.result == 'skipped' && inputs.candidate_run_id != '' && inputs.artifact_name != '')) }}
if: ${{ always() && github.event_name == 'workflow_dispatch' && inputs.platform == 'android' && needs.validate.result == 'success' && (needs.build.result == 'success' || (needs.build.result == 'skipped' && inputs.candidate_run_id != '' && inputs.artifact_name != '')) }}
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
Expand Down Expand Up @@ -127,3 +157,44 @@ jobs:
name: collection-native-results-${{ github.sha }}
path: apps/collection/.maestro/results/
retention-days: 14
ios:
needs: validate
if: ${{ (github.event_name == 'workflow_dispatch' && inputs.platform == 'ios') || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.id == github.event.repository.id) }}
# Official GitHub-hosted public preview. Actionlint 1.7.12's static label
# list predates it, so keep the published label as a fixed expression.
runs-on: ${{ 'xcode-27' }}
permissions:
contents: read
env:
LOVAT_EXPECTED_SOURCE_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
timeout-minutes: 60
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
with:
ref: ${{ env.LOVAT_EXPECTED_SOURCE_SHA }}
persist-credentials: false
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: 24.6.0
- uses: actions/setup-java@cf277c60eb25467037889841efdb72551f06f6c3 # v4.9.1
with:
distribution: temurin
java-version: 17
- run: npm ci
working-directory: apps/collection
- name: Install pinned Maestro
run: |
curl --fail --location --max-time 180 https://github.com/mobile-dev-inc/maestro/releases/download/cli-2.12.1/maestro.zip -o "$RUNNER_TEMP/maestro-ios.zip"
unzip -q "$RUNNER_TEMP/maestro-ios.zip" -d "$RUNNER_TEMP"
echo "$RUNNER_TEMP/maestro/bin" >> "$GITHUB_PATH"
- name: Build and exercise the installed simulator candidate
timeout-minutes: 50
env:
LOVAT_DISPOSABLE_BUILD: "1"
run: bash apps/collection/scripts/test-native-ios.sh
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
if: always()
with:
name: collection-native-ios-results-${{ env.LOVAT_EXPECTED_SOURCE_SHA }}
path: apps/collection/.maestro/results/ios/
retention-days: 14
45 changes: 40 additions & 5 deletions apps/collection/.maestro/bootstrap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,44 @@ appId: com.frc8033.lovatcollection
- launchApp:
clearState: true
- openLink: "lovat-collection://set-url?u=http%3A%2F%2F127.0.0.1%3A9877"
- tapOn:
text: "OK"
optional: true
# The first-use handoff can take longer to appear than runFlow's condition wait.
- runFlow:
when:
platform: iOS
commands:
- extendedWaitUntil:
visible: '^(Open in [“"]Collection[”"][?]|API URL updated)$'
timeout: 30000
- runFlow:
when:
visible: '^Open in [“"]Collection[”"][?]$'
commands:
- tapOn: "^Open$"
# iOS can dismiss the handoff without surfacing the route's alert.
# Give the first delivery time, then resend only from the welcome screen.
- extendedWaitUntil:
visible: "^API URL updated$"
timeout: 3000
optional: true
- runFlow:
when:
visible: "^Begin$"
notVisible: '^(Open in [“"]Collection[”"][?]|API URL updated)$'
commands:
- openLink: "lovat-collection://set-url?u=http%3A%2F%2F127.0.0.1%3A9877"
- extendedWaitUntil:
visible: "^API URL updated$"
timeout: 30000
- tapOn: "^OK$"
- assertNotVisible: "^API URL updated$"
- assertVisible: "^Begin$"
- runFlow:
when:
platform: Android
commands:
- tapOn:
text: "OK"
optional: true
- tapOn: "Begin"
- tapOn: "Code"
- inputText: "SYNTHETIC"
Expand All @@ -15,7 +50,7 @@ appId: com.frc8033.lovatcollection
timeout: 20000
- tapOn: "Synthetic Scout"
- extendedWaitUntil:
visible: "2026 Synthetic Event"
visible: "^2026 Synthetic Event(, Local fixture)?$"
timeout: 20000
- tapOn: "2026 Synthetic Event"
- tapOn: "^2026 Synthetic Event(, Local fixture)?$"
- assertVisible: "Scout this match"
6 changes: 6 additions & 0 deletions apps/collection/.maestro/end-match.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,9 @@ appId: com.frc8033.lovatcollection
---
- tapOn: "End match"
- tapOn: "End match"
# Match controls are landscape; the post-match form uses portrait.
- runFlow:
when:
platform: iOS
commands:
- setOrientation: PORTRAIT
6 changes: 6 additions & 0 deletions apps/collection/.maestro/enter-game.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
appId: com.frc8033.lovatcollection
---
- tapOn: "Scout this match"
# On iOS the app rotates its interface, but XCUITest can remain in portrait.
- runFlow:
when:
platform: iOS
commands:
- setOrientation: LANDSCAPE_LEFT
- extendedWaitUntil:
visible: "Start position Hub"
timeout: 20000
Expand Down
14 changes: 12 additions & 2 deletions apps/collection/.maestro/offline-restart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@ appId: com.frc8033.lovatcollection
- launchApp:
clearState: false
- tapOn: "history"
- tapOn:
text: ".*1234.*"
- runFlow:
when:
platform: Android
commands:
- tapOn:
text: ".*1234.*"
- runFlow:
when:
platform: iOS
commands:
- tapOn: "^(Qualifier 1, )?1234 • .+$"
- assertVisible: "^1234 in Q1$"
- assertVisible: "Upload"
19 changes: 17 additions & 2 deletions apps/collection/.maestro/reconnect.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
appId: com.frc8033.lovatcollection
---
- runFlow:
when:
platform: iOS
commands:
- assertVisible: "^1234 in Q1$"
- tapOn: "Upload"
- extendedWaitUntil:
notVisible: "Uploading"
Expand All @@ -9,8 +14,18 @@ appId: com.frc8033.lovatcollection
- launchApp:
clearState: false
- tapOn: "history"
- tapOn:
text: ".*1234.*"
- runFlow:
when:
platform: Android
commands:
- tapOn:
text: ".*1234.*"
- runFlow:
when:
platform: iOS
commands:
- tapOn: "^(Qualifier 1, )?1234 • .+$"
- assertVisible: "^1234 in Q1$"
- assertNotVisible: "Upload"
- tapOn: "Back"
- tapOn: "Back"
Expand Down
2 changes: 1 addition & 1 deletion apps/collection/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ Tests execute real Zustand stores, AsyncStorage persistence, report serializatio

The manual **Collection native candidate tests** workflow can build a fresh standalone synthetic Android APK when both inputs
are empty, or accepts an APK artifact run/name and requires that artifact's source SHA to match the selected workflow revision. A failed native flow fails the workflow and retains JUnit/logs. It is a candidate/release check, not a required PR test until Android build stability is proven (LVT-217). The test build runs locally on GitHub with template test signing and loopback-only
fixture networking; it does not start cloud builds or publish releases. Use the existing `native-smoke-ios` EAS simulator profile for iOS candidates; run the same flows with a reachable local fixture, omitting Android airplane/ADB commands. iOS has no simulator airplane mode.
fixture networking; it does not start EAS builds or publish releases. Select `platform: ios` with no APK inputs to build and run the same journey on a clean GitHub iOS simulator. The simulator verifies a loopback API outage and app restart, not physical airplane mode, camera/QR or signed-device acceptance.

Before a release, the release owner must run the candidate checks and record the build SHA/version, then manually verify camera permission grant/deny, physical-device multi-code QR transfer, background/restart persistence, and the iOS system/browser permission prompts. Unit/component tests do not claim to validate native camera, signing, installation or permissions. Native flows require a candidate device/build and are documented separately from the automated Pages suite. Related: LVT-259/260/261/262 and LVT-273.

Expand Down
37 changes: 22 additions & 15 deletions apps/collection/docs/manual-release-checks.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,24 @@ The Android runner verifies airplane/offline, real process restart, saved Histor
reconnect/retry and one preserved UUID. Failures remain failures, with diagnostics.
Do not use a personal device: bootstrap intentionally clears app storage.

For iOS, build the existing `native-smoke-ios` EAS simulator profile with Xcode 27
from that same source SHA, record the run URL, version and artifact hash, install
on a disposable simulator, and run `.maestro/bootstrap.yaml`,
`.maestro/enter-game.yaml`, `.maestro/record-match.yaml`, `.maestro/end-match.yaml`,
`.maestro/offline-restart.yaml` and `.maestro/reconnect.yaml` in that order,
each in a separate Maestro invocation against the synthetic fixture
(`node test/native/fixture-api.mjs`). Stop the fixture before `enter-game.yaml`
and restart it before reconnect; iOS simulators have no airplane-mode API.
Retain Maestro JUnit/screenshots and the fixture submission ledger. This iOS
procedure is a pending operator check until its actual build/run evidence is
attached; a build profile alone is not a passed native test. Physical-device
rows above still apply after a simulator pass.
For iOS, dispatch the same workflow with `platform: ios` and leave the APK
inputs blank. It builds an unsigned, standalone app at the selected SHA and
installs it on a fresh iOS 27 simulator. The app records a synthetic report
while the loopback fixture is stopped, shows the upload failure and retains
the report across a process restart. Reconnect must submit exactly once with
the same UUID recorded before the outage. Retain the run, build hashes,
Maestro JUnit, screenshots and fixture ledger.

The [GitHub Xcode 27 runner](https://github.com/actions/runner-images/blob/main/README.md)
is a public preview; runner availability is not a pass. This proves a
simulator endpoint outage and restart, not airplane mode, local-network
permission prompts, camera/QR transfer or a signed install/upgrade. Those
physical-device rows still apply even after a simulator pass.

For changes to the iOS harness, marking a same-repository PR ready for
review can also run the iOS job against its exact head commit. This is
optional evidence, not a required PR check; it never starts Android and
does not rerun on every push. A release candidate still needs its own run.

On Android CI, `scripts/prepare-native-android.py` runs before the shared
`record-match.yaml` and `end-match.yaml` Maestro flows. It acknowledges only
Expand All @@ -86,6 +92,7 @@ assertion. Outpost intake exists in every phase, so the flow does not race the
real Auto timer. Failed idle capture cannot reuse an old snapshot. Each stage
retains its JUnit result and diagnostics.

If CI cannot boot/install, attach its failure and run the same journey on a
physical test device. Record that separate result explicitly. Attach redacted
synthetic screenshots only; never publish real notes, strategy or login tokens.
If CI cannot boot/install, keep the simulator check pending and attach its
failure. Run and record the appropriate physical-device matrix separately.
Attach redacted synthetic screenshots only; never publish real notes,
strategy or login tokens.
8 changes: 4 additions & 4 deletions apps/collection/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion apps/collection/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"@react-native-async-storage/async-storage": "2.2.0",
"@react-native-community/datetimepicker": "9.2.1",
"@react-native-community/slider": "5.2.1",
"@react-native-menu/menu": "^2.0.0",
"@react-native-menu/menu": "2.1.2",
"@react-native-picker/picker": "2.11.4",
"@types/react": "~19.3.0",
"expo": "~58.0.26",
Expand Down
12 changes: 0 additions & 12 deletions apps/collection/patches/@react-native-menu+menu+2.0.0.patch

This file was deleted.

Loading
Loading