예제 #1
0
def java_maven_init():
    print('%s开始java maven更新......'%DateTimeTool.getNowTime())
    print('%s删除旧的maven依赖包......'%DateTimeTool.getNowTime())
    FileTool.truncateDir('common/java/lib/java/libs')
    print('%s删除旧的maven依赖包完成......'%DateTimeTool.getNowTime())
    maven_update_command = 'mvn -U -f "' + os.path.join(os.getcwd(),'config/java/pom.xml"') + ' dependency:copy-dependencies -DoutputDirectory="' + os.path.join(os.getcwd(), 'common/java/lib/java/libs"')
    output = subprocess.check_output(maven_update_command, shell=True, timeout=3600)
    if 'Windows' == platform.system():
        print(output.decode('cp936'))
    else:
        print(output.decode('utf-8'))
    print('%s完成java maven更新......'%DateTimeTool.getNowTime())
예제 #2
0
def java_maven_init():
    print('开始java maven更新......')
    print('删除旧的maven依赖包......')
    FileTool.truncateDir('common/java/lib/java/libs')
    print('删除旧的maven依赖包完成......')
    maven_update_command = 'mvn -U -f ' + os.path.join(
        os.getcwd(), 'config/java/pom.xml'
    ) + ' dependency:copy-dependencies -DoutputDirectory=' + os.path.join(
        os.getcwd(), 'common/java/lib/java/libs')
    try:
        output = subprocess.check_output(maven_update_command,
                                         shell=True,
                                         timeout=3600)
        print(output.decode('utf-8'))
    except:
        sys.exit('java maven更新失败......')
    print('完成java maven更新......')
예제 #3
0
 keyword=args.keyword
 dir=args.dir
 markexpr=args.markexpr
 capture=args.capture
 reruns=args.reruns
 lf=args.lf
 test_type=args.test_type.lower()
 devices_info_file=args.devices_info_file
 if test_type=='phone':
     if not devices_info_file:
         sys.exit('请指定多设备并行信息文件,查看帮助:python run_app_ui_test.py --help')
     # 初始化进程池
     p_pool = Custom_Pool(int(Read_APP_UI_Config().app_ui_config.max_device_pool))
     devices_info=Read_APP_UI_Devices_Info(devices_info_file).devices_info
     if os.path.exists('config/app_ui_tmp'):
         FileTool.truncateDir('config/app_ui_tmp/')
     else:
         os.mkdir('config/app_ui_tmp')
     for i in range(len(devices_info)):
         device_info=devices_info[i]
         FileTool.writeObjectIntoFile(device_info,'config/app_ui_tmp/'+str(i))
         p=p_pool.apply_async(start_app_device_test,(i,device_info,keyword,dir,markexpr,capture,reruns,lf))
     p_pool.close()
     p_pool.join()
 else:
     # 执行pytest前的参数准备
     pytest_execute_params = ['-c', 'config/pytest.ini', '-v', '--alluredir', 'output/app_ui/windows']
     # 判断目录参数
     if not dir:
         dir = 'cases/app_ui/'
     # 判断关键字参数