Files
tmail-flutter/scripts/prebuild.sh
Dat Dang 3851df15c6 Patrol isolate Android tests (#4469)
* Patrol POC replace Firebase Test Lab with local Android emulator

Replace GCloud auth, Firebase Test Lab, and ngrok with a local Android AVD via
reactivecircus/android-emulator-runner on CI. The backend runs in Docker and is
reachable from the emulator at the QEMU host alias 10.0.2.2.

CI / scripts:
- Remove Google Cloud auth, Firebase run step, and ngrok tunnel
- Add KVM, Gradle, and AVD cache setup; shard tests across 4 parallel runners
- Scripts: drop ngrok, point jmap.properties to 10.0.2.2, manage cleanup via trap
- prebuild.sh: parallelize module builds, suppress noisy output
- provisioning.sh: parallelize james-cli/curl calls, fix hardcoded container IP

Backend reset for test isolation:
- Add backend-reset-server.py: HTTP server that restarts tmail-backend and
  re-runs provisioning on POST /reset, so each test starts with a clean state
- Add BackendResetClient.dart: Dart client called in patrolTearDown
- Reduce visibleTimeout 30s → 10s; allow insecure connections in debug mode

* Patrol POC fix flaky tests

Replace fixed pumpAndSettle delays with waitUntilVisible/waitUntilExists so
tests react to actual UI state rather than arbitrary timeouts.

- Add PatrolFileExtensions.toFileInfo() and use it in composer robot/scenario utils
- Guard MobileEditorWidget.dispose() under isIntegrationTesting to prevent teardown crash
- Fix scroll direction (AxisDirection.down) in calendar attendee button scroll
- Add scrollTo() before tap in label modal robot and edit-tag scenario
- Wait on EmailTileBuilder (not label name) after email provisioning — more reliable
- Inline image: wait for HtmlContentViewer to contain base64 data before asserting
- Use native platform wait for inline image in upload scenario
- Remove unnecessary Future.delayed and extra pumpAndSettle calls
- Pre-select English before switching language to ensure deterministic starting state
- Fix app_grid back-press sequence
2026-05-11 08:09:31 +07:00

41 lines
1.5 KiB
Bash
Executable File

#!/usr/bin/env bash
# fail if any commands fails
set -e
echo "Prebuild started..."
# Add additional modules to the end of this, seperated by space
modules=("core" "model" "contact" "forward" "rule_filter" "fcm" "email_recovery" "server_settings" "scribe" "labels")
for mod in "${modules[@]}"; do
(
cd "$mod"
flutter pub get > /dev/null 2>&1
dart run build_runner build --delete-conflicting-outputs > /dev/null 2>&1
echo "[$mod] Done."
)
done
# For Cozy
cd cozy
flutter pub get
cd ../
echo "[cozy] Done."
# For the parent module
flutter pub get > /dev/null 2>&1
dart run build_runner build --delete-conflicting-outputs > /dev/null 2>&1 &&
dart run intl_generator:extract_to_arb --output-dir=./lib/l10n lib/main/localizations/app_localizations.dart > /dev/null 2>&1 &&
dart run intl_generator:generate_from_arb --output-dir=lib/l10n --no-use-deferred-loading lib/main/localizations/app_localizations.dart lib/l10n/intl*.arb > /dev/null 2>&1
echo "[root] Done."
# For scribe module localizations
echo "[scribe/l10n] Starting..."
(
cd scribe
dart run intl_generator:extract_to_arb --output-dir=./lib/scribe/ai/l10n lib/scribe/ai/localizations/scribe_localizations.dart > /dev/null 2>&1 &&
dart run intl_generator:generate_from_arb --output-dir=lib/scribe/ai/l10n --no-use-deferred-loading lib/scribe/ai/localizations/scribe_localizations.dart lib/scribe/ai/l10n/intl*.arb > /dev/null 2>&1
)
echo "[scribe/l10n] Done."
echo "Prebuild finished."