mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 09:32:06 +00:00
Merge pull request #36866 from ClickHouse/integration-tests
Fix using proper image for integration tests; improve logging; fix docker volume cleaning in integration-tests-runner.
This commit is contained in:
commit
d5b1e39bb9
@ -28,8 +28,11 @@ done
|
||||
set -e
|
||||
|
||||
# cleanup for retry run if volume is not recreated
|
||||
docker kill "$(docker ps -aq)" || true
|
||||
docker rm "$(docker ps -aq)" || true
|
||||
# shellcheck disable=SC2046
|
||||
{
|
||||
docker kill $(docker ps -aq) || true
|
||||
docker rm $(docker ps -aq) || true
|
||||
}
|
||||
|
||||
echo "Start tests"
|
||||
export CLICKHOUSE_TESTS_SERVER_BIN_PATH=/clickhouse
|
||||
|
@ -210,22 +210,29 @@ if __name__ == "__main__":
|
||||
|
||||
json_path = os.path.join(work_path, "params.json")
|
||||
with open(json_path, "w", encoding="utf-8") as json_params:
|
||||
json_params.write(
|
||||
json.dumps(
|
||||
get_json_params_dict(
|
||||
check_name,
|
||||
pr_info,
|
||||
images_with_versions,
|
||||
run_by_hash_total,
|
||||
run_by_hash_num,
|
||||
)
|
||||
params_text = json.dumps(
|
||||
get_json_params_dict(
|
||||
check_name,
|
||||
pr_info,
|
||||
images_with_versions,
|
||||
run_by_hash_total,
|
||||
run_by_hash_num,
|
||||
)
|
||||
)
|
||||
json_params.write(params_text)
|
||||
logging.info("Parameters file %s is written: %s", json_path, params_text)
|
||||
|
||||
output_path_log = os.path.join(result_path, "main_script_log.txt")
|
||||
|
||||
runner_path = os.path.join(repo_path, "tests/integration", "ci-runner.py")
|
||||
run_command = f"sudo -E {runner_path} | tee {output_path_log}"
|
||||
logging.info("Going to run command: `%s`", run_command)
|
||||
logging.info(
|
||||
"ENV parameters for runner:\n%s",
|
||||
"\n".join(
|
||||
[f"{k}={v}" for k, v in my_env.items() if k.startswith("CLICKHOUSE_")]
|
||||
),
|
||||
)
|
||||
|
||||
with TeePopen(run_command, output_path_log, my_env) as process:
|
||||
retcode = process.wait()
|
||||
|
@ -246,8 +246,7 @@ class ClickhouseIntegrationTestsRunner:
|
||||
return name + ":latest"
|
||||
return name
|
||||
|
||||
def get_single_image_version(self):
|
||||
name = self.get_images_names()[0]
|
||||
def get_image_version(self, name: str):
|
||||
if name in self.image_versions:
|
||||
return self.image_versions[name]
|
||||
logging.warn(
|
||||
@ -473,7 +472,7 @@ class ClickhouseIntegrationTestsRunner:
|
||||
):
|
||||
for img in self.get_images_names():
|
||||
if img == "clickhouse/integration-tests-runner":
|
||||
runner_version = self.get_single_image_version()
|
||||
runner_version = self.get_image_version(img)
|
||||
logging.info(
|
||||
"Can run with custom docker image version %s", runner_version
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user