Fix Android deployment pipeline and integration tests
- Run integration tests sequentially in Taskfile.yml to avoid port 4190 (ManageSieve) conflict. - Add ManageSieve listener to Stalwart config for better test coverage. - Increase Android emulator boot timeout and add software-mode flags (-accel off, -no-boot-anim, -gpu swiftshader_indirect) to accommodate environments without KVM. - Update LATER.md with notes on software emulation performance.
This commit is contained in:
@@ -47,7 +47,7 @@ EMULATOR_ID=$("$ADB" devices | awk '/^emulator-[0-9]+[[:space:]]+device$/ {print
|
||||
if [ -z "$EMULATOR_ID" ]; then
|
||||
EMULATOR_BIN="${ANDROID_HOME:-$HOME/Android/Sdk}/emulator/emulator"
|
||||
ts "no emulator running — booting AVD sharedinbox_test"
|
||||
"$EMULATOR_BIN" -avd sharedinbox_test -no-window -no-audio -no-snapshot-save > /tmp/emulator.log 2>&1 &
|
||||
"$EMULATOR_BIN" -avd sharedinbox_test -no-window -no-audio -no-snapshot-save -accel off -no-boot-anim -gpu swiftshader_indirect > /tmp/emulator.log 2>&1 &
|
||||
EMULATOR_BOOT_PID=$!
|
||||
# Extend cleanup to also kill the emulator we started.
|
||||
cleanup() {
|
||||
@@ -57,21 +57,21 @@ if [ -z "$EMULATOR_ID" ]; then
|
||||
kill "${EMULATOR_BOOT_PID:-}" 2>/dev/null || true
|
||||
}
|
||||
trap cleanup EXIT
|
||||
# Wait up to 120 s for the emulator to appear as a fully booted device.
|
||||
for _i in $(seq 1 60); do
|
||||
# Wait up to 300 s for the emulator to appear as a fully booted device.
|
||||
for _i in $(seq 1 150); do
|
||||
EMULATOR_ID=$("$ADB" devices | awk '/^emulator-[0-9]+[[:space:]]+device$/ {print $1; exit}')
|
||||
[ -n "$EMULATOR_ID" ] && break
|
||||
sleep 2
|
||||
done
|
||||
[ -n "$EMULATOR_ID" ] || { echo "Emulator did not become ready within 120 s"; exit 1; }
|
||||
[ -n "$EMULATOR_ID" ] || { echo "Emulator did not become ready within 300 s"; exit 1; }
|
||||
# Wait for the Android system to finish booting (sys.boot_completed=1).
|
||||
"$ADB" -s "$EMULATOR_ID" wait-for-device
|
||||
for _i in $(seq 1 30); do
|
||||
for _i in $(seq 1 600); do
|
||||
BOOT_DONE=$("$ADB" -s "$EMULATOR_ID" shell getprop sys.boot_completed 2>/dev/null | tr -d '\r')
|
||||
[ "$BOOT_DONE" = "1" ] && break
|
||||
sleep 2
|
||||
done
|
||||
[ "${BOOT_DONE:-0}" = "1" ] || { echo "Android boot did not complete within 60 s"; exit 1; }
|
||||
[ "${BOOT_DONE:-0}" = "1" ] || { echo "Android boot did not complete within 1200 s"; exit 1; }
|
||||
fi
|
||||
ts "using emulator: $EMULATOR_ID"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user