未验证 提交 940c4374 编写于 作者: M mipengwei 提交者: Gitee

Signed-off-by:mipengwei <mipengwei@huawei.com>

上级 d1044e27
......@@ -28,47 +28,6 @@ from xdevice import ExecInfo
LOG = platform_logger("distribute_utils")
def execute_distribute_test_file(py_test_file, result_rootpath):
if os.path.exists(py_test_file):
environ_dic = dict(os.environ)
environ_dic["PYTEST_PYTESTPATH"] = sys.pytest_dir
environ_dic["PYTEST_RESULTPATH"] = result_rootpath
proc = subprocess.Popen([sys.executable, py_test_file],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
shell=False,
env=environ_dic)
print("proc", proc)
try:
while proc.poll() is None:
line = proc.stdout.readline()
line = line.strip()
if isinstance(line, bytes):
line = line.decode('utf-8', 'ignore')
if line != "":
LOG.info(line)
finally:
data = proc.stdout.read()
if isinstance(data, bytes):
data = data.decode('utf-8', 'ignore')
if data != "":
LOG.info(data.rstrip("\n"))
data = proc.stderr.read()
if isinstance(data, bytes):
data = data.decode('utf-8', 'ignore')
if data != "":
error_message = data.rstrip("\n")
LOG.info(error_message)
proc.stdout.close()
proc.stderr.close()
return
def make_device_info_file(tmp_path):
env_manager = EnvironmentManager()
device_info_file_path = os.path.join(tmp_path,
......
......@@ -228,29 +228,6 @@ class Run(object):
LOG.info("testcase_path=%s" % testcase_path)
return testcase_path
@classmethod
def get_tests_output_path(cls, product_form):
testcase_path = UserConfigManager().get_test_case_output_dir()
if testcase_path == "":
all_product_list = scan_support_product()
if product_form in all_product_list:
if is_open_source_product(product_form):
testcase_path = os.path.abspath(os.path.join(
get_build_output_path(product_form),
"packages",
"phone",
"tests"))
else:
testcase_path = os.path.abspath(os.path.join(
get_build_output_path(product_form),
"packages",
product_form,
"tests"))
else:
testcase_path = os.path.join(
get_build_output_path(product_form), "test")
LOG.info("testcase_path=%s" % testcase_path)
return testcase_path
@classmethod
def get_coverage_outpath(cls, options):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册