From 6383c7ddac64e68347af23d63aaa7dac18df5806 Mon Sep 17 00:00:00 2001 From: peilun-conflux <48905552+peilun-conflux@users.noreply.github.com> Date: Mon, 10 Jun 2024 22:54:39 +0800 Subject: [PATCH] Update cli version and fix tests. (#81) * fix: test * Update cli version. --------- Co-authored-by: MiniFrenchBread <103425574+MiniFrenchBread@users.noreply.github.com> --- tests/test_framework/test_framework.py | 7 +++++-- tests/utility/build_binary.py | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/test_framework/test_framework.py b/tests/test_framework/test_framework.py index 06f8a33..05e53fc 100644 --- a/tests/test_framework/test_framework.py +++ b/tests/test_framework/test_framework.py @@ -4,6 +4,7 @@ import logging import os import pdb import random +import re import shutil import subprocess import sys @@ -381,8 +382,10 @@ class TestFramework: line = line.decode("utf-8") self.log.debug("line: %s", line) if "root" in line: - index = line.find("root=") - root = line[index + 5 : -1] + filtered_line = re.sub(r'\x1b\[([0-9,A-Z]{1,2}(;[0-9]{1,2})?(;[0-9]{3})?)?[m|K]?', '', line) + index = filtered_line.find("root=") + if index > 0: + root = filtered_line[index + 5 : index + 5 + 66] except Exception as ex: self.log.error("Failed to upload file via CLI tool, output: %s", output_name) raise ex diff --git a/tests/utility/build_binary.py b/tests/utility/build_binary.py index 9fa8823..5152428 100644 --- a/tests/utility/build_binary.py +++ b/tests/utility/build_binary.py @@ -17,7 +17,7 @@ ZG_BINARY = "0gchaind.exe" if is_windows_platform() else "0gchaind" CLIENT_BINARY = "0g-storage-client.exe" if is_windows_platform() else "0g-storage-client" ZG_GIT_REV = "7bc25a060fab9c17bc9942b6747cd07a668d3042" # v0.1.0 -CLI_GIT_REV = "1d09ec4f0b9c27428b2357de46b66e8c231b74df" +CLI_GIT_REV = "98d74b7e7e6084fc986cb43ce2c66692dac094a6" @unique class BuildBinaryResult(Enum):