OLD | NEW |
---|---|
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 | 2 |
3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 """CBuildbot is wrapper around the build process used by the pre-flight queue""" | 7 """CBuildbot is wrapper around the build process used by the pre-flight queue""" |
8 | 8 |
9 import errno | 9 import errno |
10 import heapq | 10 import heapq |
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
408 shutil.rmtree(results_dir_in_chroot) | 408 shutil.rmtree(results_dir_in_chroot) |
409 | 409 |
410 cwd = os.path.join(buildroot, 'src', 'scripts') | 410 cwd = os.path.join(buildroot, 'src', 'scripts') |
411 RunCommand(['bin/cros_run_vm_test', | 411 RunCommand(['bin/cros_run_vm_test', |
412 '--no_graphics', | 412 '--no_graphics', |
413 '--results_dir_root=%s' % results_dir, | 413 '--results_dir_root=%s' % results_dir, |
414 'suite_Smoke', | 414 'suite_Smoke', |
415 ], cwd=cwd, error_ok=False) | 415 ], cwd=cwd, error_ok=False) |
416 | 416 |
417 | 417 |
418 def _RunAUTest(buildroot, board): | |
419 """Runs a basic update test from the au test harness.""" | |
420 cwd = os.path.join(buildroot, 'src', 'scripts') | |
421 image_path = os.path.join(buildroot, 'src', 'build', 'images', board, | |
422 'latest', 'chromiumos_test_image.bin') | |
423 RunCommand(['bin/cros_au_test_harness', | |
424 '--no_graphics', | |
425 '--no_delta', | |
426 '--board=%s' % board, | |
427 '--test_prefix=SimpleTest', | |
428 '--verbose', | |
429 '--base_image=%s' % image_path, | |
430 '--target_image=%s' % image_path, | |
431 ], cwd=cwd, error_ok=False) | |
432 | |
433 | |
418 def _UprevPackages(buildroot, tracking_branch, revisionfile, board, overlays): | 434 def _UprevPackages(buildroot, tracking_branch, revisionfile, board, overlays): |
419 """Uprevs a package based on given revisionfile. | 435 """Uprevs a package based on given revisionfile. |
420 | 436 |
421 If revisionfile is set to None or does not resolve to an actual file, this | 437 If revisionfile is set to None or does not resolve to an actual file, this |
422 function will uprev all packages. | 438 function will uprev all packages. |
423 | 439 |
424 Keyword arguments: | 440 Keyword arguments: |
425 revisionfile -- string specifying a file that contains a list of revisions to | 441 revisionfile -- string specifying a file that contains a list of revisions to |
426 uprev. | 442 uprev. |
427 """ | 443 """ |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
677 | 693 |
678 # Perform uprev. If chrome_uprev is set, rev Chrome ebuilds. | 694 # Perform uprev. If chrome_uprev is set, rev Chrome ebuilds. |
679 if options.chrome_rev: | 695 if options.chrome_rev: |
680 chrome_atom_to_build = _MarkChromeAsStable(buildroot, tracking_branch, | 696 chrome_atom_to_build = _MarkChromeAsStable(buildroot, tracking_branch, |
681 options.chrome_rev, board) | 697 options.chrome_rev, board) |
682 # If we found nothing to rev, we're done here. | 698 # If we found nothing to rev, we're done here. |
683 if not chrome_atom_to_build: | 699 if not chrome_atom_to_build: |
684 return | 700 return |
685 | 701 |
686 elif buildconfig['uprev']: | 702 elif buildconfig['uprev']: |
687 _UprevPackages(buildroot, tracking_branch, revisionfile, | 703 #_UprevPackages(buildroot, tracking_branch, revisionfile, |
petkov
2011/01/07 22:17:29
why is this code commented out? remove? there's mo
sosa
2011/01/07 23:28:44
Done.
| |
688 buildconfig['board'], rev_overlays) | 704 # buildconfig['board'], rev_overlays) |
705 pass | |
689 | 706 |
690 _EnableLocalAccount(buildroot) | 707 _EnableLocalAccount(buildroot) |
691 _Build(buildroot, emptytree) | 708 #_Build(buildroot, emptytree) |
692 | 709 |
693 if buildconfig['unittests'] and options.tests: | 710 #if buildconfig['unittests'] and options.tests: |
694 _RunUnitTests(buildroot) | 711 # _RunUnitTests(buildroot) |
695 | 712 |
696 _BuildImage(buildroot) | 713 #_BuildImage(buildroot) |
697 | 714 |
698 if buildconfig['smoke_bvt'] and options.tests: | 715 if buildconfig['tests'] and options.tests: |
699 _BuildVMImageForTesting(buildroot) | 716 _BuildVMImageForTesting(buildroot) |
700 test_results_dir = '/tmp/run_remote_tests.%s' % options.buildnumber | 717 test_results_dir = '/tmp/run_remote_tests.%s' % options.buildnumber |
701 try: | 718 try: |
702 _RunSmokeSuite(buildroot, test_results_dir) | 719 #_RunSmokeSuite(buildroot, test_results_dir) |
720 _RunAUTest(buildroot, buildconfig['board']) | |
703 finally: | 721 finally: |
704 if not options.debug: | 722 if not options.debug: |
705 archive_full_path = os.path.join(options.gsutil_archive, | 723 archive_full_path = os.path.join(options.gsutil_archive, |
706 str(options.buildnumber)) | 724 str(options.buildnumber)) |
707 _ArchiveTestResults(buildroot, buildconfig['board'], | 725 _ArchiveTestResults(buildroot, buildconfig['board'], |
708 test_results_dir=test_results_dir, | 726 test_results_dir=test_results_dir, |
709 gsutil=options.gsutil, | 727 gsutil=options.gsutil, |
710 archive_dir=archive_full_path, | 728 archive_dir=archive_full_path, |
711 acl=options.acl) | 729 acl=options.acl) |
712 | 730 |
713 if buildconfig['uprev']: | 731 if buildconfig['uprev']: |
714 # Don't push changes for developers. | 732 # Don't push changes for developers. |
715 if buildconfig['master']: | 733 if buildconfig['master']: |
716 # Master bot needs to check if the other slaves completed. | 734 # Master bot needs to check if the other slaves completed. |
(...skipping 14 matching lines...) Expand all Loading... | |
731 except: | 749 except: |
732 # Send failure to master bot. | 750 # Send failure to master bot. |
733 if not buildconfig['master'] and buildconfig['important']: | 751 if not buildconfig['master'] and buildconfig['important']: |
734 cbuildbot_comm.PublishStatus(cbuildbot_comm.STATUS_BUILD_FAILED) | 752 cbuildbot_comm.PublishStatus(cbuildbot_comm.STATUS_BUILD_FAILED) |
735 | 753 |
736 raise | 754 raise |
737 | 755 |
738 | 756 |
739 if __name__ == '__main__': | 757 if __name__ == '__main__': |
740 main() | 758 main() |
OLD | NEW |