How to use edit_metainfo method in yandex-tank

Best Python code snippet using yandex-tank

cli.py

Source:cli.py Github

copy

Full Screen

...71 config.set(SECTION, 'launched_from', 'post-loader')72 output = StringIO()73 config.write(output)74 lp_job.send_config_snapshot(output.getvalue())75def edit_metainfo(lp_config, lp_job):76 lp_job.edit_metainfo(is_regression=lp_config.get('regress'),77 regression_component=lp_config.get('component'),78 cmdline=lp_config.get('cmdline'),79 ammo_path=lp_config.get('ammo_path'),80 loop_count=lp_config.get('loop_count'))81def get_plugin_dir(shooting_dir):82 DIRNAME = 'lunapark'83 parent = os.path.abspath(os.path.join(shooting_dir, os.pardir))84 if os.path.basename(parent) == DIRNAME:85 return parent86 else:87 plugin_dir = os.path.join(parent, DIRNAME)88 if not os.path.exists(plugin_dir):89 os.makedirs(plugin_dir)90 return plugin_dir91def make_symlink(shooting_dir, name):92 plugin_dir = get_plugin_dir(shooting_dir)93 link_name = os.path.join(plugin_dir, str(name))94 os.symlink(os.path.relpath(shooting_dir, plugin_dir), link_name)95 logger.info('Symlink created: {}'.format(os.path.abspath(link_name)))96def post_loader():97 parser = argparse.ArgumentParser()98 parser.add_argument('shooting_dir',99 help='Directory containing shooting artifacts')100 shooting_dir = parser.parse_args().shooting_dir101 assert os.path.exists(shooting_dir), 'Directory not found'102 config = read_config(shooting_dir)103 lp_config = get_lp_config(config)104 api_client = APIClient(base_url=lp_config['api_address'],105 user_agent='Lunapark/{}'.format(pkg_resources.require('yatank-internal-lunapark')[0].version)106 # todo: add timeouts107 )108 lp_job = LPJob(109 client=api_client,110 target_host=lp_config.get('target_host'),111 target_port=lp_config.get('target_port'),112 person=lp_config.get(113 'operator',114 '') or pwd.getpwuid(115 os.geteuid())[0],116 task=lp_config['task'],117 name=lp_config['job_name'],118 description=lp_config['job_dsc'],119 tank=socket.getfqdn())120 edit_metainfo(lp_config, lp_job)121 upload_data(shooting_dir, DATA_LOG, lp_job)122 send_config_snapshot(config, lp_job)123 try:124 upload_monitoring(shooting_dir, MONITORING_LOG, lp_job)125 except AssertionError as e:126 logger.error(e)127 lp_job.close(0)128 make_symlink(shooting_dir, lp_job.number)129 logger.info(130 'LP job created: {}'.format(131 urljoin(132 api_client.base_url, str(133 lp_job.number))))134if __name__ == '__main__':...

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 yandex-tank 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