Best Python code snippet using yandex-tank
plugin.py
Source:plugin.py
...874 return self._number875 def close(self, *args, **kwargs):876 logger.debug('Cannot close job in the cloud mode')877 def create(self):878 cloud_job_id = self.storage.get_cloud_job_id(self.tank_job_id)879 if cloud_job_id is None:880 response = self.api_client.create_test(self.target_host, self.target_port, self.name, self.description, self.load_scheme)881 self.storage.push_job(cloud_job_id, self.core.test_id)882 metadata = test_service_pb2.CreateTestMetadata()883 response.metadata.Unpack(metadata)884 self._number = metadata.id885 logger.info('Job was created: {}'.format(self._number))886 else:887 self._number = cloud_job_id888 def send_status(self, *args, **kwargs):889 logger.debug('Tank client is sending the status')890 def send_config(self, *args, **kwargs):891 logger.debug('Do not send config to the cloud service')892 def push_monitoring_data(self, *args, **kwargs):...
tankcore.py
Source:tankcore.py
...497 with open(self.storage_file, 'a') as f:498 job_data = {CLOUD_KEY: cloud_job_id, TANK_KEY: tank_job_id}499 logger.info(f"Push job to storage {self.storage_file}: {job_data}")500 yaml.dump([job_data], f)501 def get_cloud_job_id(self, tank_job_id):502 try:503 with open(self.storage_file) as f:504 data = yaml.safe_load(f)505 for job in data:506 if job[TANK_KEY] == tank_job_id:507 return job[CLOUD_KEY]508 except FileNotFoundError:509 return510 return511class Lock(object):512 PID = 'pid'513 TEST_ID = 'test_id'514 TEST_DIR = 'test_dir'515 LOCK_FILE_WILDCARD = 'lunapark_*.lock'...
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.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!