diff --git a/bin/cbuildbot.py b/bin/cbuildbot.py index e723cd6439..aef3ec2719 100755 --- a/bin/cbuildbot.py +++ b/bin/cbuildbot.py @@ -22,6 +22,7 @@ from cros_build_lib import (Die, Info, ReinterpretPathForChroot, RunCommand, Warning) _DEFAULT_RETRIES = 3 +_PACKAGE_FILE = '%(buildroot)s/src/scripts/cbuildbot_package.list' ARCHIVE_BASE = '/var/www/archive' ARCHIVE_COUNT = 10 @@ -202,6 +203,8 @@ def _UprevFromRevisionList(buildroot, tracking_branch, revision_list, board, '--tracking_branch=%s' % tracking_branch, '--overlays=%s' % ':'.join(chroot_overlays), '--packages=%s' % ':'.join(packages), + '--drop_file=%s' % ReinterpretPathForChroot(_PACKAGE_FILE % + {'buildroot': buildroot}), 'commit'], cwd=cwd, enter_chroot=True) @@ -213,7 +216,10 @@ def _UprevAllPackages(buildroot, tracking_branch, board, overlays): RunCommand(['./cros_mark_as_stable', '--all', '--board=%s' % board, '--overlays=%s' % ':'.join(chroot_overlays), - '--tracking_branch=%s' % tracking_branch, 'commit'], + '--tracking_branch=%s' % tracking_branch, + '--drop_file=%s' % ReinterpretPathForChroot(_PACKAGE_FILE % + {'buildroot': buildroot}), + 'commit'], cwd=cwd, enter_chroot=True) @@ -333,7 +339,10 @@ def _BuildVMImageForTesting(buildroot): def _RunUnitTests(buildroot): cwd = os.path.join(buildroot, 'src', 'scripts') - RunCommand(['./cros_run_unit_tests'], cwd=cwd, enter_chroot=True) + RunCommand(['./cros_run_unit_tests', + '--package_file=%s' % ReinterpretPathForChroot(_PACKAGE_FILE % + {'buildroot': buildroot}), + ], cwd=cwd, enter_chroot=True) def _RunSmokeSuite(buildroot, results_dir): diff --git a/cros_mark_as_stable.py b/cros_mark_as_stable.py index 6c4a6fa51a..a6221ad80f 100755 --- a/cros_mark_as_stable.py +++ b/cros_mark_as_stable.py @@ -22,6 +22,8 @@ gflags.DEFINE_boolean('all', False, 'Mark all packages as stable.') gflags.DEFINE_string('board', '', 'Board for which the package belongs.', short_name='b') +gflags.DEFINE_string('drop_file', None, + 'File to list packages that were revved.') gflags.DEFINE_boolean('dryrun', False, 'Passes dry-run to git push if pushing a change.') gflags.DEFINE_string('overlays', '', @@ -569,6 +571,10 @@ def main(argv): if revved_packages: _CleanStalePackages(gflags.FLAGS.board, revved_packages) + if gflags.FLAGS.drop_file: + fh = open(gflags.FLAGS.drop_file, 'w') + fh.write(' '.join(revved_packages)) + fh.close() else: work_branch.Delete() diff --git a/cros_run_unit_tests b/cros_run_unit_tests index 169edde582..2246175176 100755 --- a/cros_run_unit_tests +++ b/cros_run_unit_tests @@ -19,6 +19,8 @@ DEFINE_string board "${DEFAULT_BOARD}" \ "Target board of which tests were built" DEFINE_string build_root "${DEFAULT_BUILD_ROOT}" \ "Root of build output" +DEFINE_string package_file "" \ + "File with space-separated list of packages to run unit tests" f DEFINE_string packages "" \ "Optional space-separated list of packages to run unit tests" p @@ -55,11 +57,12 @@ set -e [ -z "${FLAGS_board}" ] && die "--board required" -# If no packages are specified we run all unit tests for chromeos-base -# packages. -if [ -n "${FLAGS_packages}" ]; then - PACKAGE_LIST="${FLAGS_packages}" -else +# Create package list from package file and list of packages. +[ -n "${FLAGS_package_file}" ] && PACKAGE_LIST="$(cat ${FLAGS_package_file})" +[ -n "${FLAGS_packages}" ] && PACKAGE_LIST="${PACKAGE_LIST} ${FLAGS_packages}" + +# If we didn't specify packages, find all packages. +if [ -z "${FLAGS_package_file}" -a -z "${FLAGS_packages}" ]; then PACKAGE_LIST=$( ./get_package_list chromeos --board="${FLAGS_board}" | egrep '^chromeos-base' ) fi