From fe521c9d12a402dd3be8bc4c89967fa8c0df3cd6 Mon Sep 17 00:00:00 2001 From: He Yin Ling Date: Tue, 10 Dec 2019 09:38:31 +0800 Subject: [PATCH 1/2] ci: fix fetch submodule error on python3 --- tools/ci/ci_fetch_submodule.py | 1 + tools/ci/python_packages/gitlab_api.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/ci/ci_fetch_submodule.py b/tools/ci/ci_fetch_submodule.py index 89dce82ea6..9d30cb6958 100644 --- a/tools/ci/ci_fetch_submodule.py +++ b/tools/ci/ci_fetch_submodule.py @@ -32,6 +32,7 @@ class SubModule(object): def _get_commit_id(self, path): output = subprocess.check_output(["git", "ls-tree", "HEAD", path]) + output = output.decode() # example output: 160000 commit d88a262fbdf35e5abb372280eb08008749c3faa0 components/esp_wifi/lib match = self.GIT_LS_TREE_OUTPUT_PATTERN.search(output) return match.group(1) diff --git a/tools/ci/python_packages/gitlab_api.py b/tools/ci/python_packages/gitlab_api.py index d4fc4600fd..d2e6abe7f7 100644 --- a/tools/ci/python_packages/gitlab_api.py +++ b/tools/ci/python_packages/gitlab_api.py @@ -15,7 +15,7 @@ class Gitlab(object): config_data_from_env = os.getenv("PYTHON_GITLAB_CONFIG") if config_data_from_env: # prefer to load config from env variable - with tempfile.NamedTemporaryFile(delete=False) as temp_file: + with tempfile.NamedTemporaryFile("w", delete=False) as temp_file: temp_file.write(config_data_from_env) config_files = [temp_file.name] else: From 486f1a05b39186bfc394637ce364b780c8432a5b Mon Sep 17 00:00:00 2001 From: He Yin Ling Date: Tue, 10 Dec 2019 13:50:32 +0800 Subject: [PATCH 2/2] test: fix incorrect error type in xunit result --- tools/unit-test-app/unit_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/unit-test-app/unit_test.py b/tools/unit-test-app/unit_test.py index c6ed79b747..6028f6f809 100755 --- a/tools/unit-test-app/unit_test.py +++ b/tools/unit-test-app/unit_test.py @@ -223,7 +223,7 @@ def run_one_normal_case(dut, one_case, junit_test_case): err_msg = "Reset Check Failed: \r\n\tExpected: {}\r\n\tGet: {}".format(one_case["reset"], exception_reset_list) Utility.console_log(err_msg, color="orange") - junit_test_case.add_error_info(err_msg) + junit_test_case.add_failure_info(err_msg) one_case_finish(result) while not test_finish: