SubmitJob
submit_job(public_api_client, target_id, job_name, external_job_id, job_type, job_mode, timeout, test_framework, entry_script, job_artifacts, monkey_events, monkey_session_timeout, job_parameters=None)
Expand source code
submit_job(public_api_client, target_id, job_name, external_job_id, job_type, job_mode, timeout, test_framework, entry_script, job_artifacts, monkey_events, monkey_session_timeout, job_parameters=None):"""Description-----------To submit a new job.Args----public_api_client: QDC api client object.target_id: Chipset on which job needs to be executed.job_name: Name of the job user wanted to create.external_job_id: Job identifier used in external system (value is optional can be None).job_type: Type of the job, we have only Automated job support.job_mode: Mode of the job (Application, AI mode etc.). for now, we have application mode support.timeout: Job timeout in minutes.test_framework: Framework to be used for test execution (APPIUM, POWERSHELL, MONKEY, BASH).entry_script: Entry point script will be executed as part of test execution, mandatory for POWERSHELL test framework.job_artifacts: List of uploaded test artifacts to be used for test execution.monkey_events: number of monkey test event, needed only for monkey testframework.monkey_session_timeout: monkey test session timeout in minutes, needed only for monkey testframework.job_parameters: (optional) device configurations, set this value according to different job_type, job_mode, target_idReturns-------long: Newly submitted job id.None: In case of any failure.Usages------job_name = "Sample Test Job" # name of the job user wanted to create must be less than 32 charsexternal_job_id = "ExJobId001" # job identifier used in external system (value is optional can be None also)job_type = JobType.AUTOMATED # type of the job, we have only Automated job supportjob_mode = JobMode.APPLICATION # mode of the job (Application, AI mode etc.). for now, we have application mode supporttimeout = 5 # job timeout in minutesframework = TestFramework.POWERSHELL # framework to be used for test execution (APPIUM, POWERSHELL, MONKEY, BASH)entry_script = "test.ps1" # entry point script will be executed as part of test execution, mandatory for POWERSHELL test frameworkjob_artifacts = [apk_uuid, script_uuid] # list of uploaded test artifacts to be used for test executionMobile: Supported test package: apkCompute: Supported test package: msi, zipIOT/Automotive: Supported test package: zipmonkey_events = 500 # number of monkey test event, needed only for monkey testframework.monkey_session_timeout = 100 # monkey test session timeout in minutes, needed only for monkey testframework.job_parameters = [JobSubmissionParameter.WIFIENABLED] # application scenarios of device configurationWifiEnabled: Valid in devices except ComputeBluetoothEnabled: Valid in devices except ComputeScreenAlwaysOn: Not valid in Ubuntu OS / AutomotiveGPSEnabled: Not checkedProfilingEnabled: Only valid in Android OSRefreshEnabledBeforeJobStart: Not checkedInstallSNPE: Only valid in ComputeSSH ONLY: Only valid in Interactive Jobjob_id = qdc_api.submit_job(public_api_client, target_id, job_name, external_job_id, job_type, job_mode, timeout, framework, entry_script, job_artifacts, monkey_events, monkey_session_timeout, job_parameters)"""if job_parameters is None:job_parameters = []job_creation_payload = CreateJobType0(target_id=target_id,job_name=job_name,external_job_id=external_job_id,job_type=job_type,job_mode=job_mode,timeout_in_minutes=timeout,test_framework=test_framework,entry_script=entry_script,job_artifacts=job_artifacts,monkey_events=monkey_events,monkey_session_timeout=monkey_session_timeout,job_parameters=job_parameters)job_creation_response = post_jobs.sync_detailed(client=get_client_with_headers_added(public_api_client), body=job_creation_payload)if job_creation_response.status_code == 200:print(f"Submit job response: {job_creation_response.content.decode('utf-8')}")job_id = job_creation_response.parsed.job_idprint(f"Job Id: {job_id}")return job_idelse:print(f"Submit a job failed with error code {job_creation_response.status_code} {job_creation_response.content.decode('utf-8')}")return None
Description
To submit a new job.
Arguments
public_api_client
: QDC api client object.target_id
: Chipset on which job needs to be executed.job_name
: Name of the job user wanted to create.external_job_id
: Job identifier used in external system (value is optional can be None).job_type
: Type of the job, we have only Automated job support.job_mode
: Mode of the job (Application, AI mode etc.). for now, we have application mode support.timeout
: Job timeout in minutes.test_framework
: Framework to be used for test execution (APPIUM, POWERSHELL, MONKEY, BASH).entry_script
: Entry point script will be executed as part of test execution, mandatory for POWERSHELL test framework.job_artifacts
: List of uploaded test artifacts to be used for test execution.monkey_events
: number of monkey test event, needed only for monkey testframework.monkey_session_timeout
: monkey test session timeout in minutes, needed only for monkey testframework.job_parameters
: (optional) device configurations, set this value according to different job_type, job_mode, target_id
Returns
long
: Newly submitted job id.None
: In case of any failure.
Usages
job_name = "Sample Test Job" # name of the job user wanted to create must be less than 32 charsexternal_job_id = "ExJobId001" # job identifier used in external system (value is optional can be None also)job_type = JobType.AUTOMATED # type of the job, we have only Automated job supportjob_mode = JobMode.APPLICATION # mode of the job (Application, AI mode etc.). for now, we have application mode supporttimeout = 5 # job timeout in minutesframework = TestFramework.POWERSHELL # framework to be used for test execution (APPIUM, POWERSHELL, MONKEY, BASH)entry_script = "test.ps1" # entry point script will be executed as part of test execution, mandatory for POWERSHELL test frameworkjob_artifacts = [apk_uuid, script_uuid] # list of uploaded test artifacts to be used for test executionMobile: Supported test package: apkCompute: Supported test package: msi, zipIOT/Automotive: Supported test package: zipmonkey_events = 500 # number of monkey test event, needed only for monkey testframework.monkey_session_timeout = 100 # monkey test session timeout in minutes, needed only for monkey testframework.job_parameters = [JobSubmissionParameter.WIFIENABLED] # application scenarios of device configurationWifiEnabled: Valid in devices except ComputeBluetoothEnabled: Valid in devices except ComputeScreenAlwaysOn: Not valid in Ubuntu OS / AutomotiveGPSEnabled: Not checkedProfilingEnabled: Only valid in Android OSRefreshEnabledBeforeJobStart: Not checkedInstallSNPE: Only valid in ComputeSSH ONLY: Only valid in Interactive Jobjob_id = qdc_api.submit_job(public_api_client, target_id, job_name, external_job_id, job_type, job_mode, timeout, framework, entry_script, job_artifacts, monkey_events, monkey_session_timeout, job_parameters)