From 5a15739cc377195cf77aff2e5ce222afcacbac6a Mon Sep 17 00:00:00 2001 From: afwerar <1296468573@qq.com> Date: Wed, 25 May 2022 20:37:00 +0800 Subject: [PATCH] fix(os): run case on win --- tests/pytest/test.py | 10 +++------- tests/pytest/util/dnodes.py | 4 +--- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/tests/pytest/test.py b/tests/pytest/test.py index af6191e170..9d146462f2 100644 --- a/tests/pytest/test.py +++ b/tests/pytest/test.py @@ -148,17 +148,13 @@ if __name__ == "__main__": tdDnodes.deploy(1,{}) tdDnodes.startWin(1) else: - # remote_conn = Connection("root@%s"%host) - # with remote_conn.cd('/var/lib/jenkins/workspace/TDinternal/community/tests/pytest'): - # remote_conn.run("python3 ./test.py") - os.system("docker exec -d tdengine_test bash -c \"cd ~/TDinternal/community/tests/pytest && python3 ./test.py\"") - time.sleep(2) + remote_conn = Connection("root@%s"%host) + with remote_conn.cd('/var/lib/jenkins/workspace/TDinternal/community/tests/pytest'): + remote_conn.run("python3 ./test.py") tdDnodes.init(deployPath) conn = taos.connect( host="%s" % (host), config=tdDnodes.sim.getCfgDir()) - print(host) - print(tdDnodes.sim.getCfgDir()) tdCases.runOneWindows(conn, fileName) tdCases.logSql(logSql) else: diff --git a/tests/pytest/util/dnodes.py b/tests/pytest/util/dnodes.py index cc02703c4f..12e13c9b5c 100644 --- a/tests/pytest/util/dnodes.py +++ b/tests/pytest/util/dnodes.py @@ -518,8 +518,7 @@ class TDDnodes: processID = subprocess.check_output( psCmd, shell=True).decode("utf-8") - binPath = os.path.dirname(os.path.realpath(__file__)) - binPath = binPath + "/../../../debug/" + binPath = self.dnodes[0].getPath() + "/../../../" tdLog.debug("binPath %s" % (binPath)) binPath = os.path.realpath(binPath) tdLog.debug("binPath real path %s" % (binPath)) @@ -546,7 +545,6 @@ class TDDnodes: for i in range(len(self.dnodes)): self.dnodes[i].init(self.path) - print(self.path) self.sim = TDSimClient(self.path) def setTestCluster(self, value):