test: start SeaweedFS directly with docker run

This commit is contained in:
daniel.radl 2026-09-17 15:29:33 +02:00
parent 047d6dc30b
commit 8c927fc996
3 changed files with 22 additions and 21 deletions

View File

@ -1,5 +0,0 @@
services:
s3:
image: chrislusf/seaweedfs:latest
profiles: [backup]
command: [mini, -dir=/data]

View File

@ -140,20 +140,28 @@ def s3_service(python_path: str, compose: Compose):
secret_key = "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY" secret_key = "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"
container_name = f"{compose.project_name}-s3" container_name = f"{compose.project_name}-s3"
try: try:
compose( subprocess.check_call(
"run", (
"--detach", "docker",
"--no-deps", "run",
"--use-aliases", "--detach",
"--name", "--pull=always",
container_name, "--name",
"-e", container_name,
f"AWS_ACCESS_KEY_ID={access_key}", "--network",
"-e", f"{compose.project_name}_default",
f"AWS_SECRET_ACCESS_KEY={secret_key}", "--network-alias",
"-e", "s3",
f"S3_BUCKET={bucket}", "-e",
"s3", f"AWS_ACCESS_KEY_ID={access_key}",
"-e",
f"AWS_SECRET_ACCESS_KEY={secret_key}",
"-e",
f"S3_BUCKET={bucket}",
"chrislusf/seaweedfs:latest",
"mini",
"-dir=/data",
)
) )
compose("cp", "tests/_wait_for_s3.py", "backend:/tmp") compose("cp", "tests/_wait_for_s3.py", "backend:/tmp")
compose.exec("backend", "bench", "pip", "install", "boto3~=1.34.143") compose.exec("backend", "bench", "pip", "install", "boto3~=1.34.143")

View File

@ -34,8 +34,6 @@ class Compose:
"overrides/compose.mariadb.yaml", "overrides/compose.mariadb.yaml",
"-f", "-f",
"overrides/compose.redis.yaml", "overrides/compose.redis.yaml",
"-f",
"tests/compose.s3.yaml",
] ]
if CI: if CI:
file_args += ("-f", "tests/compose.ci.yaml") file_args += ("-f", "tests/compose.ci.yaml")