@@ -133,6 +133,9 @@ android_test() {
133133 log_error " Some $size instrumented tests failed."
134134 log_error " Saving logcat: $OUT_LOGCAT ..."
135135 $ADB logcat -d > $OUT_LOGCAT
136+ log_error " Fetching test screenshots..."
137+ $ADB pull /sdcard/Android/data/${PACKAGE_NAME} /files/test-screenshots ${ANDROID_OUTPUTS_DIR} /
138+ $ADB shell rm -r /sdcard/Android/data/${PACKAGE_NAME} /files/test-screenshots/
136139 return 1
137140 fi
138141 log_info " $size tests passed."
@@ -198,13 +201,6 @@ android_build() {
198201 return 0
199202}
200203
201- android_fetch_images () {
202- log_info " Fetching images"
203- rm -rf ${ANDROID_OUTPUTS_DIR} /test-screenshots
204- $ADB pull /sdcard/Android/data/${PACKAGE_NAME} /files/test-screenshots ${ANDROID_OUTPUTS_DIR} /
205- $ADB shell rm -r /sdcard/Android/data/${PACKAGE_NAME} /files/test-screenshots/
206- }
207-
208204android_accept_images () {
209205 find ${ANDROID_OUTPUTS_DIR} /test-screenshots -name ' *.expected*' -delete
210206 rsync -av ${ANDROID_OUTPUTS_DIR} /test-screenshots/ uhabits-android/src/androidTest/assets/
@@ -233,18 +229,14 @@ CI/CD script for Loop Habit Tracker.
233229
234230Usage:
235231 build.sh build [options]
236- build.sh clean [options]
237232 build.sh android-tests <API> [options]
238233 build.sh android-tests-parallel <API> <API>... [options]
239- build.sh android-fetch-images [options]
240234 build.sh android-accept-images [options]
241235
242236Commands:
243237 build Build the app and run small tests
244- clean Remove all build directories
245238 android-tests Run medium and large Android tests on an emulator
246239 android-tests-parallel Tests multiple API levels simultaneously
247- android-fetch-images Fetch failed view test images from device
248240 android-accept-images Copy fetched images to corresponding assets folder
249241
250242Options:
@@ -274,12 +266,10 @@ main() {
274266 case " $1 " in
275267 build)
276268 shift ; _parse_opts " $@ "
269+ clean
277270 core_build
278271 android_build
279272 ;;
280- clean)
281- clean
282- ;;
283273 android-tests)
284274 shift ; _parse_opts " $@ "
285275 if [ -z $1 ]; then
@@ -297,9 +287,6 @@ main() {
297287 shift ; _parse_opts " $@ "
298288 android_test_parallel $*
299289 ;;
300- android-fetch-images)
301- android_fetch_images
302- ;;
303290 android-accept-images)
304291 android_accept_images
305292 ;;
0 commit comments