Merge pull request #67978 from ClickHouse/ci_integration_tests_uncover_logs

CI: Integration tests uncover some logging
This commit is contained in:
Max K. 2024-08-08 08:45:23 +00:00 committed by GitHub
commit 01b6d4043b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -20,6 +20,7 @@ from typing import Any, Dict
from env_helper import IS_CI
from integration_test_images import IMAGES
from tee_popen import TeePopen
MAX_RETRY = 1
NUM_WORKERS = 5
@ -356,20 +357,13 @@ class ClickhouseIntegrationTestsRunner:
logging.info("Package found in %s", full_path)
log_name = "install_" + f + ".log"
log_path = os.path.join(str(self.path()), log_name)
with open(log_path, "w", encoding="utf-8") as log:
cmd = f"dpkg -x {full_path} ."
logging.info("Executing installation cmd %s", cmd)
with subprocess.Popen(
cmd, shell=True, stderr=log, stdout=log
) as proc:
if proc.wait() == 0:
logging.info(
"Installation of %s successfull", full_path
)
else:
raise RuntimeError(
f"Installation of {full_path} failed"
)
cmd = f"dpkg -x {full_path} ."
logging.info("Executing installation cmd %s", cmd)
with TeePopen(cmd, log_file=log_path) as proc:
if proc.wait() == 0:
logging.info("Installation of %s successfull", full_path)
else:
raise RuntimeError(f"Installation of {full_path} failed")
break
else:
raise FileNotFoundError(f"Package with {package} not found")