summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorjrg@google.com <jrg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-20 19:59:10 +0000
committerjrg@google.com <jrg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-20 19:59:10 +0000
commitfc2d49edd503f005b87de67c3fe0c317a6e43afd (patch)
treeae5f96c13f50c584a1e0f2686fb6e035044115f2 /build
parentb62986f02d8017d33f3caf4ffe1b5ca228375122 (diff)
downloadchromium_src-fc2d49edd503f005b87de67c3fe0c317a6e43afd.zip
chromium_src-fc2d49edd503f005b87de67c3fe0c317a6e43afd.tar.gz
chromium_src-fc2d49edd503f005b87de67c3fe0c317a6e43afd.tar.bz2
Android buildbot refactor.
Add distinct entry points for each type of chromium android buildbot. Make it super-ez for a sheriff to disable (force green) any of them. BUG=None TEST= Review URL: https://chromiumcodereview.appspot.com/9249030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118471 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build')
-rwxr-xr-xbuild/android/buildbot.sh91
-rwxr-xr-xbuild/android/buildbot_functions.sh105
-rwxr-xr-xbuild/android/buildbot_fyi.sh20
-rwxr-xr-xbuild/android/buildbot_main.sh18
-rwxr-xr-xbuild/android/buildbot_try_compile.sh16
-rwxr-xr-xbuild/android/buildbot_try_compile_test.sh17
6 files changed, 185 insertions, 82 deletions
diff --git a/build/android/buildbot.sh b/build/android/buildbot.sh
index f4d1844..43d7853 100755
--- a/build/android/buildbot.sh
+++ b/build/android/buildbot.sh
@@ -1,89 +1,16 @@
-#!/bin/bash
-# Copyright (c) 2011 The Chromium Authors. All rights reserved.
+#!/bin/bash -ex
+# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
-# "compile and run tests" script for the android build of chromium.
-# Intended for use by buildbot.
-# At this time, we only have one bot which is both a builder and
-# tester. Script assumes it runs in the "build" directory.
-#
-# This script uses buildbot "Annotator" style for steps.
-# This script does not sync the source tree.
-
-set -e
-set -x
+# Currently used as the entry point by both trybot and FYI bot.
+# TODO(jrg): redirect those bots to buildbot_try_compile.sh and
+# buildbot_fyi.sh, then delete this file.
-# Options in this script.
-BUILD_EXPERIMENTAL_TARGETS=1
-RUN_TESTS=1
-NEED_CLOBBER=0
-JOBS=4 # make -j"${JOBS}"
-# If we are a trybot, disable experimental targets and tests. We
-# eventually want tests on a trybot but emulator launch/restart is not
-# reliable enough yet.
-# TODO(jrg): when setting up a trybot, make sure to add TRYBOT=1 in
-# the environment.
+ROOT=$(cd "$(dirname $0)"; pwd)
if [ "${TRYBOT:-0}" = 1 ] ; then
- echo "Disabling experimental builds and tests since we are a trybot."
- BUILD_EXPERIMENTAL_TARGETS=0
- RUN_TESTS=0
+ exec $ROOT/buildbot_try_compile.sh
+else
+ exec $ROOT/buildbot_fyi.sh
fi
-
-echo "@@@BUILD_STEP cd into source root@@@"
-SRC_ROOT=$(cd "$(dirname $0)/../.."; pwd)
-cd $SRC_ROOT
-
-echo "@@@BUILD_STEP Basic setup@@@"
-export ANDROID_SDK_ROOT=/usr/local/google/android-sdk-linux
-export ANDROID_NDK_ROOT=/usr/local/google/android-ndk-r7
-for mandatory_directory in "${ANDROID_SDK_ROOT}" "${ANDROID_NDK_ROOT}" ; do
- if [[ ! -d "${mandatory_directory}" ]]; then
- echo "Directory ${mandatory_directory} does not exist."
- echo "Build cannot continue."
- exit 1
- fi
-done
-
-if [ ! "$BUILDBOT_CLOBBER" = "" ]; then
- NEED_CLOBBER=1
-fi
-
-## Build and test steps
-
-echo "@@@BUILD_STEP Configure with envsetup.sh@@@"
-. build/android/envsetup.sh
-
-if [ "$NEED_CLOBBER" -eq 1 ]; then
- echo "@@@BUILD_STEP Clobber@@@"
- rm -rf "${SRC_ROOT}"/out
-fi
-
-echo "@@@BUILD_STEP android_gyp@@@"
-android_gyp
-
-echo "@@@BUILD_STEP Compile@@@"
-make -j${JOBS}
-
-if [ "${BUILD_EXPERIMENTAL_TARGETS}" = 1 ] ; then
- # Linking DumpRenderTree appears to hang forever?
- # EXPERIMENTAL_TARGETS="DumpRenderTree webkit_unit_tests"
- EXPERIMENTAL_TARGETS="webkit_unit_tests"
- for target in ${EXPERIMENTAL_TARGETS} ; do
- echo "@@@BUILD_STEP Experimental Compile $target @@@"
- set +e
- make -j4 "${target}"
- if [ $? -ne 0 ] ; then
- echo "@@@STEP_WARNINGS@@@"
- fi
- set -e
- done
-fi
-
-if [ "${RUN_TESTS}" = 1 ] ; then
- echo "@@@BUILD_STEP Run Tests@@@"
- build/android/run_tests.py -e --xvfb --verbose
-fi
-
-exit 0
diff --git a/build/android/buildbot_functions.sh b/build/android/buildbot_functions.sh
new file mode 100755
index 0000000..8b82ed5
--- /dev/null
+++ b/build/android/buildbot_functions.sh
@@ -0,0 +1,105 @@
+#!/bin/bash
+# Copyright (c) 2012 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+#
+# Bash functions used by buildbot annotator scripts for the android
+# build of chromium. Executing this script should not perform actions
+# other than setting variables and defining of functions.
+
+# Number of jobs on the compile line; e.g. make -j"${JOBS}"
+JOBS="${JOBS:-4}"
+
+# Clobber build? Overridden by bots with BUILDBOT_CLOBBER.
+NEED_CLOBBER="${NEED_CLOBBER:-0}"
+
+# Function to force-green a bot.
+function bb_force_bot_green_and_exit {
+ echo "@@@BUILD_STEP Bot forced green.@@@"
+ exit 0
+}
+
+# Basic setup for all bots to run after a source tree checkout.
+# $1: source root.
+function bb_baseline_setup {
+ echo "@@@BUILD_STEP cd into source root@@@"
+ SRC_ROOT="$1"
+ if [ ! -d "${SRC_ROOT}" ] ; then
+ echo "Please specify a valid source root directory as an arg"
+ echo '@@@STEP_FAILURE@@@'
+ return 1
+ fi
+ cd $SRC_ROOT
+
+ if [ ! -f build/android/envsetup.sh ] ; then
+ echo "No envsetup.sh"
+ echo "@@@STEP_FAILURE@@@"
+ return 1
+ fi
+
+ echo "@@@BUILD_STEP Basic setup@@@"
+ export ANDROID_SDK_ROOT=/usr/local/google/android-sdk-linux
+ export ANDROID_NDK_ROOT=/usr/local/google/android-ndk-r7
+ for mandatory_directory in "${ANDROID_SDK_ROOT}" "${ANDROID_NDK_ROOT}" ; do
+ if [[ ! -d "${mandatory_directory}" ]]; then
+ echo "Directory ${mandatory_directory} does not exist."
+ echo "Build cannot continue."
+ echo "@@@STEP_FAILURE@@@"
+ return 1
+ fi
+ done
+
+ if [ ! "$BUILDBOT_CLOBBER" = "" ]; then
+ NEED_CLOBBER=1
+ fi
+
+ echo "@@@BUILD_STEP Configure with envsetup.sh@@@"
+ . build/android/envsetup.sh
+
+ if [ "$NEED_CLOBBER" -eq 1 ]; then
+ echo "@@@BUILD_STEP Clobber@@@"
+ rm -rf "${SRC_ROOT}"/out
+ if [ -e "${SRC_ROOT}"/out ] ; then
+ echo "Clobber appeared to fail? ${SRC_ROOT}/out still exists."
+ echo "@@@STEP_WARNINGS@@@"
+ fi
+ fi
+
+ echo "@@@BUILD_STEP android_gyp@@@"
+ android_gyp
+}
+
+
+# Compile step
+function bb_compile {
+ echo "@@@BUILD_STEP Compile@@@"
+ make -j${JOBS}
+}
+
+# Experimental compile step; does not turn the tree red if it fails.
+function bb_compile_experimental {
+ # Linking DumpRenderTree appears to hang forever?
+ # EXPERIMENTAL_TARGETS="DumpRenderTree webkit_unit_tests"
+ EXPERIMENTAL_TARGETS="webkit_unit_tests"
+ for target in ${EXPERIMENTAL_TARGETS} ; do
+ echo "@@@BUILD_STEP Experimental Compile $target @@@"
+ set +e
+ make -j4 "${target}"
+ if [ $? -ne 0 ] ; then
+ echo "@@@STEP_WARNINGS@@@"
+ fi
+ set -e
+ done
+}
+
+# Run tests on an emulator.
+function bb_run_tests_emulator {
+ echo "@@@BUILD_STEP Run Tests on an Emulator@@@"
+ build/android/run_tests.py -e --xvfb --verbose
+}
+
+# Run tests on an actual device. (Better have one plugged in!)
+function bb_run_tests {
+ echo "@@@BUILD_STEP Run Tests on an Emulator@@@"
+ build/android/run_tests.py --xvfb --verbose
+}
diff --git a/build/android/buildbot_fyi.sh b/build/android/buildbot_fyi.sh
new file mode 100755
index 0000000..a96f978
--- /dev/null
+++ b/build/android/buildbot_fyi.sh
@@ -0,0 +1,20 @@
+#!/bin/bash -ex
+# Copyright (c) 2012 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+#
+# Buildbot annotator script for the FYI waterfall. Compile,
+# experimental compile, run tests, ...
+
+# SHERIFF: there should be no need to disable this bot.
+# The FYI waterfall does not close the tree.
+
+ROOT=$(cd "$(dirname $0)"; pwd)
+. "${ROOT}"/buildbot_functions.sh
+
+bb_baseline_setup "${ROOT}"/../..
+bb_compile
+bb_compile_experimental
+bb_run_tests_emulator
+
+
diff --git a/build/android/buildbot_main.sh b/build/android/buildbot_main.sh
new file mode 100755
index 0000000..a66a197
--- /dev/null
+++ b/build/android/buildbot_main.sh
@@ -0,0 +1,18 @@
+#!/bin/bash -ex
+# Copyright (c) 2012 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+#
+# Buildbot annotator script for the main waterfall. Compile only.
+
+ROOT=$(cd "$(dirname $0)"; pwd)
+. "${ROOT}"/buildbot_functions.sh
+
+# SHERIFF: if you need to quickly turn the main waterfall android bots
+# green (preventing tree closures), uncomment the next line (and send
+# appropriate email out):
+## bb_force_bot_green_and_exit
+
+bb_baseline_setup "${ROOT}"/../..
+bb_compile
+
diff --git a/build/android/buildbot_try_compile.sh b/build/android/buildbot_try_compile.sh
new file mode 100755
index 0000000..27b09fc
--- /dev/null
+++ b/build/android/buildbot_try_compile.sh
@@ -0,0 +1,16 @@
+#!/bin/bash -ex
+# Copyright (c) 2012 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+#
+# Buildbot annotator script for trybots. Compile only.
+
+ROOT=$(cd "$(dirname $0)"; pwd)
+. "${ROOT}"/buildbot_functions.sh
+
+# SHERIFF: if you need to quickly turn "android" trybots green,
+# uncomment the next line (and send appropriate email out):
+## bb_force_bot_green_and_exit
+
+bb_baseline_setup "${ROOT}"/../..
+bb_compile
diff --git a/build/android/buildbot_try_compile_test.sh b/build/android/buildbot_try_compile_test.sh
new file mode 100755
index 0000000..15db16b
--- /dev/null
+++ b/build/android/buildbot_try_compile_test.sh
@@ -0,0 +1,17 @@
+#!/bin/bash -ex
+# Copyright (c) 2012 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+#
+# Buildbot annotator script for trybots. Compile and test.
+
+ROOT=$(cd "$(dirname $0)"; pwd)
+. "${ROOT}"/buildbot_functions.sh
+
+# SHERIFF: if you need to quickly turn "android_test" trybots green,
+# uncomment the next line (and send appropriate email out):
+## bb_force_bot_green_and_exit
+
+bb_baseline_setup "${ROOT}"/../..
+bb_compile
+bb_run_tests