def run_js_tests(js_dir, test_filter=None, phase=None): import windmill windmill.js_framework_active = True js_dir = os.path.abspath(os.path.expanduser(js_dir)) from windmill.dep import wsgi_fileserver WSGIFileServerApplication = wsgi_fileserver.WSGIFileServerApplication application = WSGIFileServerApplication(root_path=os.path.abspath(js_dir), mount_point='/windmill-jstest/') from windmill.server import wsgi wsgi.add_namespace('windmill-jstest', application) # Build list of files and send to IDE base_url = windmill.settings['TEST_URL'] + '/windmill-jstest' js_files = [] def parse_files(x, directory, files): if not os.path.split(directory)[-1].startswith('.'): additional_dir = directory.replace(js_dir, '') js_files.extend( [additional_dir + '/' + f for f in files if f.endswith('.js')]) os.path.walk(js_dir, parse_files, 'x') kwargs = {} kwargs['files'] = [base_url + f for f in js_files] kwargs['uuid'] = str(uuid.uuid1()) if test_filter: kwargs['filter'] = test_filter if phase: kwargs['phase'] = phase xmlrpc_client.add_command({'method': 'commands.jsTests', 'params': kwargs})
def run_js_tests(js_dir, test_filter=None, phase=None): import windmill windmill.js_framework_active = True js_dir = os.path.abspath(os.path.expanduser(js_dir)) from windmill.dep import wsgi_fileserver WSGIFileServerApplication = wsgi_fileserver.WSGIFileServerApplication application = WSGIFileServerApplication(root_path=os.path.abspath(js_dir), mount_point='/windmill-jstest/') from windmill.server import wsgi wsgi.add_namespace('windmill-jstest', application) # Build list of files and send to IDE base_url = windmill.settings['TEST_URL']+'/windmill-jstest' js_files = [] def parse_files(x, directory, files): if not os.path.split(directory)[-1].startswith('.'): additional_dir = directory.replace(js_dir, '') js_files.extend( [additional_dir+'/'+f for f in files if f.endswith('.js')] ) os.path.walk(js_dir, parse_files, 'x') kwargs = {} kwargs['files'] = [base_url+f for f in js_files ] kwargs['uuid'] = str(uuid.uuid1()) if test_filter: kwargs['filter'] = test_filter if phase: kwargs['phase'] = phase xmlrpc_client.add_command({ 'method':'commands.setOptions', 'params': { 'scriptAppendOnly': windmill.settings['SCRIPT_APPEND_ONLY'] } }) xmlrpc_client.add_command({'method':'commands.jsTests', 'params':kwargs})
def run_js_tests(js_dir, test_filter=None, phase=None): import windmill windmill.js_framework_active = True js_dir = os.path.abspath(os.path.expanduser(js_dir)) from webenv.applications.file_server import FileServerApplication application = FileServerApplication(os.path.abspath(js_dir)) server.add_namespace('windmill-jstest', application) # Build list of files and send to IDE base_url = windmill.settings['TEST_URL']+'/windmill-jstest' js_files = [] def parse_files(x, directory, files): if not os.path.split(directory)[-1].startswith('.'): additional_dir = directory.replace(js_dir, '') js_files.extend( [additional_dir+'/'+f for f in files if f.endswith('.js')] ) os.path.walk(js_dir, parse_files, 'x') kwargs = {} kwargs['files'] = [base_url+f for f in js_files ] kwargs['uuid'] = str(uuid.uuid1()) if test_filter: kwargs['filter'] = test_filter if phase: kwargs['phase'] = phase xmlrpc_client.add_command({'method':'commands.jsTests', 'params':kwargs})
def add_object(self, queue_method, action_object, suite_name=None): """Procedue neutral addition method""" callback_object = copy.copy(callback) callback_object.update(action_object) if not callback_object["params"].get("uuid"): callback_object["params"]["uuid"] = str(uuid.uuid1()) self._logger.debug("Adding object %s" % str(callback_object)) queue_method(callback_object, suite_name=suite_name) return callback_object["params"]["uuid"]
def add_object(self, queue_method, action_object, suite_name=None): """Procedue neutral addition method""" callback_object = copy.copy(callback) callback_object.update(action_object) if not callback_object['params'].get('uuid'): callback_object['params']['uuid'] = str(uuid.uuid1()) self._logger.debug('Adding object %s' % str(callback_object)) queue_method(callback_object, suite_name=suite_name) return callback_object['params']['uuid']