How to use get_create_job_common_args method in autotest

Best Python code snippet using autotest_python

rpc_interface.py

Source:rpc_interface.py Github

copy

Full Screen

...314 (param value,315 param type)316 """317 # Save the values of the passed arguments here. What we're going to do with318 # them is pass them all to rpc_utils.get_create_job_common_args(), which319 # will extract the subset of these arguments that apply for320 # rpc_utils.create_job_common(), which we then pass in to that function.321 args = locals()322 # Set up the parameterized job configs323 test_obj = models.Test.smart_get(test)324 if test_obj.test_type == model_attributes.TestTypes.SERVER:325 control_type = models.Job.ControlType.SERVER326 else:327 control_type = models.Job.ControlType.CLIENT328 try:329 label = models.Label.smart_get(label)330 except models.Label.DoesNotExist:331 label = None332 kernel_objs = models.Kernel.create_kernels(kernel)333 profiler_objs = [models.Profiler.smart_get(profiler)334 for profiler in profilers]335 parameterized_job = models.ParameterizedJob.objects.create(336 test=test_obj, label=label, use_container=use_container,337 profile_only=profile_only,338 upload_kernel_config=upload_kernel_config)339 parameterized_job.kernels.add(*kernel_objs)340 for profiler in profiler_objs:341 parameterized_profiler = models.ParameterizedJobProfiler.objects.create(342 parameterized_job=parameterized_job,343 profiler=profiler)344 profiler_params = profiler_parameters.get(profiler.name, {})345 for name, (value, param_type) in profiler_params.iteritems():346 models.ParameterizedJobProfilerParameter.objects.create(347 parameterized_job_profiler=parameterized_profiler,348 parameter_name=name,349 parameter_value=value,350 parameter_type=param_type)351 try:352 for parameter in test_obj.testparameter_set.all():353 if parameter.name in parameters:354 param_value, param_type = parameters.pop(parameter.name)355 parameterized_job.parameterizedjobparameter_set.create(356 test_parameter=parameter, parameter_value=param_value,357 parameter_type=param_type)358 if parameters:359 raise Exception('Extra parameters remain: %r' % parameters)360 return rpc_utils.create_job_common(361 parameterized_job=parameterized_job.id,362 control_type=control_type,363 **rpc_utils.get_create_job_common_args(args))364 except:365 parameterized_job.delete()366 raise367def create_job(name, priority, control_file, control_type,368 hosts=(), meta_hosts=(), one_time_hosts=(),369 atomic_group_name=None, synch_count=None, is_template=False,370 timeout=None, max_runtime_hrs=None, run_verify=True,371 email_list='', dependencies=(), reboot_before=None,372 reboot_after=None, parse_failed_repair=None, hostless=False,373 keyvals=None, drone_set=None):374 """\375 Create and enqueue a job.376 @param name name of this job377 @param priority Low, Medium, High, Urgent378 @param control_file String contents of the control file.379 @param control_type Type of control file, Client or Server.380 @param synch_count How many machines the job uses per autoserv execution.381 synch_count == 1 means the job is asynchronous. If an atomic group is382 given this value is treated as a minimum.383 @param is_template If true then create a template job.384 @param timeout Hours after this call returns until the job times out.385 @param max_runtime_hrs Hours from job starting time until job times out386 @param run_verify Should the host be verified before running the test?387 @param email_list String containing emails to mail when the job is done388 @param dependencies List of label names on which this job depends389 @param reboot_before Never, If dirty, or Always390 @param reboot_after Never, If all tests passed, or Always391 @param parse_failed_repair if true, results of failed repairs launched by392 this job will be parsed as part of the job.393 @param hostless if true, create a hostless job394 @param keyvals dict of keyvals to associate with the job395 @param hosts List of hosts to run job on.396 @param meta_hosts List where each entry is a label name, and for each entry397 one host will be chosen from that label to run the job on.398 @param one_time_hosts List of hosts not in the database to run the job on.399 @param atomic_group_name The name of an atomic group to schedule the job on.400 @param drone_set The name of the drone set to run this test on.401 @returns The created Job id number.402 """403 return rpc_utils.create_job_common(404 **rpc_utils.get_create_job_common_args(locals()))405def abort_host_queue_entries(**filter_data):406 """\407 Abort a set of host queue entries.408 """409 query = models.HostQueueEntry.query_objects(filter_data)410 query = query.filter(complete=False)411 models.AclGroup.check_abort_permissions(query)412 host_queue_entries = list(query.select_related())413 rpc_utils.check_abort_synchronous_jobs(host_queue_entries)414 for queue_entry in host_queue_entries:415 queue_entry.abort()416def reverify_hosts(**filter_data):417 """\418 Schedules a set of hosts for verify....

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run autotest automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful