contracts: consumer-driven contract testing lab (Spring Cloud Contract 5.0.3, Stubborn Contract 0.2.4, Pact JVM 4.7.7 on Spring Boot 4.2.0)

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017ic4b7h4ZNF4BDUpJk3Zou
This commit is contained in:
Claude
2026-11-29 02:29:20 +05:30
parent d7497c8ab1
commit 8a429ca578
46 changed files with 1986 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
#!/usr/bin/env python3
"""Reduce a Maven run to the lines that carry evidence: test results, assertion messages, pact verification
output. Removes launcher noise, Spring Boot banners and startup logs, WireMock request dumps and stack frames.
Usage: clean.py ROOT < raw > clean"""
import re, sys
root = sys.argv[1]
drop = re.compile(r"""^(
Picked\ up|WARNING:|OpenJDK\ 64-Bit|Mockito\ is\ currently|\[INFO\]\ (---|Scanning|Replacing|The\ original|Building|\ \ from|Deleting|Recompiling|Compiling|
skip|Will\ use|Directory\ with|Test\ Source|Using\ \[|Creating\ new|Generated|Converting|\ \ \ \ \ Spring|Stub\ Server|Files\ matching|
Total\ time|Finished|Results|Using\ auto|\ T\ E\ S\ T\ S|-----|Generating|Installing|Building\ jar|Copying|Nothing|Download)|
\d{4}-\d\d-\d\dT|\d\d:\d\d:\d\d\.\d+\ \[main\]|\s+at\ |\s+\.\.\.\ \d+\ more|
\s*\.\ \ \ ____|\s*/\\\\|\s*\(\ \(|\s*\\\\/|\s*'\ \ \||\s*=====|\ ::\ Spring\ Boot|
\s*Please\ note:|\s*and\ operating|\s*variable\ to|\[ERROR\]\s*$|\[INFO\]\s*$|\[ERROR\]\ (For\ more|Re-run|To\ see|Failed\ to\ execute|->\ \[Help|\[Help|See\ |Please\ read)|
Nov\ \d+,|org\.junit\.jupiter\.engine|OpenJDK|Found\ multiple|You\ may\ wish|\s+(jar:file|Content-Type|Host:|Content-Length|Connection|User-Agent)
)""", re.X)
out, skip_block = [], False
for line in sys.stdin:
line = line.rstrip("\n")
line = line.replace(root, "<repo>/contracts").replace("/root/.m2", "~/.m2")
line = re.sub(r"Time elapsed: [0-9.]+ s", "Time elapsed: N s", line)
# WireMock request/response dumps print between "127.0.0.1 - <verb>" / "Request received:" and the next test line
if re.match(r"^(127\.0\.0\.1 - |Request received:|Matched response definition:|Response:|-{10,}$)", line):
skip_block = True
if line.startswith("[INFO] Running") or line.startswith("[INFO] Tests run") or line.startswith("[ERROR] Tests run") or line.startswith("[INFO] BUILD") or line.startswith("[ERROR] Failures") or line.startswith("[ERROR] Errors"):
skip_block = False
if skip_block or drop.match(line):
continue
out.append(line)
text = "\n".join(out)
text = re.sub(r"\n{3,}", "\n\n", text).strip("\n")
print(text)