Merge branch 'linuxdeepin:master' into master

This commit is contained in:
Li Guangming 2024-03-11 16:54:36 +08:00 committed by GitHub
commit 4b60ed3dbc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 18 additions and 9 deletions

View File

@ -6,6 +6,11 @@ import os
from setting import conf from setting import conf
def git_config():
os.system("git config --global http.lowSpeedLimit 0")
os.system("git config --global http.lowSpeedTime 999999")
def sslclone( def sslclone(
url: str = None, url: str = None,
user: str = None, user: str = None,
@ -16,13 +21,16 @@ def sslclone(
): ):
branch = branch or conf.BRANCH branch = branch or conf.BRANCH
depth = depth or conf.DEPTH depth = depth or conf.DEPTH
os.system( git_config()
clone_cmd = (
f"cd {conf.ROOT_DIR}/src/utils && " f"cd {conf.ROOT_DIR}/src/utils && "
f"bash sslclone.sh {conf.APPS_PATH} " f"bash sslclone.sh {conf.APPS_PATH} "
f"{url or conf.GIT_URL} " f"{url or conf.GIT_URL} "
f"{user or conf.GTI_USER} {password or conf.GIT_PASSWORD} " f"{user or conf.GTI_USER} {password or conf.GIT_PASSWORD} "
f"{branch or ''} {depth or ''}" f"{branch or ''} {depth or ''}"
) )
print(clone_cmd)
os.system(clone_cmd)
def clone( def clone(
@ -33,8 +41,11 @@ def clone(
): ):
branch = branch or conf.BRANCH branch = branch or conf.BRANCH
depth = depth or conf.DEPTH depth = depth or conf.DEPTH
os.system( git_config()
f"cd {conf.APPS_PATH} && git clone {url} " clone_cmd = (
f"{url or conf.GIT_URL}" f"cd {conf.APPS_PATH} && git clone "
f"{f'-b {branch}' or ''} {f'--depth {depth}' or ''}" f"{url or conf.GIT_URL} "
f"{f'-b {branch}' if branch else ''} {f'--depth {depth}' if depth else ''}"
) )
print(clone_cmd)
os.system(clone_cmd)

View File

@ -72,15 +72,13 @@ class Pms2Csv(_Base):
f'{app_case_id}-{"-" if GlobalConfig.CASE_FROM == "testcase" else ""}all-0-id_desc-0-{MAX_CASE_NUMBER}.json' f'{app_case_id}-{"-" if GlobalConfig.CASE_FROM == "testcase" else ""}all-0-id_desc-0-{MAX_CASE_NUMBER}.json'
) )
res = self.rx.open_url(case_url, timeout=10) res = self.rx.open_url(case_url, timeout=10)
res_str = _unicode_to_cn(res)
try: try:
res_dict = json.loads(res_str) res_dict = json.loads(res)
except json.decoder.JSONDecodeError: except json.decoder.JSONDecodeError:
logger.error(f"获取pms数据失败, {self.config_error_log}") logger.error(f"获取pms数据失败, {self.config_error_log}")
return return
cases = res_dict.get("data").get("cases") cases = json.loads(res_dict["data"]).get("cases")
res_data = {} res_data = {}
for i in cases: for i in cases:
case = cases.get(i) case = cases.get(i)