...
 
Commits (11)
    https://gitcode.net/openharmony/test_xdevice/-/commit/868d36dc126186d50ee675222e8f4839c68e53ca 1、适配抓取远端设备日志 2、适配TDD运行OHJS测试套 2022-08-17T17:10:27+08:00 deveco_test liguangjie1@huawei.com Signed-off-by: <span data-trailer="Signed-off-by:"><a href="mailto:liguangjie1@huawei.com" title="liguangjie1@huawei.com"></a><a href="javascript:void(0)" class="avatar s16 avatar-inline identicon bg4" style="text-decoration: none">N</a><a href="mailto:liguangjie1@huawei.com" title="liguangjie1@huawei.com">deveco_test</a> &lt;<a href="mailto:liguangjie1@huawei.com" title="liguangjie1@huawei.com">liguangjie1@huawei.com</a>&gt;</span> https://gitcode.net/openharmony/test_xdevice/-/commit/8073c86adcff36106d405218971d45cc5cf2d0e8 OHJSTest驱动中不配置rerun也进行用例收集 2022-08-22T11:01:29+08:00 deveco_test liguangjie1@huawei.com Signed-off-by: <span data-trailer="Signed-off-by:"><a href="mailto:liguangjie1@huawei.com" title="liguangjie1@huawei.com"></a><a href="javascript:void(0)" class="avatar s16 avatar-inline identicon bg1" style="text-decoration: none">N</a><a href="mailto:liguangjie1@huawei.com" title="liguangjie1@huawei.com">deveco_test</a> &lt;<a href="mailto:liguangjie1@huawei.com" title="liguangjie1@huawei.com">liguangjie1@huawei.com</a>&gt;</span> https://gitcode.net/openharmony/test_xdevice/-/commit/511fe78c7052dd46a53c42ece9fda7e760d5d629 fix pushkit bug 2022-08-23T16:06:32+08:00 deveco_test liguangjie1@huawei.com Signed-off-by: <span data-trailer="Signed-off-by:"><a href="mailto:liguangjie1@huawei.com" title="liguangjie1@huawei.com"></a><a href="javascript:void(0)" class="avatar s16 avatar-inline identicon bg6" style="text-decoration: none">N</a><a href="mailto:liguangjie1@huawei.com" title="liguangjie1@huawei.com">deveco_test</a> &lt;<a href="mailto:liguangjie1@huawei.com" title="liguangjie1@huawei.com">liguangjie1@huawei.com</a>&gt;</span> https://gitcode.net/openharmony/test_xdevice/-/commit/d08950f7d6f39279f4d454ae36486ec1841167b4 修复告警问题 2022-08-26T10:28:35+08:00 deveco_test liguangjie1@huawei.com Signed-off-by: <span data-trailer="Signed-off-by:"><a href="mailto:liguangjie1@huawei.com" title="liguangjie1@huawei.com"></a><a href="javascript:void(0)" class="avatar s16 avatar-inline identicon bg4" style="text-decoration: none">N</a><a href="mailto:liguangjie1@huawei.com" title="liguangjie1@huawei.com">deveco_test</a> &lt;<a href="mailto:liguangjie1@huawei.com" title="liguangjie1@huawei.com">liguangjie1@huawei.com</a>&gt;</span> https://gitcode.net/openharmony/test_xdevice/-/commit/a1deacac6a9c89db3598dcfd1cba0ad4610d5e15 !153 合并主干代码到月度分支 2022-08-27T09:37:38+00:00 openharmony_ci 120357966@qq.com Merge pull request !153 from liguangjie/master https://gitcode.net/openharmony/test_xdevice/-/commit/c0d8a0885cbc746015061c0a963721295c3d1220 修复告警问题 2022-08-29T09:51:14+08:00 deveco_test liguangjie1@huawei.com Signed-off-by: <span data-trailer="Signed-off-by:"><a href="mailto:liguangjie1@huawei.com" title="liguangjie1@huawei.com"></a><a href="javascript:void(0)" class="avatar s16 avatar-inline identicon bg3" style="text-decoration: none">N</a><a href="mailto:liguangjie1@huawei.com" title="liguangjie1@huawei.com">deveco_test</a> &lt;<a href="mailto:liguangjie1@huawei.com" title="liguangjie1@huawei.com">liguangjie1@huawei.com</a>&gt;</span> https://gitcode.net/openharmony/test_xdevice/-/commit/32fd7248b55b08aec7d799d55c1eace378d583f3 !154 修复代码告警问题 2022-08-29T13:40:12+00:00 openharmony_ci 120357966@qq.com Merge pull request !154 from liguangjie/master https://gitcode.net/openharmony/test_xdevice/-/commit/75760e121e6e8506beeb9257a8fa3dc54fb906c4 fixed 229a8ec from https://gitee.com/kuanjay/test_xdevice/pulls/157 2022-08-30T07:35:13+00:00 deveco_test liguangjie1@huawei.com fix PushKit bug Signed-off-by: <span data-trailer="Signed-off-by:"><a href="mailto:liguangjie1@huawei.com" title="liguangjie1@huawei.com"></a><a href="javascript:void(0)" class="avatar s16 avatar-inline identicon bg6" style="text-decoration: none">N</a><a href="mailto:liguangjie1@huawei.com" title="liguangjie1@huawei.com">deveco_test</a> &lt;<a href="mailto:liguangjie1@huawei.com" title="liguangjie1@huawei.com">liguangjie1@huawei.com</a>&gt;</span> https://gitcode.net/openharmony/test_xdevice/-/commit/e5733e4a666c75bd3010a8ce1ea904b74b881a84 !159 修复PushKit反斜杠导致资源没有推送成功 2022-08-30T09:30:05+00:00 openharmony_ci 120357966@qq.com Merge pull request !159 from liguangjie/cherry-pick-1661844913 https://gitcode.net/openharmony/test_xdevice/-/commit/26f7edc4a4e594df9a5a016e531a957fbab3dcf9 fixed b1cd363 from https://gitee.com/kuanjay/test_xdevice/pulls/161 2022-08-30T13:05:32+00:00 deveco_test liguangjie1@huawei.com fix PushKit bug Signed-off-by: <span data-trailer="Signed-off-by:"><a href="mailto:liguangjie1@huawei.com" title="liguangjie1@huawei.com"></a><a href="javascript:void(0)" class="avatar s16 avatar-inline identicon bg4" style="text-decoration: none">N</a><a href="mailto:liguangjie1@huawei.com" title="liguangjie1@huawei.com">deveco_test</a> &lt;<a href="mailto:liguangjie1@huawei.com" title="liguangjie1@huawei.com">liguangjie1@huawei.com</a>&gt;</span> https://gitcode.net/openharmony/test_xdevice/-/commit/33c984e7d7fbd71cff6f69c76c06ea3e7ed510c4 !162 修复PushKit反斜杠导致资源没有推送成功2 2022-08-30T13:58:19+00:00 openharmony_ci 120357966@qq.com Merge pull request !162 from liguangjie/cherry-pick-1661864731
