Commit 59bddee9 authored by binji@chromium.org's avatar binji@chromium.org

[NaCl SDK] Turn on pyauto testing on SDK builders (not trybots yet).

BUG=none
TEST=none

Review URL: https://chromiumcodereview.appspot.com/10539015

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@141281 0039d316-1c4b-4281-b951-d872f2087c98
parent e455340a
...@@ -17,6 +17,7 @@ and whether it should upload an SDK to file storage (GSTORE) ...@@ -17,6 +17,7 @@ and whether it should upload an SDK to file storage (GSTORE)
# std python includes # std python includes
import copy
import optparse import optparse
import os import os
import platform import platform
...@@ -450,6 +451,9 @@ def main(args): ...@@ -450,6 +451,9 @@ def main(args):
action='store_true', dest='only_examples', default=False) action='store_true', dest='only_examples', default=False)
parser.add_option('--update', help='Only build the updater.', parser.add_option('--update', help='Only build the updater.',
action='store_true', dest='only_updater', default=False) action='store_true', dest='only_updater', default=False)
parser.add_option('--test-examples',
help='Run the pyauto tests for examples.', action='store_true',
dest='test_examples', default=False)
parser.add_option('--skip-tar', help='Skip generating a tarball.', parser.add_option('--skip-tar', help='Skip generating a tarball.',
action='store_true', dest='skip_tar', default=False) action='store_true', dest='skip_tar', default=False)
parser.add_option('--archive', help='Force the archive step.', parser.add_option('--archive', help='Force the archive step.',
...@@ -465,6 +469,11 @@ def main(args): ...@@ -465,6 +469,11 @@ def main(args):
if builder_name.find('pnacl') >= 0 and builder_name.find('sdk') >= 0: if builder_name.find('pnacl') >= 0 and builder_name.find('sdk') >= 0:
options.pnacl = True options.pnacl = True
# TODO(binji) for now, only test examples on non-trybots. Trybots don't build
# pyauto Chrome.
if buildbot_common.IsSDKBuilder():
options.test_examples = True
if options.pnacl: if options.pnacl:
toolchains = ['pnacl'] toolchains = ['pnacl']
else: else:
...@@ -477,6 +486,8 @@ def main(args): ...@@ -477,6 +486,8 @@ def main(args):
skip_untar = skip skip_untar = skip
skip_build = skip skip_build = skip
skip_test_updater = skip skip_test_updater = skip
skip_test_examples = skip or not options.test_examples
skip_test_build_tools = skip
skip_tar = skip or options.skip_tar skip_tar = skip or options.skip_tar
if options.archive and (options.only_examples or options.skip_tar): if options.archive and (options.only_examples or options.skip_tar):
...@@ -551,9 +562,10 @@ def main(args): ...@@ -551,9 +562,10 @@ def main(args):
'pepper_' + pepper_ver], cwd=NACL_DIR) 'pepper_' + pepper_ver], cwd=NACL_DIR)
# Run build tests # Run build tests
buildbot_common.BuildStep('Run build_tools tests') if not skip_test_build_tools:
buildbot_common.Run([sys.executable, buildbot_common.BuildStep('Run build_tools tests')
os.path.join(SDK_SRC_DIR, 'build_tools', 'tests', 'test_all.py')]) buildbot_common.Run([sys.executable,
os.path.join(SDK_SRC_DIR, 'build_tools', 'tests', 'test_all.py')])
# build sdk update # build sdk update
if not skip_update: if not skip_update:
...@@ -614,7 +626,7 @@ def main(args): ...@@ -614,7 +626,7 @@ def main(args):
# build examples. # build examples.
if not skip_examples: if not skip_examples:
buildbot_common.BuildStep('Test Build Examples') buildbot_common.BuildStep('Build Examples')
example_dir = os.path.join(pepperdir, 'examples') example_dir = os.path.join(pepperdir, 'examples')
makefile = os.path.join(example_dir, 'Makefile') makefile = os.path.join(example_dir, 'Makefile')
if os.path.isfile(makefile): if os.path.isfile(makefile):
...@@ -623,18 +635,18 @@ def main(args): ...@@ -623,18 +635,18 @@ def main(args):
cwd=os.path.abspath(example_dir), shell=True) cwd=os.path.abspath(example_dir), shell=True)
# test examples. # test examples.
skip_test_examples = True if not skip_examples and not skip_test_examples:
if not skip_examples: buildbot_common.BuildStep('Test Examples')
if not skip_test_examples: env = copy.copy(os.environ)
run_script_path = os.path.join(SRC_DIR, 'chrome', 'test', 'functional') env['pepper_ver'] = pepper_ver
buildbot_common.Run([sys.executable, 'nacl_sdk_example_test.py', env['OUT_DIR'] = OUT_DIR
'nacl_sdk_example_test.NaClSDKTest.testNaClSDK'], cwd=run_script_path, run_script_path = os.path.join(SRC_DIR, 'chrome', 'test', 'functional')
env=dict(os.environ.items()+{'pepper_ver':pepper_ver, buildbot_common.Run([sys.executable, 'nacl_sdk.py',
'OUT_DIR':OUT_DIR}.items())) 'nacl_sdk.NaClSDKTest.NaClSDKExamples'], cwd=run_script_path,
env=env)
# Archive on non-trybots. # Archive on non-trybots.
buildername = os.environ.get('BUILDBOT_BUILDERNAME', '') if options.archive or buildbot_common.IsSDKBuilder():
if options.archive or '-sdk' in buildername:
buildbot_common.BuildStep('Archive build') buildbot_common.BuildStep('Archive build')
bucket_path = 'nativeclient-mirror/nacl/nacl_sdk/%s' % \ bucket_path = 'nativeclient-mirror/nacl/nacl_sdk/%s' % \
build_utils.ChromeVersion() build_utils.ChromeVersion()
...@@ -642,7 +654,7 @@ def main(args): ...@@ -642,7 +654,7 @@ def main(args):
if not skip_update: if not skip_update:
# Only push up sdk_tools.tgz on the linux buildbot. # Only push up sdk_tools.tgz on the linux buildbot.
if buildername == 'linux-sdk-multi': if builder_name == 'linux-sdk-multi':
sdk_tools = os.path.join(OUT_DIR, 'sdk_tools.tgz') sdk_tools = os.path.join(OUT_DIR, 'sdk_tools.tgz')
buildbot_common.Archive('sdk_tools.tgz', bucket_path, OUT_DIR, buildbot_common.Archive('sdk_tools.tgz', bucket_path, OUT_DIR,
step_link=False) step_link=False)
......
...@@ -18,6 +18,22 @@ sys.path.append(os.path.join(SDK_SRC_DIR, 'tools')) ...@@ -18,6 +18,22 @@ sys.path.append(os.path.join(SDK_SRC_DIR, 'tools'))
import oshelpers import oshelpers
def IsSDKBuilder():
"""Returns True if this script is running on an SDK builder.
False means it is either running on a trybot, or a user's machine.
Trybot names:
naclsdkm-((pnacl-)?linux|mac|windows(32|64))
Builder names:
(pnacl-)?(windows|mac|linux)-sdk-multi(rel)?
except there are currently no pnacl multirel bots, and
pnacl-windows-sdk-multi is actually called pnacl-win-sdk-multi."""
return '-sdk-multi' in os.getenv('BUILDBOT_BUILDERNAME', '')
def ErrorExit(msg): def ErrorExit(msg):
"""Write and error to stderr, then exit with 1 signaling failure.""" """Write and error to stderr, then exit with 1 signaling failure."""
sys.stderr.write(msg + '\n') sys.stderr.write(msg + '\n')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment