Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(371)

Unified Diff: build/android/buildbot/buildbot_functions.sh

Issue 10993069: Adds AndroidWebView and ChromiumTestShell tests to the Android FYI bot. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed Isaac's comments. Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/android/adb_install_content_shell ('k') | build/android/pylib/test_options_parser.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/buildbot/buildbot_functions.sh
diff --git a/build/android/buildbot/buildbot_functions.sh b/build/android/buildbot/buildbot_functions.sh
index 25e89c40a82f98eaf69a4cf47b791dd935c712bd..3a6ee846776604d341b222f4a530353dc7246d9b 100755
--- a/build/android/buildbot/buildbot_functions.sh
+++ b/build/android/buildbot/buildbot_functions.sh
@@ -207,29 +207,44 @@ function bb_run_unit_tests {
build/android/run_tests.py --xvfb --verbose
}
-# Run instrumentation test.
+# Run a buildbot step and handle failure.
+function bb_run_step {
+ (
+ set +e
+ "$@"
+ if [[ $? != 0 ]]; then
+ echo "@@@STEP_FAILURE@@@"
+ fi
+ )
+}
+
+# Run instrumentation tests for a specific APK.
# Args:
-# $1: TEST_APK.
-# $2: EXTRA_FLAGS to be passed to run_instrumentation_tests.py.
-function bb_run_instrumentation_test {
- local TEST_APK=${1}
- local EXTRA_FLAGS=${2}
- local INSTRUMENTATION_FLAGS="-vvv"
- INSTRUMENTATION_FLAGS+=" --test-apk ${TEST_APK}"
- INSTRUMENTATION_FLAGS+=" ${EXTRA_FLAGS}"
- build/android/run_instrumentation_tests.py ${INSTRUMENTATION_FLAGS}
+# $1: APK to be installed.
+# $2: APK_PACKAGE for the APK to be installed.
+# $3: TEST_APK to run the tests against.
+function bb_run_all_instrumentation_tests_for_apk {
+ local APK=${1}
+ local APK_PACKAGE=${2}
+ local TEST_APK=${3}
+
+ # Install application APK.
+ python build/android/adb_install_apk.py --apk ${APK} \
+ --apk_package ${APK_PACKAGE}
+
+ # Run instrumentation tests. Using -I to install the test apk.
+ bb_run_step python build/android/run_instrumentation_tests.py \
+ -vvv --test-apk ${TEST_APK} -I
}
-# Run content shell instrumentation test on device.
+# Run instrumentation tests for all relevant APKs on device.
function bb_run_instrumentation_tests {
- build/android/adb_install_content_shell
- local TEST_APK="ContentShellTest"
- # Use -I to install the test apk only on the first run.
- # TODO(bulach): remove the second once we have a Smoke test.
- bb_run_instrumentation_test ${TEST_APK} "-I -A Smoke"
- bb_run_instrumentation_test ${TEST_APK} "-I -A SmallTest"
- bb_run_instrumentation_test ${TEST_APK} "-A MediumTest"
- bb_run_instrumentation_test ${TEST_APK} "-A LargeTest"
+ bb_run_all_instrumentation_tests_for_apk "ContentShell-debug.apk" \
+ "org.chromium.content_shell" "ContentShellTest"
+ bb_run_all_instrumentation_tests_for_apk "ChromiumTestShell-debug.apk" \
+ "org.chromium.chrome.browser" "ChromiumTestShellTest"
+ bb_run_all_instrumentation_tests_for_apk "AndroidWebView-debug.apk" \
+ "org.chromium.android_webview" "AndroidWebViewTest"
}
# Zip and archive a build.
« no previous file with comments | « build/android/adb_install_content_shell ('k') | build/android/pylib/test_options_parser.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698