......@@ -381,9 +381,8 @@ class OHJSUnitTestDriver(IDriver):
self._run_with_rerun(listener, test_to_run)
def _collect_test_to_run(self):
if self.rerun:
run_results = self.runner.dry_run()
return run_results
run_results = self.runner.dry_run()
return run_results
def _run_tests(self, listener):
test_tracker = CollectingPassListener()
......
......@@ -315,6 +315,8 @@ class Device(IDevice):
The top directory won't be created if is_create is False (by default)
and vice versa
"""
local = "\"{}\"".format(local)
remote = "\"{}\"".format(remote)
if local is None:
raise HdcError("XDevice Local path cannot be None!")
......@@ -343,6 +345,8 @@ class Device(IDevice):
The top directory won't be created if is_create is False (by default)
and vice versa
"""
local = "\"{}\"".format(local)
remote = "\"{}\"".format(remote)
if self.host != "127.0.0.1":
self.connector_command("file recv {} {}".format(remote, local))
else:
......@@ -390,7 +394,10 @@ class Device(IDevice):
def _start_catch_device_log(self):
if self.hilog_file_pipe:
command = "hilog"
cmd = ['hdc_std', "-t", self.device_sn, "shell", command]
if self.host != "127.0.0.1":
cmd = ["hdc_std", "-s", "{}:{}".format(self.host, self.port), "shell", command]
else:
cmd = ['hdc_std', "-t", self.device_sn, "shell", command]
LOG.info("execute command: %s" % " ".join(cmd).replace(
self.device_sn, convert_serial(self.device_sn)))
self.device_hilog_proc = start_standing_subprocess(
......
......@@ -249,16 +249,20 @@ class PushKit(ITestKit):
device.connector_command("shell mkdir {}".format(dst))
for root, _, files in os.walk(real_src_path):
for file in files:
device.connector_command(
"file send \"{}\" \"{}\"".format(os.path.join(root, file),
dst))
device.push_file("{}".format(os.path.join(root, file)),
"{}".format(dst))
LOG.debug(
"Push file finished from {} to {}".format(
os.path.join(root, file), dst))
self.pushed_file.append(os.path.join(dst, file))
else:
device.connector_command("file send \"{}\" \"{}\"".format(real_src_path,
dst))
if device.is_directory(dst):
dst = os.path.join(dst, os.path.basename(real_src_path))
if dst.find("\\") > -1:
dst_paths = dst.split("\\")
dst = "/".join(dst_paths)
device.push_file("{}".format(real_src_path),
"{}".format(dst))
LOG.debug("Push file finished from {} to {}".format(src, dst))
self.pushed_file.append(dst)
for command in self.post_push:
......
......@@ -22,7 +22,7 @@ error()
exit 1
}
PYTHON="python3"
TOOLS="tools"
TOOLS_DIR="tools"
flag=$(command -v $PYTHON | grep -c $PYTHON)
if [ "$flag" -eq 0 ]; then
......@@ -35,15 +35,15 @@ cd $(dirname "$0") || error "Failure to change direcory!"
$PYTHON -c "import pip" || error "Please install pip first!"
$PYTHON -c "import easy_install" || error "Please install setuptools first!"
if [ ! -d $TOOLS ]; then
error "$TOOLS directory not exists"
if [ ! -d "$TOOLS_DIR" ]; then
error "$TOOLS_DIR directory not exists"
fi
$PYTHON -m pip uninstall -y xdevice
$PYTHON -m pip uninstall -y xdevice-extension
$PYTHON -m pip uninstall -y xdevice-ohos
for f in "$TOOLS"/*.egg
for f in "$TOOLS_DIR"/*.egg
do
if [ ! -e "$f" ]; then
error "Can not find xdevice package!"
......@@ -51,7 +51,7 @@ do
$PYTHON -m easy_install --user "$f" || echo "Error occurs to install $f!"
done
for f in "$TOOLS"/*.tar.gz
for f in "$TOOLS_DIR"/*.tar.gz
do
if [ ! -e "$f" ]; then
error "Can not find xdevice package!"
......
......@@ -120,6 +120,8 @@ class EnvironmentManager(object):
manager_instance
except Exception as error:
LOG.debug("Env start error: %s" % error)
if len(self.managers):
self.managers = dict(sorted(self.managers.items(), reverse=True))
def env_stop(self):
for manager in self.managers.values():
......
......@@ -45,6 +45,7 @@ TEST_TYPE_DICT = {"DEX": DeviceTestType.dex_test,
"APK": DeviceTestType.hap_test,
"PYT": HostDrivenTestType.device_test,
"JST": DeviceTestType.jsunit_test,
"OHJST": DeviceTestType.oh_jsunit_test,
"CXX": DeviceTestType.cpp_test,
"BIN": DeviceTestType.lite_cpp_test}
EXT_TYPE_DICT = {".dex": DeviceTestType.dex_test,
......
......@@ -381,7 +381,8 @@ class EncryptFileHandler(RotatingFileHandler):
# baseFilename is the attribute in FileHandler
base_file_name = getattr(self, "baseFilename", None)
return open(base_file_name, self.mode)
with open(base_file_name, self.mode) as handler:
return handler
def emit(self, record):
try:
......
......@@ -553,20 +553,21 @@ class VisionHelper:
LOG.error("Template file not exists")
return ""
file_context = open(self.template_name).read()
file_context = self._render_key("", ReportConstant.title_name,
title_name, file_context)
file_context = self._render_exec_info(file_context, exec_info)
file_context = self._render_summary(file_context, summary)
if render_target == ReportConstant.summary_vision_report:
file_context = self._render_suites(file_context, suites)
elif render_target == ReportConstant.details_vision_report:
file_context = self._render_cases(file_context, suites)
elif render_target == ReportConstant.failures_vision_report:
file_context = self._render_failure_cases(file_context, suites)
else:
LOG.error("Unsupported vision report type: %s", render_target)
return file_context
with open(self.template_name) as file:
file_context = file.read()
file_context = self._render_key("", ReportConstant.title_name,
title_name, file_context)
file_context = self._render_exec_info(file_context, exec_info)
file_context = self._render_summary(file_context, summary)
if render_target == ReportConstant.summary_vision_report:
file_context = self._render_suites(file_context, suites)
elif render_target == ReportConstant.details_vision_report:
file_context = self._render_cases(file_context, suites)
elif render_target == ReportConstant.failures_vision_report:
file_context = self._render_failure_cases(file_context, suites)
else:
LOG.error("Unsupported vision report type: %s", render_target)
return file_context
@classmethod
def _render_key(cls, prefix, key, new_str, update_context):
......