test: start SeaweedFS directly with docker run
This commit is contained in:
parent
047d6dc30b
commit
8c927fc996
|
|
@ -1,5 +0,0 @@
|
||||||
services:
|
|
||||||
s3:
|
|
||||||
image: chrislusf/seaweedfs:latest
|
|
||||||
profiles: [backup]
|
|
||||||
command: [mini, -dir=/data]
|
|
||||||
|
|
@ -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")
|
||||||
|
|
|
||||||
|
|
@ -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")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue