Skip to content

Commit

Permalink
修复了一些已知问题
Browse files Browse the repository at this point in the history
  • Loading branch information
mikigo committed Nov 8, 2024
1 parent 1cb9668 commit 6334a03
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 20 deletions.
2 changes: 1 addition & 1 deletion setting/globalconfig.ini
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ CLEAN_ALL = yes

;检查测试机分辨率, 比如:1920x1080, 多个分辨率检查用英文逗号连接。
;no: 表示不做分辨率校验
RESOLUTION = 1920x1080, 1080x1920, 3840x1080
RESOLUTION = 1920x1080, 1080x1920, 3840x1080, 1024x768

;不跳过用例,csv文件里面标记了 skip-xxx的用例不跳过
NOSKIP = no
Expand Down
2 changes: 1 addition & 1 deletion src/assert_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def assert_file_not_exist(widget, file=None, recursive=False):
def assert_element_exist(expr):
"""
期望元素存在
:param expr: 匹配元素的格式, 例如: $//dde-file-manager//1.txt
:param expr: 匹配元素的格式, 例如: $/dde-file-manager//1.txt
"""
sleep(0.5)
logger.info(f"断言元素存在<{expr}>")
Expand Down
17 changes: 8 additions & 9 deletions src/rtk/local_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@

from src import logger
from src.rtk._base import Args, write_json
from src.requestx import RequestX
from src.rtk._base import transform_app_name

environ["DISPLAY"] = ":0"
Expand Down Expand Up @@ -284,14 +283,14 @@ def create_pytest_cmd(self, app_dir, default=None, proj_path=None):
):
self.make_allure_report(cmd, GlobalConfig.ReportFormat.ALLURE, proj_path)
# xml
if GlobalConfig.ReportFormat.XML in report_formats:
self.make_xml_report(
app_dir,
default.get(Args.case_file.value),
cmd,
GlobalConfig.ReportFormat.XML,
proj_path,
)
# if GlobalConfig.ReportFormat.XML in report_formats:
# self.make_xml_report(
# app_dir,
# default.get(Args.case_file.value),
# cmd,
# GlobalConfig.ReportFormat.XML,
# proj_path,
# )
# json
if (GlobalConfig.ReportFormat.ALLURE not in report_formats) and (
GlobalConfig.ReportFormat.JSON in report_formats
Expand Down
23 changes: 14 additions & 9 deletions src/rtk/remote_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,12 @@ def __init__(
)
self.strf_time = strftime("%m%d%p%I%M%S")
self.server_detail_json_path = f"{GlobalConfig.REPORT_PATH}/json/{self.strf_time}_remote"
self.client_xml_report_path = (
lambda
x: f"/home/{x}/{self.server_project_path}/{GlobalConfig.report_cfg.get('XML_REPORT_PATH', default='report')}/xml".replace(
"//", "/"
)
)
# self.client_xml_report_path = (
# lambda
# x: f"/home/{x}/{self.server_project_path}/{GlobalConfig.report_cfg.get('XML_REPORT_PATH', default='report')}/xml".replace(
# "//", "/"
# )
# )
self.client_list = list(self.default.get(Args.clients.value).keys())
_pty = "t"
if len(self.client_list) >= 2:
Expand Down Expand Up @@ -195,15 +195,20 @@ def send_code_to_client(self, user, _ip, password):
continue
if app_name.replace("-", "_") != i:
exclude += f"--exclude='{i}' "
system(
status = system(
f"{self.rsync % (password,)} {exclude} {GlobalConfig.ROOT_DIR}/* "
f"{user}@{_ip}:~/{self.server_project_path}/ {self.empty}"
)
system(
self.set_youqu_run_exitcode(status)
status = system(
f"{self.rsync % (password,)} {exclude} {GlobalConfig.ROOT_DIR}/.env "
f"{user}@{_ip}:~/{self.server_project_path}/ {self.empty}"
)
logger.info(f"代码发送成功 - < {user}@{_ip} >")
self.set_youqu_run_exitcode(status)
if status != 0:
logger.error(f"代码发送失败 - < {user}@{_ip} >")
else:
logger.info(f"代码发送成功 - < {user}@{_ip} >")

def build_client_env(self, user, _ip, password):
"""
Expand Down

0 comments on commit 6334a03

Please sign in to comment.