- Ajoute privacy-policy-v1.md et release-compliance-checklist.md - Ajoute documents QA gates #238-#243 - Ajoute scripts de validation repo-only et device runbooks - Prépare checklists exécutables avant upload Play fermé Ticket #261
130 lines
3.1 KiB
Bash
Executable File
130 lines
3.1 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
PROJECT_ROOT="/home/anthony/Documents/Projects/GameTime"
|
|
ARTIFACT_BASE="${ARTIFACT_BASE:-$PROJECT_ROOT/.ideai/artifacts/qa-device}"
|
|
PHONE_SERIAL="${PHONE_SERIAL:-}"
|
|
PACKAGE_NAME="${PACKAGE_NAME:-com.idea.gametime}"
|
|
|
|
usage() {
|
|
cat <<'EOF'
|
|
Usage:
|
|
./tool/qa_device_import_export_real.sh start
|
|
./tool/qa_device_import_export_real.sh stop <artifact_dir>
|
|
|
|
Environment:
|
|
PHONE_SERIAL Optional adb serial for the phone under test
|
|
ARTIFACT_BASE Optional artifact root
|
|
PACKAGE_NAME Optional Android package name (default: com.idea.gametime)
|
|
EOF
|
|
}
|
|
|
|
adb_cmd() {
|
|
if [[ -n "$PHONE_SERIAL" ]]; then
|
|
adb -s "$PHONE_SERIAL" "$@"
|
|
else
|
|
adb "$@"
|
|
fi
|
|
}
|
|
|
|
require_adb() {
|
|
command -v adb >/dev/null 2>&1 || {
|
|
echo "adb not found in PATH." >&2
|
|
exit 1
|
|
}
|
|
adb start-server >/dev/null
|
|
adb_cmd get-state >/dev/null 2>&1 || {
|
|
echo "No adb device available. Connect the phone or set PHONE_SERIAL." >&2
|
|
exit 1
|
|
}
|
|
}
|
|
|
|
timestamp() {
|
|
date -u +"%Y%m%dT%H%M%SZ"
|
|
}
|
|
|
|
start_capture() {
|
|
require_adb
|
|
local dir="$ARTIFACT_BASE/import-export-real-$(timestamp)"
|
|
mkdir -p "$dir"
|
|
|
|
adb devices -l >"$dir/adb-devices.txt"
|
|
adb_cmd shell getprop ro.build.fingerprint >"$dir/phone-build-fingerprint.txt"
|
|
adb_cmd shell dumpsys package "$PACKAGE_NAME" >"$dir/package-dumpsys-before.txt" || true
|
|
adb_cmd logcat -c
|
|
adb_cmd logcat -v threadtime >"$dir/logcat.txt" 2>&1 &
|
|
echo "$!" >"$dir/logcat.pid"
|
|
|
|
cat >"$dir/steps.md" <<EOF
|
|
# Import / export real-device QA
|
|
|
|
Date: $(date -u +"%Y-%m-%d %H:%M:%SZ")
|
|
Package: $PACKAGE_NAME
|
|
|
|
## Preconditions
|
|
- Fresh GameTime phone build installed on the connected Android device.
|
|
- At least one exercise, one program and one workout template available locally.
|
|
- File picker available on device.
|
|
|
|
## Manual flow
|
|
1. Open GameTime.
|
|
2. Go to the profile/settings surface exposing import/export.
|
|
3. Export local data and confirm a file is produced.
|
|
4. Record the exported filename and storage location.
|
|
5. Re-import the same file in merge mode and validate the expected result.
|
|
6. Re-import in replace-all mode only on a disposable dataset.
|
|
7. If relevant, try importing while an active workout exists and validate the expected refusal.
|
|
|
|
## Evidence to collect
|
|
- Screenshot(s) before export and after export confirmation.
|
|
- Exported filename and location.
|
|
- Screenshot(s) after merge import and replace-all import.
|
|
- Notes on any refusal caused by active workout protection.
|
|
EOF
|
|
|
|
echo "$dir"
|
|
}
|
|
|
|
stop_capture() {
|
|
local dir="${1:-}"
|
|
[[ -n "$dir" ]] || {
|
|
usage >&2
|
|
exit 2
|
|
}
|
|
require_adb
|
|
[[ -d "$dir" ]] || {
|
|
echo "Artifact directory not found: $dir" >&2
|
|
exit 1
|
|
}
|
|
|
|
[[ -f "$dir/logcat.pid" ]] && kill "$(cat "$dir/logcat.pid")" >/dev/null 2>&1 || true
|
|
adb_cmd shell dumpsys package "$PACKAGE_NAME" >"$dir/package-dumpsys-after.txt" || true
|
|
|
|
cat <<EOF
|
|
Import/export manual QA artifacts finalized in:
|
|
$dir
|
|
|
|
Archive expected:
|
|
- adb-devices.txt
|
|
- phone-build-fingerprint.txt
|
|
- package-dumpsys-before.txt
|
|
- package-dumpsys-after.txt
|
|
- logcat.txt
|
|
- steps.md
|
|
EOF
|
|
}
|
|
|
|
case "${1:-}" in
|
|
start)
|
|
start_capture
|
|
;;
|
|
stop)
|
|
shift
|
|
stop_capture "${1:-}"
|
|
;;
|
|
*)
|
|
usage
|
|
exit 2
|
|
;;
|
|
esac
|