test(cli): exercise adaptive S3 pack reads

This commit is contained in:
vorotamoroz
2026-07-31 19:24:19 +00:00
parent f3b0fbb29b
commit bcf123c67a
3 changed files with 73 additions and 12 deletions
+27
View File
@@ -503,6 +503,33 @@ export async function listMinioObjectKeys(
.sort();
}
export async function readMinioObjectText(
minioEndpoint: string,
accessKey: string,
secretKey: string,
bucket: string,
key: string
): Promise<string> {
const cmd =
`mc alias set myminio ${shQuote(minioEndpoint)} ${shQuote(accessKey)} ${shQuote(secretKey)} >/dev/null 2>&1 && ` +
`mc cat myminio/${shQuote(bucket)}/${shQuote(key)}`;
const result = await docker(
"run",
"--rm",
"--network",
"host",
"--entrypoint",
"/bin/sh",
MINIO_MC_IMAGE,
"-c",
cmd
);
if (result.code !== 0) {
throw new Error(`Could not read MinIO object ${key}: ${result.stderr.trim()}`);
}
return result.stdout;
}
async function initMinioBucket(
minioEndpoint: string,
accessKey: string,