Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
45c9265bd9 | ||
|
|
cfbc240e43 | ||
|
|
b39b719f85 |
No files matched your search
File diff suppressed because it is too large.
Load diff
@@ -707,12 +707,42 @@ def main() -> int:
|
||||
}
|
||||
behat_env.update(cfg["extraEnvironment"])
|
||||
|
||||
print(f"Running suites: {behat_suites_raw} (type: {acceptance_test_type})")
|
||||
result = subprocess.run(
|
||||
["make", "-C", str(repo_root), "test-acceptance-api"],
|
||||
env=behat_env,
|
||||
)
|
||||
return result.returncode
|
||||
print(f"Running suites: {suites} (type: {acceptance_test_type})")
|
||||
|
||||
if len(suites) == 1:
|
||||
# single suite: stream output directly
|
||||
result = subprocess.run(
|
||||
["make", "-C", str(repo_root), "test-acceptance-api"],
|
||||
env=behat_env,
|
||||
)
|
||||
return result.returncode
|
||||
|
||||
# multiple suites: run in parallel against the shared OCIS instance,
|
||||
# one behat process per suite, output captured and printed serially on completion.
|
||||
import concurrent.futures
|
||||
|
||||
def run_suite(suite: str) -> tuple:
|
||||
env = {**behat_env, "BEHAT_SUITES": suite}
|
||||
proc = subprocess.run(
|
||||
["make", "-C", str(repo_root), "test-acceptance-api"],
|
||||
env=env, capture_output=True, text=True,
|
||||
)
|
||||
return suite, proc.returncode, proc.stdout + proc.stderr
|
||||
|
||||
results = []
|
||||
with concurrent.futures.ThreadPoolExecutor(max_workers=len(suites)) as pool:
|
||||
fut_to_suite = {pool.submit(run_suite, s): s for s in suites}
|
||||
for fut in concurrent.futures.as_completed(fut_to_suite):
|
||||
suite, rc, output = fut.result()
|
||||
print(f"\n{'=' * 60}\n=== suite: {suite} (exit {rc}) ===\n{'=' * 60}", flush=True)
|
||||
print(output, flush=True)
|
||||
results.append((suite, rc))
|
||||
|
||||
failed = [s for s, rc in results if rc != 0]
|
||||
if failed:
|
||||
print(f"FAILED suites: {failed}")
|
||||
return 1
|
||||
return 0
|
||||
|
||||
finally:
|
||||
cleanup()
|
||||
|
||||
@@ -142,8 +142,7 @@ def setup_for_litmus(ocis_url: str) -> tuple:
|
||||
return space_id, public_token
|
||||
|
||||
|
||||
def run_litmus(name: str, endpoint: str) -> int:
|
||||
print(f"\nTesting endpoint [{name}]: {endpoint}", flush=True)
|
||||
def run_litmus(name: str, endpoint: str) -> tuple:
|
||||
result = subprocess.run(
|
||||
["docker", "run", "--rm",
|
||||
"-e", f"LITMUS_URL={endpoint}",
|
||||
@@ -154,8 +153,9 @@ def run_litmus(name: str, endpoint: str) -> int:
|
||||
# No extra CMD — ENTRYPOINT is already litmus-wrapper; passing it again
|
||||
# would make the wrapper use the path as LITMUS_URL, overriding the env var.
|
||||
],
|
||||
capture_output=True, text=True,
|
||||
)
|
||||
return result.returncode
|
||||
return result.returncode, result.stdout + result.stderr
|
||||
|
||||
|
||||
def main() -> int:
|
||||
@@ -222,11 +222,21 @@ def main() -> int:
|
||||
("spaces-endpoint", f"{litmus_base}/remote.php/dav/spaces/{space_id}"),
|
||||
]
|
||||
|
||||
failed = []
|
||||
for name, endpoint in endpoints:
|
||||
rc = run_litmus(name, endpoint)
|
||||
if rc != 0:
|
||||
failed.append(name)
|
||||
import concurrent.futures
|
||||
|
||||
# all 5 endpoints are independent docker containers — run in parallel
|
||||
print(f"Running {len(endpoints)} litmus endpoints in parallel", flush=True)
|
||||
results = []
|
||||
with concurrent.futures.ThreadPoolExecutor(max_workers=len(endpoints)) as pool:
|
||||
fut_to_name = {pool.submit(run_litmus, n, e): n for n, e in endpoints}
|
||||
for fut in concurrent.futures.as_completed(fut_to_name):
|
||||
name = fut_to_name[fut]
|
||||
rc, output = fut.result()
|
||||
print(f"\n{'=' * 60}\n=== endpoint: {name} (exit {rc}) ===\n{'=' * 60}", flush=True)
|
||||
print(output, flush=True)
|
||||
results.append((name, rc))
|
||||
|
||||
failed = [name for name, rc in results if rc != 0]
|
||||
|
||||
if failed:
|
||||
print(f"\nFailed endpoints: {', '.join(failed)}", file=sys.stderr)
|
||||
|
||||
@@ -217,8 +217,7 @@ def prepare_test_file(bridge_ip: str) -> tuple:
|
||||
|
||||
|
||||
def run_validator(group: str, token: str, wopi_src: str, ttl: str,
|
||||
secure: bool = False) -> int:
|
||||
print(f"\nRunning testgroup [{group}] secure={secure}", flush=True)
|
||||
secure: bool = False) -> tuple:
|
||||
cmd = [
|
||||
"docker", "run", "--rm",
|
||||
"--workdir", "/app",
|
||||
@@ -228,7 +227,8 @@ def run_validator(group: str, token: str, wopi_src: str, ttl: str,
|
||||
if secure:
|
||||
cmd.append("-s")
|
||||
cmd += ["-t", token, "-w", wopi_src, "-l", ttl, "--testgroup", group]
|
||||
return subprocess.run(cmd).returncode
|
||||
result = subprocess.run(cmd, capture_output=True, text=True)
|
||||
return result.returncode, result.stdout + result.stderr
|
||||
|
||||
|
||||
def main() -> int:
|
||||
@@ -346,18 +346,28 @@ def main() -> int:
|
||||
# --- prepare-test-file: upload file, get WOPI credentials ---
|
||||
access_token, ttl, wopi_src = prepare_test_file(bridge_ip)
|
||||
|
||||
# --- Run validator for each testgroup ---
|
||||
failed = []
|
||||
for group in SHARED_TESTGROUPS:
|
||||
rc = run_validator(group, access_token, wopi_src, ttl, secure=False)
|
||||
if rc != 0:
|
||||
failed.append(group)
|
||||
# --- Run all validator testgroups in parallel ---
|
||||
import concurrent.futures
|
||||
|
||||
all_groups = [(g, False) for g in SHARED_TESTGROUPS]
|
||||
if wopi_type == "builtin":
|
||||
for group in BUILTIN_ONLY_TESTGROUPS:
|
||||
rc = run_validator(group, access_token, wopi_src, ttl, secure=True)
|
||||
if rc != 0:
|
||||
failed.append(group)
|
||||
all_groups += [(g, True) for g in BUILTIN_ONLY_TESTGROUPS]
|
||||
|
||||
print(f"Running {len(all_groups)} WOPI testgroups in parallel", flush=True)
|
||||
results = []
|
||||
with concurrent.futures.ThreadPoolExecutor(max_workers=len(all_groups)) as pool:
|
||||
fut_to_group = {
|
||||
pool.submit(run_validator, g, access_token, wopi_src, ttl, s): g
|
||||
for g, s in all_groups
|
||||
}
|
||||
for fut in concurrent.futures.as_completed(fut_to_group):
|
||||
group = fut_to_group[fut]
|
||||
rc, output = fut.result()
|
||||
print(f"\n{'=' * 60}\n=== testgroup: {group} (exit {rc}) ===\n{'=' * 60}", flush=True)
|
||||
print(output, flush=True)
|
||||
results.append((group, rc))
|
||||
|
||||
failed = [g for g, rc in results if rc != 0]
|
||||
|
||||
if failed:
|
||||
print(f"\nFailed testgroups: {', '.join(failed)}", file=sys.stderr)
|
||||
|
||||
Reference in new issue
Block a user