android - jenkins uiautomator build always green -
so defined many uiautomatortestcase classes, each has 1 or 2 test cases @ most. use shell script on jenkins string these test cases series of tests, example:
adb shell uiautomator runtest mytest.jar -c com.mytest.testclass1 adb shell uiautomator runtest mytest.jar -c com.mytest.testclass2 adb shell uiautomator runtest mytest.jar -c com.mytest.testclass3 adb shell uiautomator runtest mytest.jar -c com.mytest.testclass4 ... on forth.
one of 2 (1/2) problems have jenkins builds, doesn't matter if of these test fails, jenkins shows green, need jenkins stop , shows red build.
the other (2/2) problem if app crashes in 1 of tests, say, testclass2, script try pick , continue executing. best method make script stop?
any suggestions? thanks
thanks @keepcalmandcarryon , daniel beck, solved problem 2 steps:
- log adb output
- grep keyword log
the code in shell script be:
#!bin/bash function punch() { "$@" | tee ${workspace}/adb_output.log [[ -z "$(grep 'failures!!!' ${workspace}/adb_output.log)" ]] || exit 1 } punch adb shell uiautomator runtest mytest.jar -c com.mytest.testclass1 punch adb shell uiautomator runtest mytest.jar -c com.mytest.testclass2 ...
Comments
Post a Comment