Files
spacedrive/apps/mobile/scripts/run-maestro-tests
Utku 54a2eee827 Mobile CI with Tests (#631)
* stuff

* stuff (but for android)

* test mobile ci

* move pnpm up

* install ndk

* add ios & cleanup

* onboarding flow test

* test ci

* fixes, cleanup, caches

* why you do this cargo

* fix pnpm-lock

* add path to build rust script?

* ci is fun

* yolo

* fix broken flow..

* fix pnpm

* probably not gonna work

* test x2

* use real branch of pcr

* android emulator and try ios x2

* Use react native architectures, instead of all.

* override architecture to speed up android build

* protoc & build android on macos too

* fix java ndk

* android gradle

* disable ios for now

* use simulator sdk & debug configuration on ios build

* cleanup

* avd test

* fix avd settings.

* only build for x86_64 on ci

* Fix ios build

* Add IOS testing

* maestro script

* ios release build & wait for library creation

* clean up and disable android for now

* fix pnpm-lock

* Add concurrency to cancel previous runs

* fix pnpm-lock

---------

Co-authored-by: Brendan Allan <brendonovich@outlook.com>
2023-04-03 08:12:28 +00:00

50 lines
987 B
Bash

#!/bin/bash
trap 'exit' INT
PLATFORM=${1:-}
case $PLATFORM in
ios | android )
;;
*)
echo "Error! You must pass either 'android' or 'ios'"
echo ""
exit 1
;;
esac
# NOTE: This script is intended to be run from the root of the project (CI)
if [ "$PLATFORM" == "ios" ]; then
testFiles=$(ls apps/mobile/tests/*.yml apps/mobile/tests/ios-only/*.yml)
else
testFiles=$(ls apps/mobile/tests/*.yml apps/mobile/tests/android-only/*.yml)
fi
failedTests=()
for file in $testFiles
do
if ! maestro test "$file"
then
echo "Test ${file} failed. Retrying in 30 seconds..."
sleep 30
if ! maestro test "$file"
then
echo "Test ${file} failed again. Retrying for the last time in 120 seconds..."
sleep 120
if ! maestro test "$file"
then
failedTests+=("$file")
fi
fi
fi
done
if [ ${#failedTests[@]} -eq 0 ]; then
exit 0
else
echo "These tests failed:"
printf '%s\n' "${failedTests[@]}"
exit 1
fi