Files
seaweedfs/test/s3/tigris_compat/check_results.py
T
Chris LuandClaude Opus 5.5 b1c315b837 s3api: report no ownership controls after DeleteBucketOwnershipControls (#12748)
* test/s3: run tigrisdata-community s3-api-compat-tests in CI

Runs the suite, pinned to a commit, against weed mini through a small
provider patch, and fails on any test that is not in
expected_failures.txt or on a listed test that starts passing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011UpvafvK8JpagF94MHWqwK

* s3api: report no ownership controls after DeleteBucketOwnershipControls

GetBucketOwnershipControls reports BucketOwnerEnforced for a bucket that
never stored a setting, so it kept reporting it after the setting was
deleted. The delete now records that it happened, and GET answers
OwnershipControlsNotFoundError until ownership is put again. How
objects are written after the delete is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011UpvafvK8JpagF94MHWqwK

* s3api: answer DeleteBucketOwnershipControls with 204 No Content

AWS answers a successful DeleteBucketOwnershipControls with 204 and no
body; this answered 200 with an empty OwnershipControls document.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 14:25:15 -08:00

62 lines
1.9 KiB
Python

#!/usr/bin/env python3
"""Compare an s3-api-compat-tests JSON report with expected_failures.txt.
Fails on any test that did not pass and is not listed, and on any listed test
that now passes or did not run, so the list only ever shrinks.
"""
import json
import sys
def load_expected(path):
expected = set()
with open(path) as f:
for line in f:
name = line.split("#", 1)[0].strip()
if name:
expected.add(name)
return expected
def main():
if len(sys.argv) != 3:
sys.exit("usage: check_results.py <results.json> <expected_failures.txt>")
with open(sys.argv[1]) as f:
report = json.load(f)
expected = load_expected(sys.argv[2])
providers = report.get("providers") or []
results = providers[0].get("results") if providers else None
if not results:
sys.exit("no test results in the report: the suite could not start against the server")
seen = set()
regressions, fixed = [], []
for r in results:
name, status = r["operation"], r["status"]
seen.add(name)
detail = r.get("error") or r.get("notes") or ""
if status == "pass":
if name in expected:
fixed.append(name)
elif name not in expected:
regressions.append(f"{name} [{status}]: {detail}")
else:
print(f"expected failure: {name} [{status}]")
missing = sorted(expected - seen)
print(f"{len(results)} tests, {len(regressions)} unexpected failures, "
f"{len(fixed)} unexpected passes, {len(missing)} listed but not run")
for line in regressions:
print(f"UNEXPECTED FAILURE: {line}")
for name in fixed:
print(f"UNEXPECTED PASS: {name} (remove it from expected_failures.txt)")
for name in missing:
print(f"NOT RUN: {name} (remove it from expected_failures.txt)")
if regressions or fixed or missing:
sys.exit(1)
if __name__ == "__main__":
main()