2
0
mirror of https://github.com/frappe/frappe_docker.git synced 2025-01-10 09:02:13 +00:00

Fix docker compose in tests when not running on TTY

This commit is contained in:
Lev Vereshchagin 2022-02-08 12:32:44 +03:00
parent 2e39a8f7ce
commit 290aafb140

View File

@ -135,7 +135,7 @@ def ping_links_in_backends():
for service in BACKEND_SERVICES: for service in BACKEND_SERVICES:
for _ in range(10): for _ in range(10):
try: try:
docker_compose("exec", service, "healthcheck.sh") docker_compose("exec", "-T", service, "healthcheck.sh")
break break
except subprocess.CalledProcessError: except subprocess.CalledProcessError:
sleep(1) sleep(1)
@ -147,6 +147,7 @@ def ping_links_in_backends():
def create_site(): def create_site():
docker_compose( docker_compose(
"exec", "exec",
"-T",
"backend", "backend",
"bench", "bench",
"new-site", "new-site",
@ -211,6 +212,7 @@ def ping_frappe_connections_in_backends():
docker_compose("cp", "tests/_ping_frappe_connections.py", f"{service}:/tmp/") docker_compose("cp", "tests/_ping_frappe_connections.py", f"{service}:/tmp/")
docker_compose( docker_compose(
"exec", "exec",
"-T",
service, service,
"/home/frappe/frappe-bench/env/bin/python", "/home/frappe/frappe-bench/env/bin/python",
f"/tmp/_ping_frappe_connections.py", f"/tmp/_ping_frappe_connections.py",
@ -260,6 +262,7 @@ def prepare_s3_server():
docker_compose("cp", "tests/_create_bucket.py", "backend:/tmp") docker_compose("cp", "tests/_create_bucket.py", "backend:/tmp")
docker_compose( docker_compose(
"exec", "exec",
"-T",
"-e", "-e",
f"S3_ACCESS_KEY={S3_ACCESS_KEY}", f"S3_ACCESS_KEY={S3_ACCESS_KEY}",
"-e", "-e",
@ -273,10 +276,11 @@ def prepare_s3_server():
@log("Push backup to S3") @log("Push backup to S3")
def push_backup_to_s3(): def push_backup_to_s3():
docker_compose( docker_compose(
"exec", "backend", "bench", "--site", SITE_NAME, "backup", "--with-files" "exec", "-T", "backend", "bench", "--site", SITE_NAME, "backup", "--with-files"
) )
docker_compose( docker_compose(
"exec", "exec",
"-T",
"backend", "backend",
"push-backup", "push-backup",
"--site", "--site",
@ -299,6 +303,7 @@ def check_backup_in_s3():
docker_compose("cp", "tests/_check_backup_files.py", "backend:/tmp") docker_compose("cp", "tests/_check_backup_files.py", "backend:/tmp")
docker_compose( docker_compose(
"exec", "exec",
"-T",
"-e", "-e",
f"S3_ACCESS_KEY={S3_ACCESS_KEY}", f"S3_ACCESS_KEY={S3_ACCESS_KEY}",
"-e", "-e",
@ -341,6 +346,7 @@ def create_containers_with_erpnext_override():
def create_erpnext_site(): def create_erpnext_site():
docker_compose( docker_compose(
"exec", "exec",
"-T",
"backend", "backend",
"bench", "bench",
"new-site", "new-site",
@ -379,13 +385,14 @@ def create_containers_with_postgres_override():
@log("Create Postgres site") @log("Create Postgres site")
def create_postgres_site(): def create_postgres_site():
docker_compose( docker_compose(
"exec", "backend", "bench", "set-config", "-g", "root_login", "postgres" "exec", "-T", "backend", "bench", "set-config", "-g", "root_login", "postgres"
) )
docker_compose( docker_compose(
"exec", "backend", "bench", "set-config", "-g", "root_password", "123" "exec", "-T", "backend", "bench", "set-config", "-g", "root_password", "123"
) )
docker_compose( docker_compose(
"exec", "exec",
"-T",
"backend", "backend",
"bench", "bench",
"new-site", "new-site",