2017-04-19 17:36:00 +00:00
|
|
|
# Copyright 2017 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.
|
|
|
|
|
|
|
|
|
|
|
|
DEPS = [
|
|
|
|
'flavor',
|
|
|
|
'recipe_engine/properties',
|
|
|
|
'recipe_engine/raw_io',
|
|
|
|
'run',
|
|
|
|
'vars',
|
|
|
|
]
|
|
|
|
|
|
|
|
|
2017-04-19 18:39:21 +00:00
|
|
|
def test_exceptions(api):
|
|
|
|
try:
|
|
|
|
api.flavor.copy_directory_contents_to_device('src', 'dst')
|
|
|
|
except ValueError:
|
|
|
|
pass
|
|
|
|
try:
|
|
|
|
api.flavor.copy_directory_contents_to_host('src', 'dst')
|
|
|
|
except ValueError:
|
|
|
|
pass
|
|
|
|
try:
|
|
|
|
api.flavor.copy_file_to_device('src', 'dst')
|
|
|
|
except ValueError:
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
2017-04-19 17:36:00 +00:00
|
|
|
def RunSteps(api):
|
|
|
|
api.vars.setup()
|
|
|
|
api.flavor.setup()
|
|
|
|
|
2017-04-19 18:39:21 +00:00
|
|
|
if api.properties.get('is_testing_exceptions') == 'True':
|
|
|
|
return test_exceptions(api)
|
|
|
|
|
2017-04-19 17:36:00 +00:00
|
|
|
if 'Build' not in api.properties['buildername']:
|
|
|
|
try:
|
|
|
|
api.flavor.copy_file_to_device('file.txt', 'file.txt')
|
|
|
|
api.flavor.create_clean_host_dir('results_dir')
|
|
|
|
api.flavor.create_clean_device_dir('device_results_dir')
|
|
|
|
api.flavor.install_everything()
|
2017-10-12 19:15:47 +00:00
|
|
|
if 'Test' in api.properties['buildername']:
|
|
|
|
api.flavor.step('dm', ['dm', '--some-flag'])
|
|
|
|
api.flavor.copy_directory_contents_to_host(
|
2018-05-18 11:36:55 +00:00
|
|
|
api.flavor.device_dirs.dm_dir, api.flavor.host_dirs.dm_dir)
|
2017-10-12 19:15:47 +00:00
|
|
|
elif 'Perf' in api.properties['buildername']:
|
|
|
|
api.flavor.step('nanobench', ['nanobench', '--some-flag'])
|
|
|
|
api.flavor.copy_directory_contents_to_host(
|
2018-05-18 11:36:55 +00:00
|
|
|
api.flavor.device_dirs.perf_data_dir,
|
|
|
|
api.flavor.host_dirs.perf_data_dir)
|
2017-04-19 17:36:00 +00:00
|
|
|
finally:
|
|
|
|
api.flavor.cleanup_steps()
|
|
|
|
api.run.check_failure()
|
|
|
|
|
|
|
|
|
|
|
|
TEST_BUILDERS = [
|
2017-12-12 12:33:48 +00:00
|
|
|
'Perf-Android-Clang-GalaxyS7_G930FD-GPU-MaliT880-arm64-Debug-All-Android',
|
2018-01-11 18:02:51 +00:00
|
|
|
'Perf-Android-Clang-Nexus5x-GPU-Adreno418-arm64-Debug-All-Android',
|
2017-11-02 16:03:22 +00:00
|
|
|
'Perf-ChromeOS-Clang-SamsungChromebookPlus-GPU-MaliT860-arm-Release-All',
|
2017-10-16 01:05:58 +00:00
|
|
|
'Perf-Chromecast-GCC-Chorizo-CPU-Cortex_A7-arm-Release-All',
|
|
|
|
'Perf-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-MSAN',
|
|
|
|
'Perf-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-ASAN',
|
2017-12-12 13:14:19 +00:00
|
|
|
'Test-Android-Clang-AndroidOne-GPU-Mali400MP2-arm-Release-All-Android',
|
2017-11-20 21:06:06 +00:00
|
|
|
'Test-Android-Clang-GalaxyS7_G930FD-GPU-MaliT880-arm64-Debug-All-Android',
|
2017-12-07 16:19:31 +00:00
|
|
|
'Test-Android-Clang-Nexus5x-GPU-Adreno418-arm64-Debug-All-Android',
|
2018-01-12 19:31:48 +00:00
|
|
|
'Test-Android-Clang-Nexus5x-GPU-Adreno418-arm64-Release-All-Android_ASAN',
|
2017-11-02 16:03:22 +00:00
|
|
|
'Test-ChromeOS-Clang-SamsungChromebookPlus-GPU-MaliT860-arm-Release-All',
|
2017-10-16 01:05:58 +00:00
|
|
|
'Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-Coverage',
|
2018-04-20 17:43:23 +00:00
|
|
|
'Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-SwiftShader',
|
2017-10-16 01:05:58 +00:00
|
|
|
'Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-TSAN',
|
2018-04-26 13:46:45 +00:00
|
|
|
'Test-Debian9-Clang-NUC7i5BNK-GPU-IntelIris640-x86_64-Debug-All-Vulkan',
|
2018-04-03 19:04:03 +00:00
|
|
|
'Test-Mac-Clang-MacMini7.1-CPU-AVX-x86_64-Debug-All-ASAN',
|
2017-10-16 01:05:58 +00:00
|
|
|
('Test-Ubuntu17-GCC-Golo-GPU-QuadroP400-x86_64-Release-All'
|
2017-09-26 18:11:15 +00:00
|
|
|
'-Valgrind_AbandonGpuContext_SK_CPU_LIMIT_SSE41'),
|
2018-03-09 18:42:56 +00:00
|
|
|
'Test-Win10-Clang-Golo-GPU-QuadroP400-x86_64-Release-All-Vulkan_ProcDump',
|
2017-04-19 17:36:00 +00:00
|
|
|
]
|
|
|
|
|
2018-02-21 21:29:28 +00:00
|
|
|
# Default properties used for TEST_BUILDERS.
|
2018-02-20 16:40:25 +00:00
|
|
|
defaultProps = lambda buildername: dict(
|
|
|
|
buildername=buildername,
|
|
|
|
repository='https://skia.googlesource.com/skia.git',
|
|
|
|
revision='abc123',
|
|
|
|
path_config='kitchen',
|
|
|
|
patch_set=2,
|
|
|
|
swarm_out_dir='[SWARM_OUT_DIR]'
|
|
|
|
)
|
2017-04-19 17:36:00 +00:00
|
|
|
|
|
|
|
def GenTests(api):
|
|
|
|
for buildername in TEST_BUILDERS:
|
|
|
|
test = (
|
|
|
|
api.test(buildername) +
|
2018-02-20 16:40:25 +00:00
|
|
|
api.properties(**defaultProps(buildername))
|
2017-04-19 17:36:00 +00:00
|
|
|
)
|
2017-11-02 13:34:08 +00:00
|
|
|
if 'Chromebook' in buildername and not 'Build' in buildername:
|
2017-04-19 17:36:00 +00:00
|
|
|
test += api.step_data(
|
|
|
|
'read chromeos ip',
|
|
|
|
stdout=api.raw_io.output('{"user_ip":"foo@127.0.0.1"}'))
|
2017-06-01 19:49:41 +00:00
|
|
|
if 'Chromecast' in buildername:
|
|
|
|
test += api.step_data(
|
|
|
|
'read chromecast ip',
|
|
|
|
stdout=api.raw_io.output('192.168.1.2:5555'))
|
2017-04-19 17:36:00 +00:00
|
|
|
yield test
|
|
|
|
|
2017-10-16 01:05:58 +00:00
|
|
|
builder = 'Test-Debian9-GCC-GCE-CPU-AVX2-x86_64-Release-All'
|
2017-04-19 18:39:21 +00:00
|
|
|
yield (
|
|
|
|
api.test('exceptions') +
|
|
|
|
api.properties(buildername=builder,
|
|
|
|
repository='https://skia.googlesource.com/skia.git',
|
|
|
|
revision='abc123',
|
|
|
|
path_config='kitchen',
|
|
|
|
swarm_out_dir='[SWARM_OUT_DIR]',
|
|
|
|
is_testing_exceptions='True')
|
|
|
|
)
|
|
|
|
|
2017-10-16 01:05:58 +00:00
|
|
|
builder = 'Perf-Android-Clang-NexusPlayer-GPU-PowerVR-x86-Debug-All-Android'
|
2017-04-19 17:36:00 +00:00
|
|
|
yield (
|
|
|
|
api.test('failed_infra_step') +
|
|
|
|
api.properties(buildername=builder,
|
|
|
|
repository='https://skia.googlesource.com/skia.git',
|
|
|
|
revision='abc123',
|
|
|
|
path_config='kitchen',
|
|
|
|
swarm_out_dir='[SWARM_OUT_DIR]') +
|
2018-03-01 14:21:38 +00:00
|
|
|
api.step_data('get swarming bot id',
|
|
|
|
stdout=api.raw_io.output('build123-m2--device5')) +
|
2017-04-19 17:36:00 +00:00
|
|
|
api.step_data('dump log', retcode=1)
|
|
|
|
)
|
|
|
|
|
2017-10-16 01:05:58 +00:00
|
|
|
builder = 'Perf-Android-Clang-NexusPlayer-GPU-PowerVR-x86-Debug-All-Android'
|
2017-04-19 17:36:00 +00:00
|
|
|
yield (
|
|
|
|
api.test('failed_read_version') +
|
|
|
|
api.properties(buildername=builder,
|
|
|
|
repository='https://skia.googlesource.com/skia.git',
|
|
|
|
revision='abc123',
|
|
|
|
path_config='kitchen',
|
|
|
|
swarm_out_dir='[SWARM_OUT_DIR]') +
|
|
|
|
api.step_data('read /sdcard/revenge_of_the_skiabot/SK_IMAGE_VERSION',
|
|
|
|
retcode=1)
|
|
|
|
)
|
2017-09-08 18:06:38 +00:00
|
|
|
|
2017-10-16 01:05:58 +00:00
|
|
|
builder = 'Perf-Android-Clang-NexusPlayer-GPU-PowerVR-x86-Debug-All-Android'
|
2017-09-08 18:06:38 +00:00
|
|
|
yield (
|
|
|
|
api.test('retry_adb_command') +
|
|
|
|
api.properties(buildername=builder,
|
|
|
|
repository='https://skia.googlesource.com/skia.git',
|
|
|
|
revision='abc123',
|
|
|
|
path_config='kitchen',
|
|
|
|
swarm_out_dir='[SWARM_OUT_DIR]') +
|
|
|
|
api.step_data('mkdir /sdcard/revenge_of_the_skiabot/resources',
|
|
|
|
retcode=1)
|
|
|
|
)
|
|
|
|
|
2017-10-16 01:05:58 +00:00
|
|
|
builder = 'Perf-Android-Clang-NexusPlayer-GPU-PowerVR-x86-Debug-All-Android'
|
2017-09-08 18:06:38 +00:00
|
|
|
fail_step_name = 'mkdir /sdcard/revenge_of_the_skiabot/resources'
|
|
|
|
yield (
|
|
|
|
api.test('retry_adb_command_retries_exhausted') +
|
|
|
|
api.properties(buildername=builder,
|
|
|
|
repository='https://skia.googlesource.com/skia.git',
|
|
|
|
revision='abc123',
|
|
|
|
path_config='kitchen',
|
|
|
|
swarm_out_dir='[SWARM_OUT_DIR]') +
|
2018-03-01 14:21:38 +00:00
|
|
|
api.step_data('get swarming bot id',
|
|
|
|
stdout=api.raw_io.output('build123-m2--device5')) +
|
2017-09-08 18:06:38 +00:00
|
|
|
api.step_data(fail_step_name, retcode=1) +
|
|
|
|
api.step_data(fail_step_name + ' (attempt 2)', retcode=1) +
|
|
|
|
api.step_data(fail_step_name + ' (attempt 3)', retcode=1)
|
|
|
|
)
|
2017-11-21 21:47:16 +00:00
|
|
|
|
2018-01-04 16:29:15 +00:00
|
|
|
builder = 'Test-iOS-Clang-iPhone7-GPU-GT7600-arm64-Release-All'
|
|
|
|
fail_step_name = 'install_dm'
|
|
|
|
yield (
|
|
|
|
api.test('retry_ios_install') +
|
|
|
|
api.properties(buildername=builder,
|
|
|
|
repository='https://skia.googlesource.com/skia.git',
|
|
|
|
revision='abc123',
|
|
|
|
path_config='kitchen',
|
|
|
|
swarm_out_dir='[SWARM_OUT_DIR]') +
|
|
|
|
api.step_data(fail_step_name, retcode=1)
|
|
|
|
)
|
|
|
|
|
|
|
|
yield (
|
|
|
|
api.test('retry_ios_install_retries_exhausted') +
|
|
|
|
api.properties(buildername=builder,
|
|
|
|
repository='https://skia.googlesource.com/skia.git',
|
|
|
|
revision='abc123',
|
|
|
|
path_config='kitchen',
|
|
|
|
swarm_out_dir='[SWARM_OUT_DIR]') +
|
|
|
|
api.step_data(fail_step_name, retcode=1) +
|
|
|
|
api.step_data(fail_step_name + ' (attempt 2)', retcode=1)
|
|
|
|
)
|
2018-05-18 13:54:02 +00:00
|
|
|
|
|
|
|
builder = ('Perf-Android-Clang-NexusPlayer-CPU-Moorefield-x86-Debug-All-' +
|
|
|
|
'Android')
|
|
|
|
yield (
|
|
|
|
api.test('cpu_scale_failed_once') +
|
|
|
|
api.properties(buildername=builder,
|
|
|
|
revision='abc123',
|
|
|
|
path_config='kitchen',
|
|
|
|
swarm_out_dir='[SWARM_OUT_DIR]') +
|
|
|
|
api.step_data('Scale CPU 0 to 0.600000', retcode=1)
|
|
|
|
)
|
|
|
|
|
|
|
|
yield (
|
|
|
|
api.test('cpu_scale_failed') +
|
|
|
|
api.properties(buildername=builder,
|
|
|
|
revision='abc123',
|
|
|
|
path_config='kitchen',
|
|
|
|
swarm_out_dir='[SWARM_OUT_DIR]') +
|
|
|
|
api.step_data('get swarming bot id',
|
|
|
|
stdout=api.raw_io.output('skia-rpi-022')) +
|
|
|
|
api.step_data('Scale CPU 0 to 0.600000', retcode=1)+
|
|
|
|
api.step_data('Scale CPU 0 to 0.600000 (attempt 2)', retcode=1)+
|
|
|
|
api.step_data('Scale CPU 0 to 0.600000 (attempt 3)', retcode=1)
|
|
|
|
)
|
|
|
|
|
|
|
|
builder = ('Perf-Android-Clang-Nexus5x-GPU-Adreno418-arm64-Release'
|
|
|
|
'-All-Android')
|
|
|
|
yield (
|
|
|
|
api.test('cpu_scale_failed_golo') +
|
|
|
|
api.properties(buildername=builder,
|
|
|
|
revision='abc123',
|
|
|
|
path_config='kitchen',
|
|
|
|
swarm_out_dir='[SWARM_OUT_DIR]') +
|
|
|
|
api.step_data('get swarming bot id',
|
|
|
|
stdout=api.raw_io.output('build123-m2--device5')) +
|
|
|
|
api.step_data('Scale CPU 4 to 0.600000', retcode=1)+
|
|
|
|
api.step_data('Scale CPU 4 to 0.600000 (attempt 2)', retcode=1)+
|
|
|
|
api.step_data('Scale CPU 4 to 0.600000 (attempt 3)', retcode=1)
|
|
|
|
)
|