Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # | 2 # |
| 3 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 3 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 4 # for details. All rights reserved. Use of this source code is governed by a | 4 # for details. All rights reserved. Use of this source code is governed by a |
| 5 # BSD-style license that can be found in the LICENSE file. | 5 # BSD-style license that can be found in the LICENSE file. |
| 6 | 6 |
| 7 import glob | 7 import glob |
| 8 import optparse | 8 import optparse |
| 9 import os | 9 import os |
| 10 import re | 10 import re |
| 11 import shutil | 11 import shutil |
| 12 import subprocess | 12 import subprocess |
| 13 import sys | 13 import sys |
| 14 import tempfile | 14 import tempfile |
| 15 import gsutil | 15 import gsutil |
| 16 import ziputils | 16 import ziputils |
| 17 import hashlib | 17 import hashlib |
| 18 | 18 |
| 19 from os.path import join | 19 from os.path import join |
| 20 from xml.dom.minidom import parseString | |
| 20 | 21 |
| 21 BUILD_OS = None | 22 BUILD_OS = None |
| 22 DART_PATH = None | 23 DART_PATH = None |
| 23 TOOLS_PATH = None | 24 TOOLS_PATH = None |
| 24 | 25 |
| 25 GSU_PATH_REV = None | 26 GSU_PATH_REV = None |
| 26 GSU_PATH_LATEST = None | 27 GSU_PATH_LATEST = None |
| 27 GSU_API_DOCS_PATH = None | 28 GSU_API_DOCS_PATH = None |
| 28 GSU_API_DOCS_BUCKET = 'gs://dartlang-api-docs' | 29 GSU_API_DOCS_BUCKET = 'gs://dartlang-api-docs' |
| 29 | 30 |
| (...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 395 if status: | 396 if status: |
| 396 return status | 397 return status |
| 397 | 398 |
| 398 if not build_skip_tests: | 399 if not build_skip_tests: |
| 399 PrintSeparator('Running the tests') | 400 PrintSeparator('Running the tests') |
| 400 junit_status = ant.RunAnt('../com.google.dart.tools.tests.feature_releng', | 401 junit_status = ant.RunAnt('../com.google.dart.tools.tests.feature_releng', |
| 401 'buildTests.xml', | 402 'buildTests.xml', |
| 402 revision, options.name, buildroot, buildout, | 403 revision, options.name, buildroot, buildout, |
| 403 editorpath, buildos, | 404 editorpath, buildos, |
| 404 extra_artifacts=extra_artifacts) | 405 extra_artifacts=extra_artifacts) |
| 406 | |
| 407 #<testsuite errors="0" failures="1" name="com.google.dart.tools.core_test" | |
| 408 # tests="740" time="40.713"> | |
| 409 testResults = parseString(open(join(buildout, 'test-results.xml')).read()) | |
| 410 testsuite = testResults.documentElement | |
| 411 if testsuite.getAttribute("errors") != "0": | |
| 412 junit_status = 1 | |
| 413 if testsuite.getAttribute("failures") != "0": | |
| 414 junit_status = 1 | |
| 415 | |
| 416 print "\n%s: %s tests, %s errors, %s failures (time: %s)\n" % ( | |
| 417 testsuite.getAttribute("name"), | |
| 418 testsuite.getAttribute("tests"), | |
| 419 testsuite.getAttribute("errors"), | |
| 420 testsuite.getAttribute("failures"), | |
| 421 testsuite.getAttribute("time")) | |
| 422 | |
| 405 properties = ReadPropertyFile(buildos, ant_property_file.name) | 423 properties = ReadPropertyFile(buildos, ant_property_file.name) |
| 406 if buildos: | 424 #if buildos: |
| 407 UploadTestHtml(buildout, to_bucket, revision, buildos, gsu) | 425 # UploadTestHtml(buildout, to_bucket, revision, buildos, gsu) |
|
danrubel
2012/12/19 14:55:32
Should we continue to upload the test results as a
devoncarew
2012/12/19 17:35:13
I'd prefer no - it makes our build simpler to not
| |
| 408 if junit_status: | 426 if junit_status: |
| 409 if properties['build.runtime']: | 427 if properties['build.runtime']: |
| 410 #if there is a build.runtime and the status is not | 428 #if there is a build.runtime and the status is not |
| 411 #zero see if there are any *.log entries | 429 #zero see if there are any *.log entries |
| 412 PrintErrorLog(properties['build.runtime']) | 430 PrintErrorLog(properties['build.runtime']) |
| 413 else: | 431 else: |
| 414 junit_status = 0 | 432 junit_status = 0 |
| 415 | 433 |
| 416 if buildos: | 434 if buildos: |
| 417 _InstallArtifacts(buildout, buildos, extra_artifacts) | 435 _InstallArtifacts(buildout, buildos, extra_artifacts) |
| (...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1056 """delete the given file - do not re-throw any exceptions that occur""" | 1074 """delete the given file - do not re-throw any exceptions that occur""" |
| 1057 if os.path.exists(f): | 1075 if os.path.exists(f): |
| 1058 try: | 1076 try: |
| 1059 os.remove(f) | 1077 os.remove(f) |
| 1060 except OSError: | 1078 except OSError: |
| 1061 print 'error deleting %s' % f | 1079 print 'error deleting %s' % f |
| 1062 | 1080 |
| 1063 | 1081 |
| 1064 if __name__ == '__main__': | 1082 if __name__ == '__main__': |
| 1065 sys.exit(main()) | 1083 sys.exit(main()) |
| OLD | NEW |