Index: scripts/slave/recipe_modules/webrtc/api.py |
diff --git a/scripts/slave/recipe_modules/webrtc/api.py b/scripts/slave/recipe_modules/webrtc/api.py |
index bea8f605b5820f70a510a8fa3eab5b966e04f77e..060e8755cccba99876101cdca0e5a3efc9ed5df2 100644 |
--- a/scripts/slave/recipe_modules/webrtc/api.py |
+++ b/scripts/slave/recipe_modules/webrtc/api.py |
@@ -15,23 +15,35 @@ class WebRTCApi(recipe_api.RecipeApi): |
RECIPE_CONFIGS = builders.RECIPE_CONFIGS |
COMMON_TESTS = [ |
- 'audio_decoder_unittests', |
- 'common_audio_unittests', |
- 'common_video_unittests', |
- 'modules_tests', |
- 'modules_unittests', |
- 'system_wrappers_unittests', |
- 'test_support_unittests', |
- 'tools_unittests', |
- 'video_engine_core_unittests', |
- 'video_engine_tests', |
- 'voice_engine_unittests', |
+ 'audio_decoder_unittests', |
+ 'common_audio_unittests', |
+ 'common_video_unittests', |
+ 'modules_tests', |
+ 'modules_unittests', |
+ 'system_wrappers_unittests', |
+ 'test_support_unittests', |
+ 'tools_unittests', |
+ 'video_engine_core_unittests', |
+ 'video_engine_tests', |
+ 'voice_engine_unittests', |
] |
- ANDROID_APK_TESTS = COMMON_TESTS + [ |
- 'video_capture_tests', |
- 'webrtc_perf_tests', |
- ] |
+ # Android APK tests. Mapping between test name and isolate file location. |
+ ANDROID_APK_TESTS = { |
+ 'audio_decoder_unittests': 'webrtc/modules/audio_coding/neteq', |
+ 'common_audio_unittests': 'webrtc/common_audio', |
+ 'common_video_unittests': 'webrtc/common_video', |
+ 'modules_tests': 'webrtc/modules', |
+ 'modules_unittests': 'webrtc/modules', |
+ 'system_wrappers_unittests': 'webrtc/system_wrappers/source', |
+ 'test_support_unittests': 'webrtc/test', |
+ 'tools_unittests': 'webrtc/tools', |
+ 'video_capture_tests': 'webrtc/modules/video_capture', |
+ 'video_engine_tests': 'webrtc', |
+ 'video_engine_core_unittests': 'webrtc/video_engine', |
+ 'voice_engine_unittests': 'webrtc/voice_engine', |
+ 'webrtc_perf_tests': 'webrtc', |
+ } |
NORMAL_TESTS = sorted(COMMON_TESTS + [ |
'libjingle_media_unittest', |
@@ -59,72 +71,69 @@ class WebRTCApi(recipe_api.RecipeApi): |
DASHBOARD_UPLOAD_URL = 'https://chromeperf.appspot.com' |
def runtests(self, test_suite=None, revision=None): |
- """Generate a list of tests to run. |
+ """Add a suite of test steps. |
Args: |
test_suite: The name of the test suite. |
revision: Revision for the build. Mandatory for perf measuring tests. |
""" |
- steps = [] |
if test_suite == 'webrtc': |
for test in self.NORMAL_TESTS: |
- steps.append(self.add_test(test)) |
+ self.add_test(test) |
if self.m.platform.is_mac and self.m.chromium.c.TARGET_BITS == 64: |
test = self.m.path.join('libjingle_peerconnection_objc_test.app', |
'Contents', 'MacOS', |
'libjingle_peerconnection_objc_test') |
- steps.append(self.add_test(test, |
- name='libjingle_peerconnection_objc_test')) |
+ self.add_test(test, name='libjingle_peerconnection_objc_test') |
elif test_suite == 'webrtc_baremetal': |
# Add baremetal tests, which are different depending on the platform. |
if self.m.platform.is_win or self.m.platform.is_mac: |
- steps.append(self.add_test('audio_device_tests')) |
+ self.add_test('audio_device_tests') |
elif self.m.platform.is_linux: |
f = self.m.path['checkout'].join |
- steps.append(self.add_test( |
+ self.add_test( |
'audioproc', |
args=['-aecm', '-ns', '-agc', '--fixed_digital', '--perf', '-pb', |
f('resources', 'audioproc.aecdump')], |
revision=revision, |
- perf_test=True)) |
- steps.append(self.add_test( |
+ perf_test=True) |
+ self.add_test( |
'iSACFixtest', |
args=['32000', f('resources', 'speech_and_misc_wb.pcm'), |
'isac_speech_and_misc_wb.pcm'], |
revision=revision, |
- perf_test=True)) |
- steps.append(self.virtual_webcam_check()) |
- steps.append(self.add_test( |
+ perf_test=True) |
+ self.virtual_webcam_check() |
+ self.add_test( |
'libjingle_peerconnection_java_unittest', |
- env={'LD_PRELOAD': '/usr/lib/x86_64-linux-gnu/libpulse.so.0'})) |
+ env={'LD_PRELOAD': '/usr/lib/x86_64-linux-gnu/libpulse.so.0'}) |
- steps.append(self.virtual_webcam_check()) |
- steps.append(self.add_test( |
+ self.virtual_webcam_check() |
+ self.add_test( |
'vie_auto_test', |
args=['--automated', |
'--capture_test_ensure_resolution_alignment_in_capture_device=' |
'false'], |
revision=revision, |
- perf_test=True)) |
- steps.append(self.add_test('voe_auto_test', args=['--automated'])) |
- steps.append(self.virtual_webcam_check()) |
- steps.append(self.add_test('video_capture_tests')) |
- steps.append(self.add_test('webrtc_perf_tests', revision=revision, |
- perf_test=True)) |
+ perf_test=True) |
+ self.add_test('voe_auto_test', args=['--automated']) |
+ self.virtual_webcam_check() |
+ self.add_test('video_capture_tests') |
+ self.add_test('webrtc_perf_tests', revision=revision, perf_test=True) |
elif test_suite == 'chromium': |
# Many of these tests run in the Chromium WebRTC waterfalls are not run in |
# the main Chromium waterfalls as they are marked as MANUAL_. This is |
# because they rely on physical audio and video devices, which are only |
# available at bare-metal machines. |
- steps.append(self.add_test( |
+ self.add_test( |
'content_browsertests', |
args=['--gtest_filter=WebRtc*', '--run-manual', |
'--test-launcher-print-test-stdio=always', |
'--test-launcher-bot-mode'], |
revision=revision, |
- perf_test=True)) |
- steps.append(self.add_test( |
+ perf_test=True) |
+ self.add_test( |
'browser_tests', |
# These tests needs --test-launcher-jobs=1 since some of them are |
# not able to run in parallel (due to the usage of the |
@@ -135,12 +144,20 @@ class WebRTCApi(recipe_api.RecipeApi): |
'--test-launcher-bot-mode', |
'--test-launcher-print-test-stdio=always'], |
revision=revision, |
- perf_test=True)) |
- steps.append(self.add_test( |
+ perf_test=True) |
+ self.add_test( |
'content_unittests', |
- args=['--gtest_filter=WebRtc*:WebRTC*:RTC*:MediaStream*'])) |
+ args=['--gtest_filter=WebRtc*:WebRTC*:RTC*:MediaStream*']) |
+ elif test_suite == 'android': |
+ self.m.chromium_android.common_tests_setup_steps() |
+ |
+ for test in sorted(self.ANDROID_APK_TESTS.keys()): |
+ # Add the filename of the test.isolate files to the path. |
+ isolate_file = self.m.path.join(self.ANDROID_APK_TESTS[test], |
+ '%s.isolate' % test) |
+ self.test_runner(test, isolate_file) |
- return steps |
+ self.m.chromium_android.common_tests_final_steps() |
def add_test(self, test, name=None, args=None, revision=None, env=None, |
perf_test=False, perf_dashboard_id=None): |
@@ -167,6 +184,21 @@ class WebRTCApi(recipe_api.RecipeApi): |
test=test, args=args, name=name, annotate='gtest', xvfb=True, |
test_type=test, env=env) |
+ def test_runner(self, test, isolate_path): |
+ """Adds a test to run on Android devices. |
+ |
+ This is a minimal version for WebRTC, similar to the methods in the |
+ chromium_android recipe module. It's needed since we need to alter the |
+ environment. |
+ """ |
+ script = self.m.path['checkout'].join('build', 'android', 'test_runner.py') |
+ args = ['gtest', '-s', test, '--verbose', '--isolate-file-path', |
+ isolate_path] |
+ if self.m.chromium.c.BUILD_CONFIG == 'Release': |
+ args.append('--release') |
+ env = {'CHECKOUT_SOURCE_ROOT': self.m.path['checkout']} |
+ self.m.python(test, script, args, env=env) |
+ |
def sizes(self, revision): |
# TODO(kjellander): Move this into a function of the chromium recipe |
# module instead. |
@@ -193,37 +225,29 @@ class WebRTCApi(recipe_api.RecipeApi): |
build_revision=revision) |
def extract_build(self, gs_url, revision): |
+ # Ensure old build directory is not used is by removing it. |
+ self.m.path.rmtree( |
+ 'build directory', |
+ self.m.chromium.c.build_dir.join(self.m.chromium.c.build_config_fs)) |
+ |
self.m.archive.download_and_unzip_build( |
'extract build', |
self.m.chromium.c.build_config_fs, |
gs_url, |
build_revision=revision) |
+ if not self.m.properties.get('parent_got_revision'): |
+ raise self.m.step.StepFailure( |
+ 'Testers cannot be forced without providing revision information.' |
+ 'Please select a previous build and click [Rebuild] or force a build' |
+ 'for a Builder instead (will trigger new runs for the testers).') |
+ |
def cleanup(self): |
if self.m.chromium.c.TARGET_PLATFORM == 'android': |
self.m.chromium_android.clean_local_files() |
else: |
self.m.chromium.cleanup_temp() |
- def apply_svn_patch(self): |
- """Patch step for applying WebRTC patches to Chromium checkouts. |
- |
- This step should only be used when patches are to be applied to WebRTC as a |
- part of a Chromium checkout. It is not supported on Windows. |
- """ |
- assert self.m.chromium.c.TARGET_PLATFORM != "win", ( |
- 'This step is not supported on the Windows platform.') |
- script = self.m.path['build'].join('scripts', 'slave', 'apply_svn_patch.py') |
- args = ['-p', self.m.properties['patch_url'], |
- '-r', self.c.patch_root_dir] |
- |
- # Allow manipulating patches for try jobs. |
- if self.c.patch_filter_script and self.c.patch_path_filter: |
- args += ['--filter-script', self.c.patch_filter_script, |
- '--strip-level', self.c.patch_strip_level, |
- '--', '--path-filter', self.c.patch_path_filter] |
- self.m.python('apply_patch', script, args) |
- |
def virtual_webcam_check(self): |
self.m.python( |
'webcam_check', |