From cb62511fa75b0831d8f30b4f222c46cb66d61e19 Mon Sep 17 00:00:00 2001 From: Goffi Date: Thu, 29 Jul 2021 22:51:01 +0200 Subject: [PATCH 1/2] tools (common/async_process): remove useless encoding + use full path for command: - arguments don't need to be encoded anymore, `spawnProcess` handles str directly now - use full path even for first argument: even if first argument should be only executable name, it appears that using full path only in `command` is not enough (seen with Python where system installation is used instead of the VirtualEnv one when full path is not used as first argument). (grafted from 25cbaf04772855cd8aead18771465a4f00f5fa03) --- sat/tools/common/async_process.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sat/tools/common/async_process.py b/sat/tools/common/async_process.py index 3d391175..9b29070c 100644 --- a/sat/tools/common/async_process.py +++ b/sat/tools/common/async_process.py @@ -114,8 +114,7 @@ class CommandProtocol(protocol.ProcessProtocol): if stdin is not None: stdin = stdin.encode('utf-8') verbose = kwargs.pop('verbose', False) - args = [a.encode('utf-8') for a in args] - kwargs = {k:v.encode('utf-8') for k,v in list(kwargs.items())} + args = list(args) d = defer.Deferred() prot = cls(d, stdin=stdin) if verbose: @@ -131,7 +130,7 @@ class CommandProtocol(protocol.ProcessProtocol): prot.name = name else: command = cls.command - cmd_args = [os.path.basename(command)] + args + cmd_args = [command] + args reactor.spawnProcess(prot, command, cmd_args, From 9753dd535493b8ef20d7fdb5de5c736260890bca Mon Sep 17 00:00:00 2001 From: Goffi Date: Wed, 8 Sep 2021 17:57:28 +0200 Subject: [PATCH 2/2] tests (e2e): print revision used in `run_e2e` --- tests/e2e/run_e2e.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/e2e/run_e2e.py b/tests/e2e/run_e2e.py index db9b3684..93eb158c 100755 --- a/tests/e2e/run_e2e.py +++ b/tests/e2e/run_e2e.py @@ -18,7 +18,7 @@ """Run end-to-end tests in appropriate Docker environment""" -import sys +import sys, os from pathlib import Path import tempfile from textwrap import dedent @@ -128,6 +128,8 @@ def write_report_log(path, log_raw, with_ansi=False): f.write(log_raw) def use_e2e_env(): + rev = os.getenv("DOCKER_LIBERVIA_REV", "dev") + print(f"Running tests for Libervia {rev}") visual = get_opt(OPT_VISUAL) keep_containers = get_opt(OPT_KEEP_CONTAINERS) keep_profiles = get_opt(OPT_KEEP_PROFILES)