summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorrsimha@chromium.org <rsimha@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-20 01:10:24 +0000
committerrsimha@chromium.org <rsimha@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-20 01:10:24 +0000
commite4c029f76eb948af468a4d11ec0d3272671ddb58 (patch)
treef80be661f716ca63d85e2f94d562b89c242af599 /build
parent00353d188a87c6a2f953e22a73d7c18fa2c37b2a (diff)
downloadchromium_src-e4c029f76eb948af468a4d11ec0d3272671ddb58.zip
chromium_src-e4c029f76eb948af468a4d11ec0d3272671ddb58.tar.gz
chromium_src-e4c029f76eb948af468a4d11ec0d3272671ddb58.tar.bz2
[sync] Divorce python sync test server chromiumsync.py from testserver.py
Various chrome test suites use the infrastructure in net::LocalTestServer and net/tools/testserver.py to create local test server instances against which to run automated tests. Sync tests use reference implementations of sync and xmpp servers, which build on the testserver infrastructure in net/. In the past, the sync testserver was small enough that it made sense for it to be a part of the testserver in net/. This, however, resulted in an unwanted dependency from net/ onto sync/, due to the sync proto modules needed to run a python sync server. Now that the sync testserver has grown considerably in scope, it is time to separate it out from net/ while reusing base testserver code, and eliminate the dependency from net/ onto sync/. This work also provides us with the opportunity to remove a whole bunch of dead pyauto sync test code in chrome/test/functional. This patch does the following: - Moves the native class LocalSyncTestServer from net/test/ to sync/test/. - Moves chromiumsync{_test}.py and xmppserver{_test}.py from net/tools/testserver/ to sync/tools/testserver/. - Removes all sync server specific code from net/. - Adds a new sync_testserver.py runner script for the python sync test. - Moves some base classes from testserver.py to testserver_base.py so they can be reused by sync_testserver.py. - Audits all the python imports in testserver.py, testserver_base.py and sync_testserver.py to make sure there are no unnecessary / missing imports. - Adds a new run_sync_testserver runner executable to launch a sync testserver. - Removes a couple of static methods from LocalTestServer, that were being used by run_testserver, and refactors run_sync_testserver to use their non-static versions. - Adds the ability to run both chromiumsync_test.py and xmppserver_test.py from run_sync_testserver. - Fixes chromiumsync.py to undo / rectify some older changes that broke tests in chromiumsync_test.py. - Adds a new test target called test_support_sync_testserver to sync.gyp. - Removes the hacky dependency on sync_proto from net.gyp:net_test_support. - Updates various gyp files across chrome to use the new sync testserver target. - Audits dependencies of net_test_support, run_testserver, and the newly added targets. - Fixes the android chrome testserver spawner script to account for the above changes. - Removes all mentions of TYPE_SYNC from the pyauto TestServer shim. - Deletes all (deprecated) pyauto sync tests. (They had all become broken over time, gotten disabled, and were all redundant due to their equivalent sync integration tests.) - Removes all sync related pyauto hooks from TestingAutomationProvider, since they are no longer going to be used. - Takes care of a TODO in safe_browser_testserver.py to remove an unnecessary code block. Note: A majority of the bugs listed below are for individual pyauto sync tests. Deleting the sync pyauto test script fixes all these bugs in one fell swoop. TBR=mattm@chromium.org BUG=117559, 119403, 159731, 15016, 80329, 49378, 87642, 86949, 88679, 104227, 88593, 124913 TEST=run_testserver, run_sync_testserver, sync_integration_tests, sync_performance_tests. All chrome tests that use a testserver should continue to work. Review URL: https://codereview.chromium.org/11971025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@177864 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build')
-rw-r--r--build/android/pylib/chrome_test_server_spawner.py26
1 files changed, 16 insertions, 10 deletions
diff --git a/build/android/pylib/chrome_test_server_spawner.py b/build/android/pylib/chrome_test_server_spawner.py
index 8206ca0..f70bf66 100644
--- a/build/android/pylib/chrome_test_server_spawner.py
+++ b/build/android/pylib/chrome_test_server_spawner.py
@@ -1,4 +1,4 @@
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
+# Copyright 2013 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.
@@ -24,18 +24,19 @@ from forwarder import Forwarder
import ports
-# Path that are needed to import necessary modules when running testserver.py.
-os.environ['PYTHONPATH'] = os.environ.get('PYTHONPATH', '') + ':%s:%s:%s:%s' % (
- os.path.join(constants.CHROME_DIR, 'third_party'),
- os.path.join(constants.CHROME_DIR, 'third_party', 'tlslite'),
- os.path.join(constants.CHROME_DIR, 'third_party', 'pyftpdlib', 'src'),
- os.path.join(constants.CHROME_DIR, 'net', 'tools', 'testserver'))
+# Path that are needed to import necessary modules when launching a testserver.
+os.environ['PYTHONPATH'] = os.environ.get('PYTHONPATH', '') + (':%s:%s:%s:%s:%s'
+ % (os.path.join(constants.CHROME_DIR, 'third_party'),
+ os.path.join(constants.CHROME_DIR, 'third_party', 'tlslite'),
+ os.path.join(constants.CHROME_DIR, 'third_party', 'pyftpdlib', 'src'),
+ os.path.join(constants.CHROME_DIR, 'net', 'tools', 'testserver'),
+ os.path.join(constants.CHROME_DIR, 'sync', 'tools', 'testserver')))
SERVER_TYPES = {
'http': '',
'ftp': '-f',
- 'sync': '--sync',
+ 'sync': '', # Sync uses its own script, and doesn't take a server type arg.
'tcpecho': '--tcp-echo',
'udpecho': '--udp-echo',
}
@@ -207,8 +208,13 @@ class TestServerThread(threading.Thread):
logging.info('Start running the thread!')
self.wait_event.clear()
self._GenerateCommandLineArguments()
- command = [os.path.join(constants.CHROME_DIR, 'net', 'tools',
- 'testserver', 'testserver.py')] + self.command_line
+ command = constants.CHROME_DIR
+ if self.arguments['server-type'] == 'sync':
+ command = [os.path.join(command, 'sync', 'tools', 'testserver',
+ 'sync_testserver.py')] + self.command_line
+ else:
+ command = [os.path.join(command, 'net', 'tools', 'testserver',
+ 'testserver.py')] + self.command_line
logging.info('Running: %s', command)
self.process = subprocess.Popen(command)
if self.process: