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:
@@ -1,5 +1,11 @@
|
||||
# Later
|
||||
|
||||
task deploy-android
|
||||
it is slow. First debug what is slow.
|
||||
What is the bottleneck?
|
||||
I see qemu with a lot of CPU load.
|
||||
Maybe giving the user more Linux permissions to run optimized qemu helps?
|
||||
|
||||
---
|
||||
|
||||
use si3e2e@thomas-guettler.de in tests.
|
||||
|
||||
+3
-1
@@ -200,7 +200,9 @@ tasks:
|
||||
_integrations:
|
||||
internal: true
|
||||
run: once
|
||||
deps: [integration, integration-ui]
|
||||
cmds:
|
||||
- task: integration
|
||||
- task: integration-ui
|
||||
|
||||
check:
|
||||
desc: Full check suite — unit tests first, then integration (merges coverage), then gate
|
||||
|
||||
@@ -26,6 +26,11 @@ id = "smtp"
|
||||
bind = ["127.0.0.1:1025"]
|
||||
protocol = "smtp"
|
||||
|
||||
[[server.listener]]
|
||||
id = "managesieve"
|
||||
bind = ["127.0.0.1:4190"]
|
||||
protocol = "managesieve"
|
||||
|
||||
[store."db"]
|
||||
type = "sqlite"
|
||||
path = "/tmp/stalwart-dev/data.sqlite"
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -19,20 +19,20 @@ 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"
|
||||
echo "No emulator running — booting AVD sharedinbox_test..."
|
||||
"$EMULATOR_BIN" -avd sharedinbox_test -no-audio -no-snapshot-save &
|
||||
for _i in $(seq 1 60); do
|
||||
"$EMULATOR_BIN" -avd sharedinbox_test -no-audio -no-snapshot-save -accel off &
|
||||
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; }
|
||||
"$ADB" -s "$EMULATOR_ID" wait-for-device
|
||||
for _i in $(seq 1 30); do
|
||||
for _i in $(seq 1 450); 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 900 s"; exit 1; }
|
||||
fi
|
||||
|
||||
echo "Using emulator: $EMULATOR_ID"
|
||||
|
||||
Reference in New Issue
Block a user